mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1046142 - Empty language to translate to drop down on localized builds, r=gavin.
--HG-- extra : rebase_source : 0d2c4d772a672a4b2f7db28ea5cf0905d58b03b1
This commit is contained in:
parent
ceb2d8521a
commit
5d90edf24b
@ -32,8 +32,8 @@ this.Translation = {
|
||||
|
||||
serviceUnavailable: false,
|
||||
|
||||
supportedSourceLanguages: ["zh", "de", "en", "fr", "ja", "ko", "pt", "ru", "es"],
|
||||
supportedTargetLanguages: ["zh", "de", "en", "fr", "ja", "ko", "pt", "ru", "es"],
|
||||
supportedSourceLanguages: ["de", "en", "es", "fr", "ja", "ko", "pt", "ru", "zh"],
|
||||
supportedTargetLanguages: ["de", "en", "es", "fr", "ja", "ko", "pl", "pt", "ru", "tr", "vi", "zh"],
|
||||
|
||||
_defaultTargetLanguage: "",
|
||||
get defaultTargetLanguage() {
|
||||
|
@ -166,12 +166,17 @@
|
||||
let bundle = Cc["@mozilla.org/intl/stringbundle;1"]
|
||||
.getService(Ci.nsIStringBundleService)
|
||||
.createBundle("chrome://global/locale/languageNames.properties");
|
||||
let sortByLocalizedName = function(aList) {
|
||||
return aList.map(code => [code, bundle.GetStringFromName(code)])
|
||||
.sort((a, b) => a[1].localeCompare(b[1]));
|
||||
};
|
||||
|
||||
// Fill the lists of supported source languages.
|
||||
let detectedLanguage = this._getAnonElt("detectedLanguage");
|
||||
let fromLanguage = this._getAnonElt("fromLanguage");
|
||||
for (let code of Translation.supportedSourceLanguages) {
|
||||
let name = bundle.GetStringFromName(code);
|
||||
let sourceLanguages =
|
||||
sortByLocalizedName(Translation.supportedSourceLanguages);
|
||||
for (let [code, name] of sourceLanguages) {
|
||||
detectedLanguage.appendItem(name, code);
|
||||
fromLanguage.appendItem(name, code);
|
||||
}
|
||||
@ -183,8 +188,10 @@
|
||||
|
||||
// Fill the list of supported target languages.
|
||||
let toLanguage = this._getAnonElt("toLanguage");
|
||||
for (let code of Translation.supportedTargetLanguages)
|
||||
toLanguage.appendItem(bundle.GetStringFromName(code), code);
|
||||
let targetLanguages =
|
||||
sortByLocalizedName(Translation.supportedTargetLanguages);
|
||||
for (let [code, name] of targetLanguages)
|
||||
toLanguage.appendItem(name, code);
|
||||
|
||||
if (aTranslation.translatedTo)
|
||||
toLanguage.value = aTranslation.translatedTo;
|
||||
|
Loading…
Reference in New Issue
Block a user