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

Test: Platform locale and language variables #171890

Closed
3 tasks done
rzhao271 opened this issue Jan 21, 2023 · 1 comment
Closed
3 tasks done

Test: Platform locale and language variables #171890

rzhao271 opened this issue Jan 21, 2023 · 1 comment

Comments

@rzhao271
Copy link
Contributor

rzhao271 commented Jan 21, 2023

Refs: #169114

Complexity: 3

Authors: @rzhao271, @TylerLeonhardt

Create Issue


On Windows, Electron now receives the application locale so that it can display the window controls overlay component properly.
As a result, the platform.locale variable actually represents the system language, and the platform.language variable represents the application language.
It turns out many parts of VS Code actually want to use the application language when localizing certain strings such as dates. Therefore, many parts of the program have been changed to use platform.language instead of platform.locale. On Windows, the app.getPreferredSystemLanguages() code path was enabled again to help fetch platform.locale for language recommendation.

Steps for Windows and Linux

  1. Switch the system language to French or another language for which we have a language pack available. On Windows, change that language to be the first preferred language instead (which differs from the system language). If more "precise" language options such as "French (Canada)" are available, switch to that instead. Reboot the system if prompted.
  2. Launch Insiders with a fresh user data and extensions dir.
  3. There should be a notification alerting users that they can install and change the application language to the language in step 1.
  4. Accept the notification.
  5. Run the "Preferences: Configure Runtime Arguments" command to open argv.json.
  6. The locale key should have a language code as the value. The language code should be one of the options available in the quickpick when one runs the "Configure Display Language" command. For example, "fr" is a valid locale key, but "fr-ca" should not appear. Another example is that "zh-cn" is a valid locale key, but "zh-hans-cn" should not appear.
  7. Open the extensions viewlet and view some extensions. The extension pages should load without issue. Dates such as the last updated date should be formatted properly, i.e. formatted in a way expected for the given application language.

Additional steps for Windows

  1. Switch the system language and the first preferred language to a right-to-left language like Arabic. Reboot the system.
  2. Launch Insiders.
  3. The close button should still be on the right side of the window, regardless of the current language pack.

Steps for macOS

  1. Run the "Preferences: Configure Runtime Arguments" command to open argv.json.
  2. Set the locale value to "fr" or another language code that shows up when running the "Configure Display Languages" command.
  3. Make sure the French language pack is not installed.
  4. Switch the system language to a language with no official language pack support such as Arabic. Also make sure in the language settings under the Applications tab that VS Code Insiders doesn't have a custom language assigned to it there. Reboot the system.
  5. Open VS Code Insiders again.
  6. VS Code Insiders should be in the language set in step 2.
  7. Open the extensions viewlet and view some extensions. The extension pages should load without issue. Dates such as the last updated date should be formatted properly, i.e. formatted in a way expected for the given application language.
@roblourens
Copy link
Member

I don't know if fully tested it since I don't see the notification, but everything else worked ok. For example it accepted es-mx in argv.json rather than just es

@roblourens roblourens removed their assignment Jan 24, 2023
@luabud luabud closed this as completed Jan 24, 2023
@luabud luabud removed their assignment Jan 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants