зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1449505 - Migrate translation-infobar to use mozIntl.getLocaleDisplayNames. r=jfkthame
MozReview-Commit-ID: I3aK212eJtE --HG-- extra : rebase_source : f63cd206f4f5cd7005f9270a1de25a83d79197c4
This commit is contained in:
Родитель
b5a3eb8225
Коммит
958538de36
|
@ -182,9 +182,10 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
this.translation = aTranslation;
|
||||
let bundle = Services.strings.createBundle("chrome://global/locale/languageNames.properties");
|
||||
|
||||
let sortByLocalizedName = function(aList) {
|
||||
return aList.map(code => [code, bundle.GetStringFromName(code)])
|
||||
let names = Services.intl.getLanguageDisplayNames(undefined, aList);
|
||||
return aList.map((code, i) => [code, names[i]])
|
||||
.sort((a, b) => a[1].localeCompare(b[1]));
|
||||
};
|
||||
|
||||
|
@ -355,9 +356,7 @@
|
|||
lang = this.translation.detectedLanguage;
|
||||
}
|
||||
|
||||
let langBundle =
|
||||
Services.strings.createBundle("chrome://global/locale/languageNames.properties");
|
||||
let langName = langBundle.GetStringFromName(lang);
|
||||
let langName = Services.intl.getLanguageDisplayNames(undefined, [lang])[0];
|
||||
|
||||
// Set the label and accesskey on the menuitem.
|
||||
let bundle =
|
||||
|
|
Загрузка…
Ссылка в новой задаче