From 25985ec81b5cf4552fb108594084f2e894387f4d Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Mon, 21 Nov 2022 15:51:03 +0100 Subject: [PATCH] fix(insider): test before using getPreferredSystemLanguages closes #1335 --- patches/insider/system-languages.patch | 18 ++++++++++++++++++ product.json | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 patches/insider/system-languages.patch diff --git a/patches/insider/system-languages.patch b/patches/insider/system-languages.patch new file mode 100644 index 0000000..d873479 --- /dev/null +++ b/patches/insider/system-languages.patch @@ -0,0 +1,18 @@ +diff --git a/src/main.js b/src/main.js +index 63f8c56..a6b7d44 100644 +--- a/src/main.js ++++ b/src/main.js +@@ -575,6 +575,10 @@ async function resolveNlsConfiguration() { + */ +- // @ts-ignore API not yet available in the official Electron +- let appLocale = ((product.quality === 'insider' || product.quality === 'exploration') && app?.getPreferredSystemLanguages()?.length) ? ++ let appLocale = app.getLocale(); ++ if (product.quality === 'insider' || product.quality === 'exploration') { + // @ts-ignore API not yet available in the official Electron +- app.getPreferredSystemLanguages()[0] : app.getLocale(); ++ if (app.getPreferredSystemLanguages && app?.getPreferredSystemLanguages()?.length) { ++ // @ts-ignore API not yet available in the official Electron ++ appLocale = app.getPreferredSystemLanguages()[0]; ++ } ++ } + if (!appLocale) { diff --git a/product.json b/product.json index f7b750b..31c60c1 100644 --- a/product.json +++ b/product.json @@ -157,11 +157,13 @@ "documentFiltersExclusive" ], "GitHub.vscode-pull-request-github": [ + "contribCommentThreadAdditionalMenu", "tokenInformation", "commentsResolvedState", "contribShareMenu", "contribCommentPeekContext", - "treeItemCheckbox" + "treeItemCheckbox", + "codiconDecoration" ], "GitHub.copilot": [ "inlineCompletionsAdditions"