Fixed Dutch translations in translate.js

This commit is contained in:
Ylian Saint-Hilaire
2019-12-26 11:37:49 -08:00
parent 9bebc913d9
commit b202d3ef08
4 changed files with 21 additions and 44 deletions

View File

@@ -72,7 +72,7 @@ function start() {
console.log(' TRANSLATE [language] [languagefile] [files]');
console.log(' Use a language (.json) file to translate web pages to a give language.');
console.log('');
console.log(' TRANSLATEALL (languagefile)');
console.log(' TRANSLATEALL (languagefile) (language code)');
console.log(' Translate all MeshCentral strings using the languages.json file.');
console.log('');
console.log(' MINIFYALL');
@@ -152,19 +152,21 @@ function start() {
// Extract or translate all MeshCentral strings
if (command == 'extractall') { extract("translate.json", meshCentralSourceFiles); }
if (command == 'translateall') {
if (fs.existsSync("../views/translations") == false) { fs.mkdirSync("../views/translations"); }
if (fs.existsSync("../public/translations") == false) { fs.mkdirSync("../public/translations"); }
if ((process.argv.length > 3)) {
if (fs.existsSync('../views/translations') == false) { fs.mkdirSync('../views/translations'); }
if (fs.existsSync('../public/translations') == false) { fs.mkdirSync('../public/translations'); }
var lang = null;
if (process.argv.length > 4) { lang = process.argv[4].toLowerCase(); }
if (process.argv.length > 3) {
if (fs.existsSync(process.argv[3]) == false) {
console.log('Unable to find: ' + process.argv[3]);
} else {
translate(null, process.argv[3], meshCentralSourceFiles, "translations");
translate(lang, process.argv[3], meshCentralSourceFiles, 'translations');
}
} else {
if (fs.existsSync("translate.json") == false) {
if (fs.existsSync('translate.json') == false) {
console.log('Unable to find translate.json.');
} else {
translate(null, "translate.json", meshCentralSourceFiles, "translations");
translate(lang, 'translate.json', meshCentralSourceFiles, 'translations');
}
}
return;
@@ -346,7 +348,7 @@ function translate(lang, langFile, sources, createSubDir) {
} else {
// See that languages are in the translation file
langs = {};
for (var i in langFileData.strings) { var entry = langFileData.strings[i]; for (var j in entry) { if ((j != 'en') && (j != 'xloc') && (j != '*')) { langs[j] = true; } } }
for (var i in langFileData.strings) { var entry = langFileData.strings[i]; for (var j in entry) { if ((j != 'en') && (j != 'xloc') && (j != '*')) { langs[j.toLowerCase()] = true; } } }
for (var i in langs) { translateEx(i, langFileData, sources, createSubDir); }
}

View File

@@ -8,7 +8,8 @@
"nl": "0",
"xloc": [
"default.handlebars->container->masthead->7->notificationCount",
"default-mobile.handlebars->9->229"
"default-mobile.handlebars->9->229",
{ "$ref": "#" }
]
},
{
@@ -15638,7 +15639,7 @@
]
},
{
"en": "Toggle footer bar",
"en": "Toggle footer bar",
"xloc": [
"default.handlebars->container->topbar->1->1->uiMenuButton->uiMenu"
]
@@ -15651,21 +15652,21 @@
},
{
"en": "Sync server device name to hostname",
"nl" "Synchroniseer serverapparaatnaam met hostnaam",
"nl": "Synchroniseer serverapparaatnaam met hostnaam",
"xloc": [
"default.handlebars->23->1046"
]
},
{
"en": "Notification settings must also be turned on in account settings.",
"nl" "Meldingsinstellingen moeten ook worden ingeschakeld in accountinstellingen.",
"nl": "Meldingsinstellingen moeten ook worden ingeschakeld in accountinstellingen.",
"xloc": [
"default.handlebars->23->1096"
]
},
{
"en": "Groups",
"nl" "Groepen
"nl": "Groepen",
"xloc": [
"default.handlebars->23->1160"
]
@@ -15686,7 +15687,7 @@
},
{
"en": "CPU Load",
"nL": "CPU gebruik",
"nl": "CPU gebruik",
"xloc": [
"default.handlebars->23->1306"
]
@@ -15720,7 +15721,7 @@
},
{
"en": "Invalid RSA siguature",
"n;": "Ongeldige RSA handtekening",
"nl": "Ongeldige RSA handtekening",
"xloc": [
"default.handlebars->23->1288"
]
@@ -15835,7 +15836,7 @@
]
},
{
"en": "u:",
"en": "u:",
"xloc": [
"default.handlebars->23->393"
]
@@ -15862,7 +15863,7 @@
},
{
"en": "External",
"en": "Extern",
"nl": "Extern",
"xloc": [
"default.handlebars->23->1320"
]