Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nls.metadata.json for vscode API 1.70.2 #12205

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions packages/core/src/browser/common-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1152,9 +1152,11 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
}

protected async configureDisplayLanguage(): Promise<void> {
const languageId = await this.languageQuickPickService.pickDisplayLanguage();
if (languageId && !nls.isSelectedLocale(languageId) && await this.confirmRestart()) {
nls.setLocale(languageId);
const languageInfo = await this.languageQuickPickService.pickDisplayLanguage();
if (languageInfo && !nls.isSelectedLocale(languageInfo.languageId) && await this.confirmRestart(
languageInfo.localizedLanguageName ?? languageInfo.languageName ?? languageInfo.languageId
)) {
nls.setLocale(languageInfo.languageId);
this.windowService.setSafeToShutDown();
this.windowService.reload();
}
Expand All @@ -1169,10 +1171,11 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
return !!this.preferenceService.get('breadcrumbs.enabled');
}

protected async confirmRestart(): Promise<boolean> {
protected async confirmRestart(languageName: string): Promise<boolean> {
const appName = FrontendApplicationConfigProvider.get().applicationName;
const shouldRestart = await new ConfirmDialog({
title: nls.localizeByDefault('A restart is required for the change in display language to take effect.'),
msg: nls.localizeByDefault('Press the restart button to restart {0} and change the display language.', FrontendApplicationConfigProvider.get().applicationName),
title: nls.localizeByDefault('Press the restart button to restart {0} and set the display language to {1}.', appName, languageName),
msg: nls.localizeByDefault('To change the display language, {0} needs to restart', appName),
ok: nls.localizeByDefault('Restart'),
cancel: Dialog.CANCEL,
}).open();
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/browser/core-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const corePreferenceSchema: PreferenceSchema = {
nls.localizeByDefault('Menu is displayed at the top of the window and only hidden in full screen mode.'),
nls.localizeByDefault('Menu is always visible at the top of the window even in full screen mode.'),
nls.localizeByDefault('Menu is always hidden.'),
nls.localizeByDefault('Menu is displayed as a compact button in the side bar. This value is ignored when `#window.titleBarStyle#` is `native`.')
nls.localizeByDefault('Menu is displayed as a compact button in the side bar. This value is ignored when {0} is {1}.', '`#window.titleBarStyle#`', '`native`')
],
default: 'classic',
scope: 'application',
Expand All @@ -106,7 +106,7 @@ export const corePreferenceSchema: PreferenceSchema = {
type: 'string',
default: ' - ',
scope: 'application',
markdownDescription: nls.localizeByDefault('Separator used by `window.title`.')
markdownDescription: nls.localizeByDefault('Separator used by {0}.', '`#window.title#`')
},
'http.proxy': {
type: 'string',
Expand Down
15 changes: 8 additions & 7 deletions packages/core/src/browser/i18n/language-quick-pick-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import { AsyncLocalizationProvider, LanguageInfo } from '../../common/i18n/local
import { QuickInputService, QuickPickItem, QuickPickSeparator } from '../quick-input';
import { WindowService } from '../window/window-service';

export interface LanguageQuickPickItem extends QuickPickItem {
languageId: string
export interface LanguageQuickPickItem extends QuickPickItem, LanguageInfo {
execute?(): Promise<void>
}

Expand All @@ -32,13 +31,13 @@ export class LanguageQuickPickService {
@inject(AsyncLocalizationProvider) protected readonly localizationProvider: AsyncLocalizationProvider;
@inject(WindowService) protected readonly windowService: WindowService;

async pickDisplayLanguage(): Promise<string | undefined> {
async pickDisplayLanguage(): Promise<LanguageInfo | undefined> {
const quickInput = this.quickInputService.createQuickPick<LanguageQuickPickItem>();
const installedItems = await this.getInstalledLanguages();
const quickInputItems: (LanguageQuickPickItem | QuickPickSeparator)[] = [
{
type: 'separator',
label: nls.localizeByDefault('Installed languages')
label: nls.localizeByDefault('Installed')
},
...installedItems
];
Expand All @@ -55,7 +54,7 @@ export class LanguageQuickPickService {
if (availableItems.length > 0) {
quickInputItems.push({
type: 'separator',
label: nls.localizeByDefault('Available languages')
label: nls.localizeByDefault('Available')
});
const installed = new Set(installedItems.map(e => e.languageId));
for (const available of availableItems) {
Expand All @@ -77,7 +76,7 @@ export class LanguageQuickPickService {
// Some language quick pick items want to install additional languages
// We have to await that before returning the selected locale
await selectedItem.execute?.();
resolve(selectedItem.languageId);
resolve(selectedItem);
} else {
resolve(undefined);
}
Expand Down Expand Up @@ -122,7 +121,9 @@ export class LanguageQuickPickService {
return {
label,
description,
languageId: id
languageId: id,
languageName: language.languageName,
localizedLanguageName: language.localizedLanguageName
};
}
}
2 changes: 1 addition & 1 deletion packages/core/src/browser/tree/search-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export class SearchBox extends BaseWidget {
SearchBox.Styles.BUTTON,
...SearchBox.Styles.FILTER,
);
filter.title = nls.localizeByDefault('Enable Filter on Type');
filter.title = nls.localizeByDefault('Filter on Type');
buttons.appendChild(filter);
filter.onclick = this.fireFilterToggle.bind(this);
}
Expand Down
Loading