Skip to content

Commit

Permalink
Enable getPreferredSystemLanguages on Linux (#172874)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 authored Jan 31, 2023
1 parent 9f6c013 commit 1001c87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if (locale) {
// Pseudo Language Language Pack is being used.
// In that case, use `en` as the Electron locale.

if (process.platform === 'win32') {
if (process.platform === 'win32' || process.platform === 'linux') {
const electronLocale = (!locale || locale === 'qps-ploc') ? 'en' : locale;
app.commandLine.appendSwitch('lang', electronLocale);
}
Expand Down Expand Up @@ -575,7 +575,7 @@ async function resolveNlsConfiguration() {
// VS Code moves to Electron 22.
// Ref https://github.com/microsoft/vscode/issues/159813
// and https://github.com/electron/electron/pull/36035
if (process.platform === 'win32'
if ((process.platform === 'win32' || process.platform === 'linux')
&& 'getPreferredSystemLanguages' in app
&& typeof app.getPreferredSystemLanguages === 'function'
&& app.getPreferredSystemLanguages().length) {
Expand Down

0 comments on commit 1001c87

Please sign in to comment.