Skip to content

Commit

Permalink
fix(trasnlations): t#4027 fix url api in translate.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelatorre committed Oct 6, 2023
1 parent 000a3ea commit e0fe24d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion javascript/scripts/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e0fe24d

Please sign in to comment.