mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-02 17:35:57 -05:00
Fixed Japaneese translation.
This commit is contained in:
parent
43209e8165
commit
7d195f0108
@ -168,7 +168,7 @@ function startEx(argv) {
|
|||||||
|
|
||||||
var command = null;
|
var command = null;
|
||||||
if (argv.length > 2) { command = argv[2].toLowerCase(); }
|
if (argv.length > 2) { command = argv[2].toLowerCase(); }
|
||||||
if (['minify', 'check', 'extract', 'extractall', 'translate', 'translateall', 'minifyall', 'merge', 'totext', 'fromtext'].indexOf(command) == -1) { command = null; }
|
if (['minify', 'check', 'extract', 'extractall', 'translate', 'translateall', 'minifyall', 'merge', 'totext', 'fromtext', 'remove'].indexOf(command) == -1) { command = null; }
|
||||||
|
|
||||||
if (directRun) { log('MeshCentral web site translator'); }
|
if (directRun) { log('MeshCentral web site translator'); }
|
||||||
if (command == null) {
|
if (command == null) {
|
||||||
@ -277,6 +277,25 @@ function startEx(argv) {
|
|||||||
extract(translationFile, meshCentralSourceFiles, translationFile);
|
extract(translationFile, meshCentralSourceFiles, translationFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove a language from a translation file
|
||||||
|
if (command == 'remove') {
|
||||||
|
if (argv.length <= 3) { log('Usage: remove [language] (file)'); return; }
|
||||||
|
lang = argv[3].toLowerCase();
|
||||||
|
var translationFile = 'translate.json';
|
||||||
|
if (argv.length > 4) {
|
||||||
|
if (fs.existsSync(argv[4]) == false) { log('Unable to find: ' + argv[4]); return; } else { translationFile = argv[4]; }
|
||||||
|
}
|
||||||
|
sourceStrings = {};
|
||||||
|
if (fs.existsSync(translationFile) == false) { log('Unable to find: ' + translationFile); return; }
|
||||||
|
var langFileData = null;
|
||||||
|
try { langFileData = JSON.parse(fs.readFileSync(translationFile)); } catch (ex) { }
|
||||||
|
if ((langFileData == null) || (langFileData.strings == null)) { log("Invalid language file."); process.exit(); return; }
|
||||||
|
for (var i in langFileData.strings) { delete langFileData.strings[i][lang]; }
|
||||||
|
fs.writeFileSync(translationFile, translationsToJson({ strings: langFileData.strings }), { flag: 'w+' });
|
||||||
|
log("Done.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (command == 'translateall') {
|
if (command == 'translateall') {
|
||||||
if (fs.existsSync('../views/translations') == false) { fs.mkdirSync('../views/translations'); }
|
if (fs.existsSync('../views/translations') == false) { fs.mkdirSync('../views/translations'); }
|
||||||
//if (fs.existsSync('../public/translations') == false) { fs.mkdirSync('../public/translations'); }
|
//if (fs.existsSync('../public/translations') == false) { fs.mkdirSync('../public/translations'); }
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user