Skip to content

Commit

Permalink
Fix API name
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhao271 committed Nov 7, 2022
1 parent 1736d22 commit da06988
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,16 +570,16 @@ async function resolveNlsConfiguration() {
// code is here.

// The ternary and ts-ignore can both be removed once Electron
// officially adopts the getSystemPreferredLanguages API.
// officially adopts the getPreferredSystemLanguages API.
// Ref https://github.com/microsoft/vscode/issues/159813
// and https://github.com/electron/electron/pull/36035
/**
* @type string
*/
// @ts-ignore API not yet available in the official Electron
let appLocale = ((product.quality === 'insider' || product.quality === 'exploration') && app?.getSystemPreferredLanguages()?.length) ?
let appLocale = ((product.quality === 'insider' || product.quality === 'exploration') && app?.getPreferredSystemLanguages()?.length) ?
// @ts-ignore API not yet available in the official Electron
app.getSystemPreferredLanguages()[0] : app.getLocale();
app.getPreferredSystemLanguages()[0] : app.getLocale();
if (!appLocale) {
nlsConfiguration = { locale: 'en', availableLanguages: {} };
} else {
Expand Down

0 comments on commit da06988

Please sign in to comment.