From 0e467694762ff087781cae9837316ff437d11497 Mon Sep 17 00:00:00 2001 From: "teresa.delatorre" Date: Fri, 6 Oct 2023 12:48:24 +0200 Subject: [PATCH] fix(trasnlations): t#4027 fix url api in translate.js --- javascript/scripts/translate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/javascript/scripts/translate.js b/javascript/scripts/translate.js index 1ef43e8ed..d5fed44d9 100644 --- a/javascript/scripts/translate.js +++ b/javascript/scripts/translate.js @@ -14,6 +14,7 @@ const { Translate } = require('@google-cloud/translate').v2; const projectId = process.env.projectId ?? ''; const defaultSourceLang = 'en-US'; const fs = require('fs'); +const dataConfig = JSON.parse(fs.readFileSync('./apps/taiga/src/assets/config.json', 'utf8')); const i18Dir = './apps/taiga/src/assets/i18n'; @@ -45,7 +46,7 @@ async function createLocalFiles(codes) { }); } async function init() { - const response = await fetch('http://127.0.0.1:8000/api/v2/system/languages'); + const response = await fetch(`${dataConfig.api}/system/languages`); let codes = {}; (await response.json()).forEach((it) => { codes[it.englishName] = it.code;