Skip to content

Commit fa8cd95

Browse files
authored
Fixing current language in configure language dropdown (#73)
1 parent a45e3d5 commit fa8cd95

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

patches/web-server/display-language.diff

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,32 @@ Index: third-party-src/src/vs/workbench/workbench.web.main.internal.ts
388388
import './services/path/browser/pathService.js';
389389
import './services/themes/browser/browserHostColorSchemeService.js';
390390
import './services/encryption/browser/encryptionService.js';
391+
Index: third-party-src/src/vs/workbench/contrib/localization/common/localizationsActions.ts
392+
===================================================================
393+
--- third-party-src.orig/src/vs/workbench/contrib/localization/common/localizationsActions.ts
394+
+++ third-party-src/src/vs/workbench/contrib/localization/common/localizationsActions.ts
395+
@@ -12,6 +12,7 @@ import { ServicesAccessor } from '../../
396+
import { ILanguagePackItem, ILanguagePackService } from '../../../../platform/languagePacks/common/languagePacks.js';
397+
import { ILocaleService } from '../../../services/localization/common/locale.js';
398+
import { IExtensionsWorkbenchService } from '../../extensions/common/extensions.js';
399+
+import { language } from '../../../../base/common/platform.js';
400+
401+
export class ConfigureDisplayLanguageAction extends Action2 {
402+
public static readonly ID = 'workbench.action.configureLocale';
403+
@@ -37,6 +38,16 @@ export class ConfigureDisplayLanguageAct
404+
405+
const installedLanguages = await languagePackService.getInstalledLanguages();
406+
407+
+ // Clean any existing (Current) text and add it back only to the correct locale
408+
+ installedLanguages?.forEach(lang => {
409+
+ if (lang.description) {
410+
+ lang.description = lang.description.replace(/ \(Current\)$/, '');
411+
+ }
412+
+ if (lang.id?.toLowerCase() === language.toLowerCase()) {
413+
+ lang.description = (lang.description || '') + localize('currentDisplayLanguage', " (Current)");
414+
+ }
415+
+ });
416+
+
417+
const disposables = new DisposableStore();
418+
const qp = disposables.add(quickInputService.createQuickPick<ILanguagePackItem>({ useSeparators: true }));
419+
qp.matchOnDescription = true;

0 commit comments

Comments
 (0)