1
0
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:
Hiroyasu Nishiyama 2018-05-30 21:59:20 +09:00
commit 2a95af3928

View File

@ -81,7 +81,7 @@ var MessageFileLoader = {
}
function current_locale() {
function getCurrentLocale() {
var env = process.env;
for (var name of ['LC_ALL', 'LC_MESSAGES', 'LANG']) {
if (name in env) {
@ -102,7 +102,7 @@ function init() {
},
fallbackLng: [defaultLang]
};
var lang = current_locale();
var lang = getCurrentLocale();
if (lang) {
opt.lng = lang;
}