mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
merged 0.19-allow-i18n-translation-in-runtime
This commit is contained in:
commit
2a95af3928
@ -81,7 +81,7 @@ var MessageFileLoader = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function current_locale() {
|
function getCurrentLocale() {
|
||||||
var env = process.env;
|
var env = process.env;
|
||||||
for (var name of ['LC_ALL', 'LC_MESSAGES', 'LANG']) {
|
for (var name of ['LC_ALL', 'LC_MESSAGES', 'LANG']) {
|
||||||
if (name in env) {
|
if (name in env) {
|
||||||
@ -102,7 +102,7 @@ function init() {
|
|||||||
},
|
},
|
||||||
fallbackLng: [defaultLang]
|
fallbackLng: [defaultLang]
|
||||||
};
|
};
|
||||||
var lang = current_locale();
|
var lang = getCurrentLocale();
|
||||||
if (lang) {
|
if (lang) {
|
||||||
opt.lng = lang;
|
opt.lng = lang;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user