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

Pass display language as a locale to Electron #159958

Merged
merged 10 commits into from
Nov 14, 2022
Prev Previous commit
Next Next commit
Add clarification comments
  • Loading branch information
rzhao271 committed Nov 7, 2022
commit 3a7b71b4d814c25aca06ca1f87f5435cc2e2ca1a
11 changes: 7 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ function configureCommandlineSwitchesSync(cliArgs) {
// Locale
else if (argvKey === 'locale') {
if (product.quality === 'insider' || product.quality === 'exploration') {
// Pass in the locale to Electron so that the Windows Control Overlay
// is rendered correctly.
// Pass in the locale to Electron so that the
// Windows Control Overlay is rendered correctly.
// If the locale is `qps-ploc`, the Microsoft
// Pseudo Language Language Pack is being used.
// In that case, use `en` as the Electron locale.
// The if statement can be removed when Electron officially
// adopts the getSystemLocale API.
// Ref https://github.com/microsoft/vscode/issues/159813
Expand Down Expand Up @@ -586,8 +589,8 @@ async function resolveNlsConfiguration() {
appLocale = appLocale.toLowerCase();

if (!appLocale.startsWith('pt') && !appLocale.startsWith('zh')) {
// Trim off the country code to help with the recommender.
// If - isn't in the string, the following code leaves appLocale unchanged.
// Trim off the country code to help with the language pack recommender.
// If '-' isn't in the string, the following code leaves appLocale unchanged.
appLocale = appLocale.split('-')[0];
}

Expand Down