mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2175 from node-red-hitachi/update-language-selector
update editor language selection UI for i18n
This commit is contained in:
commit
3b3a2d62f8
@ -930,5 +930,12 @@
|
||||
"description": "Description",
|
||||
"appearance": "Appearance",
|
||||
"env": "Environment Variables"
|
||||
},
|
||||
"languages" : {
|
||||
"de": "German",
|
||||
"en-US": "English",
|
||||
"ja": "Japanese",
|
||||
"ko": "Korean",
|
||||
"zh-CN": "Chinese(Simplified)"
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,9 @@
|
||||
"defaultDir": "標準",
|
||||
"ltr": "左から右",
|
||||
"rtl": "右から左",
|
||||
"auto": "文脈"
|
||||
"auto": "文脈",
|
||||
"language": "表示言語",
|
||||
"browserDefault": "ブラウザのデフォルト"
|
||||
},
|
||||
"sidebar": {
|
||||
"show": "サイドバーを表示"
|
||||
@ -927,5 +929,12 @@
|
||||
"description": "説明",
|
||||
"appearance": "外観",
|
||||
"env": "環境変数"
|
||||
},
|
||||
"languages" : {
|
||||
"de": "ドイツ語",
|
||||
"en-US": "英語",
|
||||
"ja": "日本語",
|
||||
"ko": "韓国語",
|
||||
"zh-CN": "中国語(簡体)"
|
||||
}
|
||||
}
|
||||
|
@ -101,10 +101,19 @@ RED.userSettings = (function() {
|
||||
RED.tray.show(trayOptions);
|
||||
}
|
||||
|
||||
function localeToName(lc) {
|
||||
var name = RED._("languages."+lc);
|
||||
return {text: (name ? name : lc), val: lc};
|
||||
}
|
||||
|
||||
function compText(a, b) {
|
||||
return a.text.localeCompare(b.text);
|
||||
}
|
||||
|
||||
var viewSettings = [
|
||||
{
|
||||
options: [
|
||||
{setting:"editor-language",local: true, label:"menu.label.view.language",options:function(done){ done([{val:'',text:RED._('menu.label.view.browserDefault')}].concat(RED.settings.theme("languages"))) }},
|
||||
{setting:"editor-language",local: true, label:"menu.label.view.language",options:function(done){ done([{val:'',text:RED._('menu.label.view.browserDefault')}].concat(RED.settings.theme("languages").map(localeToName).sort(compText))) }},
|
||||
]
|
||||
},{
|
||||
title: "menu.label.view.grid",
|
||||
|
Loading…
Reference in New Issue
Block a user