How to get the operating system language in a desktop application built with electron-vue?

for example, the scenario is as follows: in a desktop application built with electron-vue, because you need to do multiple languages, you want to get the language used by the user"s operating system when you start the application, and set it as the preferred language of the application. However, because of the chrome browser used by electron, only the language of chrome can be obtained through navigator, not the system language. I also looked at the os module of node, but there seems to be no language information, and there is a doubt that node does not seem to run on the client side. Waiting for the boss with relevant experience to solve the problem.

clipboard.png


use app.getLocale (). Note that on Windows it must be called after the ready event

see
https://github.com/electron/e.
https://discuss.atom.io/t/how.

Menu