-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set locale variables automatically for the integrated terminal #7301
Comments
If anyone has insight on how locale works on Mac it would be appreciated, PRs welcome. |
VSCode Version: 1.4.0 Insiders (commit 217e0b5 Shell: /bin/bash, Kazuyuki-no-MacBook-Pro:~ satokaz$ locale
LANG="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_CTYPE="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_ALL= Please tell me the behavior of expected "terminal.integrated.setLocaleVariables" setting. In the Japanese locale, it will be set as follows. bash-3.2$ locale
LANG="ja.UTF-8"
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL= "Ja.UTF-8" is not correct. "terminal.integrated.setLocaleVariables": true"terminal.integrated.setLocaleVariables": falseThis is the value you expected Looks. It looks like when the |
Ping @chrmarti, sometimes vscode's locale is only the language, not dialect eg. "ja". This is likely why it's set to ja, not ja_JP. As for why it's working on this version of OS X, I have no idea? |
We use electron's app.getLocale() to read the locale, which limits it's values to those electron has translations for, that includes 'ja', but not 'ja_JP': http://electron.atom.io/docs/api/app-locales/ We could use some other means to get at the full locale identifier (like https://www.npmjs.com/package/os-locale). |
@dbaeumer, would it make sense to make platform.locale be the full OS's locale rather than just what electron supports? Having that will make sense for other (than shells) external processes that support more locales than electron too. (The change would be in main.js I think.) |
Thank you for the details. It is considered to be difficult to derive the OS loclae from Electron's app.getLocale(). It is desirable to be automatic in the locale setting, but this implementation is thought that only lead to confusion. Currently, That prompt the user to set the Microsoft/vscode project is great. Thanks, |
This should be fixed in 1.10 |
@chrmarti I decided against this since the npm modules I looked at when implementing this all spawn processes and this is on the critical start up path and we can't load any code without knowing which locale to use. IMO if someone really needs the real OS locale then they can use a corresponding npm module. |
Steps to Reproduce:
locale
.Expected:
An optional similar to the default Terminal app in OSX. It makes sense to have it ON by default.
Option from Terminal settings:
Workaround:
Add the following to your profile (
~/.zhrc
for ZSH):The text was updated successfully, but these errors were encountered: