Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 649cd60

Browse files
committed
Merge pull request #3704 from tammo/locale-description-675
Locale descriptions in switching language modal.
2 parents 934a1c2 + 5fa0331 commit 649cd60

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

src/extensions/default/DebugCommands/main.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,22 @@ define(function (require, exports, module) {
226226
.val(val)
227227
.appendTo($select);
228228
}
229+
230+
// returns the localized label for the given locale
231+
// or the locale, if nothing found
232+
function getLocalizedLabel(locale) {
233+
234+
var key = "LOCALE_" + locale.toUpperCase().replace("-", "_"),
235+
i18n = Strings[key];
236+
237+
return i18n === undefined ? locale : i18n;
238+
}
229239

230240
// add system default
231241
addLocale(Strings.LANGUAGE_SYSTEM_DEFAULT, null);
232242

233243
// add english
234-
addLocale("en", "en");
244+
addLocale(getLocalizedLabel("en"), "en");
235245

236246
// inspect all children of dirEntry
237247
entries.forEach(function (entry) {
@@ -246,7 +256,7 @@ define(function (require, exports, module) {
246256
label += match[2].toUpperCase();
247257
}
248258

249-
addLocale(label, language);
259+
addLocale(getLocalizedLabel(label), language);
250260
}
251261
}
252262
});

src/nls/de/strings.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/*global define */
2626

2727
define({
28+
2829
/**
2930
* Errors
3031
*/
@@ -135,6 +136,25 @@ define({
135136
"LANGUAGE_SUBMIT" : "{APP_NAME} neu starten",
136137
"LANGUAGE_CANCEL" : "Abbrechen",
137138
"LANGUAGE_SYSTEM_DEFAULT" : "Systemstandard",
139+
140+
/**
141+
* Locales
142+
*/
143+
"LOCALE_DE" : "Deutsch",
144+
"LOCALE_EN" : "Englisch",
145+
"LOCALE_FR" : "Französisch",
146+
"LOCALE_CS" : "Tschechisch",
147+
"LOCALE_ES" : "Spanisch",
148+
"LOCALE_IT" : "Italienisch",
149+
"LOCALE_JA" : "Japanisch",
150+
"LOCALE_NB" : "Norwegisch",
151+
"LOCALE_PL" : "Polnisch",
152+
"LOCALE_PT_BR" : "Portugiesisch, Brasilien",
153+
"LOCALE_PT_PT" : "Portugiesisch",
154+
"LOCALE_RU" : "Russisch",
155+
"LOCALE_SV" : "Schwedisch",
156+
"LOCALE_TR" : "Türkisch",
157+
"LOCALE_ZH_CN" : "Chinesisch, vereinfacht",
138158

139159
/**
140160
* ProjectManager

src/nls/root/strings.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/*global define */
2626

2727
define({
28+
2829
/**
2930
* Errors
3031
*/
@@ -136,6 +137,25 @@ define({
136137
"LANGUAGE_SUBMIT" : "Reload {APP_NAME}",
137138
"LANGUAGE_CANCEL" : "Cancel",
138139
"LANGUAGE_SYSTEM_DEFAULT" : "System Default",
140+
141+
/**
142+
* Locales
143+
*/
144+
"LOCALE_CS" : "Czech",
145+
"LOCALE_DE" : "German",
146+
"LOCALE_EN" : "English",
147+
"LOCALE_ES" : "Spanish",
148+
"LOCALE_FR" : "French",
149+
"LOCALE_IT" : "Italian",
150+
"LOCALE_JA" : "Japanese",
151+
"LOCALE_NB" : "Norwegian",
152+
"LOCALE_PL" : "Polish",
153+
"LOCALE_PT_BR" : "Portuguese, Brazil",
154+
"LOCALE_PT_PT" : "Portuguese",
155+
"LOCALE_RU" : "Russian",
156+
"LOCALE_SV" : "Swedish",
157+
"LOCALE_TR" : "Turkish",
158+
"LOCALE_ZH_CN" : "Chinese, simplified",
139159

140160
/**
141161
* ProjectManager

0 commit comments

Comments
 (0)