Translations

parent dbd27c9f
Pipeline #7512 failed with stages
...@@ -2,7 +2,7 @@ function fillEmptyValuesWithEnglish(data, usData) { ...@@ -2,7 +2,7 @@ function fillEmptyValuesWithEnglish(data, usData) {
const translations = {}; const translations = {};
for (const [key, value] of Object.entries(data)) { for (const [key, value] of Object.entries(data)) {
if (value[key]) { if (value) {
translations[key] = value; translations[key] = value;
} else { } else {
translations[key] = usData[key]; translations[key] = usData[key];
......
...@@ -3,10 +3,11 @@ const fs = require("fs"); ...@@ -3,10 +3,11 @@ const fs = require("fs");
const api = require("./api"); const api = require("./api");
const fillEmptyKeys = require("./fillEmptyKeys"); const fillEmptyKeys = require("./fillEmptyKeys");
(async function() { (async function () {
try { try {
const token = await api.login(); const token = await api.login();
const translationsResp = await api.getTranslation(token); const translationsResp = await api.getTranslation(token);
console.log("translationsResp", translationsResp);
for (const [key, value] of Object.entries(translationsResp)) { for (const [key, value] of Object.entries(translationsResp)) {
try { try {
...@@ -31,7 +32,7 @@ function writeToFile(fileName, data) { ...@@ -31,7 +32,7 @@ function writeToFile(fileName, data) {
fs.writeFile( fs.writeFile(
`./translations/${fileName}.json`, `./translations/${fileName}.json`,
JSON.stringify(data), JSON.stringify(data),
err => { (err) => {
if (err) { if (err) {
return reject(err); return reject(err);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment