I have a vue project,I want to set some build params to different language according to current system language,so How can i get current system language in vue.config.js?
Asked
Active
Viewed 161 times
0
-
What's the system you are using? – Emīls Gulbis Dec 22 '21 at 08:35
-
Current language of which system? It will be the language of your OS if you run it locally, and the language of a server if it runs remotely. – Estus Flask Dec 22 '21 at 09:07
-
@EmīlsGulbis I'm using windows 10. – Maize Yang Dec 28 '21 at 08:33
-
@EstusFlask Both my local and remote server are windows 10 machines. – Maize Yang Dec 28 '21 at 08:34
-
try this https://stackoverflow.com/a/58651429/8145128 – Emīls Gulbis Dec 28 '21 at 09:12
-
It's unclear what's the intention. If it's a system you're aware of and the language isn't changed constantly, you could just set the desired language in env variable. Any way, check https://stackoverflow.com/questions/53094975/vue-js-defining-computed-environment-variables-in-vue-config-js-vue-cli-3 and https://github.com/sindresorhus/os-locale – Estus Flask Dec 28 '21 at 09:21