Translations

parent dbd27c9f
Pipeline #7512 failed with stages
......@@ -2,7 +2,7 @@ function fillEmptyValuesWithEnglish(data, usData) {
const translations = {};
for (const [key, value] of Object.entries(data)) {
if (value[key]) {
if (value) {
translations[key] = value;
} else {
translations[key] = usData[key];
......
......@@ -3,10 +3,11 @@ const fs = require("fs");
const api = require("./api");
const fillEmptyKeys = require("./fillEmptyKeys");
(async function() {
(async function () {
try {
const token = await api.login();
const translationsResp = await api.getTranslation(token);
console.log("translationsResp", translationsResp);
for (const [key, value] of Object.entries(translationsResp)) {
try {
......@@ -31,7 +32,7 @@ function writeToFile(fileName, data) {
fs.writeFile(
`./translations/${fileName}.json`,
JSON.stringify(data),
err => {
(err) => {
if (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