Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trasnlations): t#4027 fix url api in translate.js #525

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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