Skip to content
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

Code will not start with locale='zh-cn' or locale='zh-tw' #4520

Closed
chrisdias opened this issue Mar 21, 2016 · 10 comments
Closed

Code will not start with locale='zh-cn' or locale='zh-tw' #4520

chrisdias opened this issue Mar 21, 2016 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@chrisdias
Copy link
Member

  • VSCode Version: Insiders, ef2a1fc
  • OS Version: OSX

Steps to Reproduce:

  1. Edit locale.json
{
    "locale":"zh-cn"
}
  1. Restart VS Code

Result: It does not start, I just have a "Code - Insiders" menu with a Quit action.

You have to manually edit locale.json to get the tool to start again

@chrisdias chrisdias added the bug Issue identified by VS Code Team member as probable bug label Mar 21, 2016
@chrisdias chrisdias added this to the March 2016 milestone Mar 21, 2016
@dbaeumer dbaeumer added the important Issue identified as high-priority label Mar 21, 2016
@dbaeumer
Copy link
Member

The problem here is that the FS for Mac is case insensitive however the amd loader we use is case sensitive. I need to see if I can find the correct casing of the file and then use that one as the locale independent of the case on the command line or locale.json file.

We need to keep this case sensitive in terms of strings since the Linux file system is case sensitive.

@dbaeumer
Copy link
Member

See #4206 for the casing details.

@dbaeumer
Copy link
Member

The quick 'hack' fix for this is to uppercase the region (in this case cn) since we know the languages we ship. However in the mid/long term this might not work for other language since 'locale' identifiers can be more complex. (for example: zh-Hant-TW and de-CH-1901 is valid as well.). I didn't find any node API to get the casing of a file on disk. All we can do is to read the parent directory and compare. This shouldn't be too expensive since we read a directory with 18 items.

@dbaeumer
Copy link
Member

Reproduce on Windows as well since Windows FS is case insensitive as well. If we fix this we need to retest #4206 on Linux.

@chrisdias
Copy link
Member Author

For March, can we get comments and/or IntelliSense in the launch.json so that people don't accidentally get into this bad state?

@dbaeumer
Copy link
Member

Yes but might be more work/code changes then fixing it. And we do have the --locale command line switch which is affected as well. I will see how open the team is and prepare different fixes so that we can discuss it in the team.

@dbaeumer
Copy link
Member

Fixing wise I came up with the following: locale tags are case insensitive. So we will always generate message bundles with lower case locale tags and will convert the locale specified by the user to lower case as well. This makes it work on all platforms even with a case sensitive loader.

@dbaeumer
Copy link
Member

@chrisdias please verify. Code complete or documentation for valid locale values should be handled in a different issue. I wanted to keep the code changes to fix this to a minimum.

@bpasero bpasero added the candidate Issue identified as probable candidate for fixing in the next release label Mar 22, 2016
@chrisdias chrisdias added the verified Verification succeeded label Mar 23, 2016
@chrisdias
Copy link
Member Author

looks good, modulo #4589

@xgqfrms-GitHub
Copy link

xgqfrms-GitHub commented Jan 18, 2017

it should be look like this!

"locale":"zh-CN"

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants