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

Enable getPreferredSystemLanguages on Linux #172874

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Conversation

rzhao271
Copy link
Contributor

Ref #169114

This PR passes the locale to Electron on Linux, and then uses the new app.getPreferredSystemLanguages() API to fetch the correct system language to use for the language recommender.

I first tested the API in Electron Fiddle on Ubuntu 22.04, and noticed the API returns values such as en-US or zh-HK. Since the value C is filtered out, it is possible for the returned array to be empty, but there is already a check for that in main.js. A potential issue is that VS Code has language packs for the zh-CN and zh-TW locales specifically, and not for other zh locales. Therefore, more code might be needed to handle other zh locales.

I have tested this change on Ubuntu 22.04 with a custom Insiders and noticed that when the preferred language is Arabic, the window controls are on the left side. However, the window controls are still on the left side even in Stable. I also confirmed the controls are also on the left side for other programs such as Firefox.

I also set the preferred language to French (France) and confirmed that the language recommender works.

@rzhao271 rzhao271 added this to the February 2023 milestone Jan 31, 2023
@rzhao271 rzhao271 self-assigned this Jan 31, 2023
Copy link
Collaborator

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have WCO on linux, so the behavior should be unaffected by this change.

@rzhao271 rzhao271 merged commit 1001c87 into main Jan 31, 2023
@rzhao271 rzhao271 deleted the rzhao271/locale-linux-exp branch January 31, 2023 18:18
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants