From 54a9a25e07c76ea759cd151900d1e4806ea93fc9 Mon Sep 17 00:00:00 2001 From: aandrew-me Date: Fri, 2 Sep 2022 21:37:52 +0600 Subject: [PATCH] More localization changes --- csv2json.js | 28 +++++++++++--------- html/index.html | 2 +- html/preferences.html | 2 +- input.csv | 24 ----------------- json2csv.js | 6 +++-- src/translate_index.js | 3 ++- src/translate_preferences.js | 3 ++- translate.csv | 51 ++++++++++++++++++------------------ translations/ru.json | 10 ++++--- translations/translate.json | 5 ++-- 10 files changed, 60 insertions(+), 74 deletions(-) diff --git a/csv2json.js b/csv2json.js index 1e484e8..e32e286 100644 --- a/csv2json.js +++ b/csv2json.js @@ -1,7 +1,7 @@ // Converts the csv translation file to json and puts in translations folder // Language of output file -const language = "ru" +const language = "ru"; const { readFileSync, writeFileSync } = require("fs"); @@ -10,7 +10,7 @@ let result = ""; let count = 0; let size = csvFile.length; -let index = 0 +let index = 0; result += "{"; for (let letter of csvFile) { @@ -18,18 +18,20 @@ for (let letter of csvFile) { count++; if (count < 4) { result += letter; - index ++; + index++; } else { - index ++; - if (index == size-1){ - result += `${letter}`; - } - else{ - result += `${letter},`; - } - + index++; + if (index == size - 1) { + result += `${letter}`; + } else { + result += `${letter},`; + } + count = 0; } + } else if (letter == "," && count == 2) { + index++ + result += ":" } else { result += letter; index++; @@ -37,6 +39,6 @@ for (let letter of csvFile) { } result += "}"; -writeFileSync(`translations/${language}.json`, result) +writeFileSync(`translations/${language}.json`, result); -console.log(`Converted and saved to translations/${language}.json`) \ No newline at end of file +console.log(`Converted and saved to translations/${language}.json`); diff --git a/html/index.html b/html/index.html index 871e849..4586d78 100644 --- a/html/index.html +++ b/html/index.html @@ -54,7 +54,7 @@
- Processing + Processing diff --git a/html/preferences.html b/html/preferences.html index 1e9a3d6..f8296ae 100644 --- a/html/preferences.html +++ b/html/preferences.html @@ -30,7 +30,7 @@

- +