From e0fe24dae756616b17c2157504599ceaffbdd5f6 Mon Sep 17 00:00:00 2001
From: "teresa.delatorre" <teresa.delatorre@kaleidos.net>
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/javascript/scripts/translate.js b/javascript/scripts/translate.js
index 1ef43e8ed..0b105d4ef 100644
--- a/javascript/scripts/translate.js
+++ b/javascript/scripts/translate.js
@@ -14,6 +14,9 @@ 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 +48,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;