Agent translation fixes.

This commit is contained in:
Ylian Saint-Hilaire 2020-12-15 13:38:18 -08:00
parent a19bf5146a
commit fc432430f6
2 changed files with 4 additions and 84 deletions

View File

@ -177,87 +177,5 @@
"connect": "連接", "connect": "連接",
"disconnect": "斷線", "disconnect": "斷線",
"cancel": "取消" "cancel": "取消"
},
"xloc": {
"agent": [
"agent-translations.json"
],
"agentVersion": [
"agent-translations.json"
],
"group": [
"agent-translations.json"
],
"url": [
"agent-translations.json"
],
"meshName": [
"agent-translations.json"
],
"meshId": [
"agent-translations.json"
],
"serverId": [
"agent-translations.json"
],
"setup": [
"agent-translations.json"
],
"update": [
"agent-translations.json"
],
"install": [
"agent-translations.json"
],
"uninstall": [
"agent-translations.json"
],
"connect": [
"agent-translations.json"
],
"disconnect": [
"agent-translations.json"
],
"cancel": [
"agent-translations.json"
],
"pressok": [
"agent-translations.json"
],
"elevation": [
"agent-translations.json"
],
"sudo": [
"agent-translations.json"
],
"ctrlc": [
"agent-translations.json"
],
"commands": [
"agent-translations.json"
],
"graphicalerror": [
"agent-translations.json"
],
"zenity": [
"agent-translations.json"
],
"status": [
[
"agent-translations.json"
],
[
"agent-translations.json"
],
[
"agent-translations.json"
]
],
"statusDescription": [
"agent-translations.json"
],
"description": [
"agent-translations.json"
]
} }
} }

View File

@ -668,7 +668,9 @@ function extractFromJson(file) {
const str = json.en[i] const str = json.en[i]
if (sourceStrings[str] == null) { if (sourceStrings[str] == null) {
sourceStrings[str] = { en: str, xloc: [name] }; sourceStrings[str] = { en: str, xloc: [name] };
} else { if (sourceStrings[str].xloc == null) { sourceStrings[str].xloc = []; } sourceStrings[str].xloc.push(name); } } else {
if (sourceStrings[str].xloc == null) { sourceStrings[str].xloc = []; } sourceStrings[str].xloc.push(name);
}
} else if (Array.isArray(json.en[i])) { } else if (Array.isArray(json.en[i])) {
for (var k in json.en[i]) { for (var k in json.en[i]) {
if (typeof json.en[i][k] == 'string') { if (typeof json.en[i][k] == 'string') {
@ -794,7 +796,7 @@ function translateAllInJson(xlang, langFile, file) {
for (var i in langFileData.strings) { for (var i in langFileData.strings) {
var entry = langFileData.strings[i]; var entry = langFileData.strings[i];
for (var lang in entry) { for (var lang in entry) {
if (lang == 'en') continue; if ((lang == 'en') || (lang == 'xloc')) continue;
if ((xlang != null) && (lang != xlang)) continue; if ((xlang != null) && (lang != xlang)) continue;
if (languages.indexOf(lang) == -1) { languages.push(lang); xtranslationTable[lang] = {}; } if (languages.indexOf(lang) == -1) { languages.push(lang); xtranslationTable[lang] = {}; }
if ((entry['en'] != null) && (entry[lang] != null)) { xtranslationTable[lang][entry['en']] = entry[lang]; } if ((entry['en'] != null) && (entry[lang] != null)) { xtranslationTable[lang][entry['en']] = entry[lang]; }