Skip to content

Commit

Permalink
#53130 Do not use new chinese locale id everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jul 3, 2018
1 parent 1e25b49 commit 92f232a
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
return;
}

const currentLocale = this.getPossibleChineseMapping(locale);
const ceintlExtensionSearch = this.galleryService.query({ names: [`MS-CEINTL.vscode-language-pack-${currentLocale}`], pageSize: 1 });
const tagSearch = this.galleryService.query({ text: `tag:lp-${currentLocale}`, pageSize: 1 });
const extensionIdPrefix = this.getPossibleChineseMapping(locale);
const ceintlExtensionSearch = this.galleryService.query({ names: [`MS-CEINTL.vscode-language-pack-${extensionIdPrefix}`], pageSize: 1 });
const tagSearch = this.galleryService.query({ text: `tag:lp-${locale}`, pageSize: 1 });

TPromise.join([ceintlExtensionSearch, tagSearch]).then(([ceintlResult, tagResult]) => {
if (ceintlResult.total === 0 && tagResult.total === 0) {
Expand All @@ -157,11 +157,11 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
return;
}

TPromise.join([this.galleryService.getManifest(extensionToFetchTranslationsFrom), this.galleryService.getCoreTranslation(extensionToFetchTranslationsFrom, currentLocale)])
TPromise.join([this.galleryService.getManifest(extensionToFetchTranslationsFrom), this.galleryService.getCoreTranslation(extensionToFetchTranslationsFrom, locale)])
.then(([manifest, translation]) => {
const loc = manifest && manifest.contributes && manifest.contributes.localizations && manifest.contributes.localizations.filter(x => this.getPossibleChineseMapping(x.languageId) === currentLocale)[0];
const languageName = loc ? (loc.languageName || currentLocale) : currentLocale;
const languageDisplayName = loc ? (loc.localizedLanguageName || loc.languageName || currentLocale) : currentLocale;
const loc = manifest && manifest.contributes && manifest.contributes.localizations && manifest.contributes.localizations.filter(x => x.languageId.toLowerCase() === locale)[0];
const languageName = loc ? (loc.languageName || locale) : locale;
const languageDisplayName = loc ? (loc.localizedLanguageName || loc.languageName || locale) : locale;
const translationsFromPack = translation && translation.contents ? translation.contents['vs/platform/node/minimalTranslations'] : {};
const promptMessageKey = extensionToInstall ? 'installAndRestartMessage' : 'showLanguagePackExtensions';
const useEnglish = !translationsFromPack[promptMessageKey];
Expand Down Expand Up @@ -192,7 +192,7 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
this.viewletService.openViewlet(EXTENSIONS_VIEWLET_ID, true)
.then(viewlet => viewlet as IExtensionsViewlet)
.then(viewlet => {
viewlet.search(`tag:lp-${currentLocale}`);
viewlet.search(`tag:lp-${locale}`);
viewlet.focus();
});
}
Expand Down

0 comments on commit 92f232a

Please sign in to comment.