Enable getPreferredSystemLanguages on Linux #172874
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
orzh-HK
. Since the valueC
is filtered out, it is possible for the returned array to be empty, but there is already a check for that inmain.js
. A potential issue is that VS Code has language packs for thezh-CN
andzh-TW
locales specifically, and not for otherzh
locales. Therefore, more code might be needed to handle otherzh
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.