This commit is contained in:
Andras Bacsai 2022-08-31 11:39:20 +02:00
parent c46a1b4a59
commit 042b4e7587
2 changed files with 8 additions and 4 deletions

4
apps/i18n/.env.example Normal file
View File

@ -0,0 +1,4 @@
WEBLATE_INSTANCE_URL=http://localhost
WEBLATE_COMPONENT_NAME=coolify
WEBLATE_TOKEN=
TRANSLATION_DIR=

View File

@ -10,16 +10,16 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const webletInstanceURL = process.env.WEBLET_INSTANCE_URL;
const webletComponentName = process.env.WEBLET_COMPONENT_NAME
const token = process.env.WEBLET_TOKEN;
const weblateInstanceURL = process.env.WEBLATE_INSTANCE_URL;
const weblateComponentName = process.env.WEBLATE_COMPONENT_NAME
const token = process.env.WEBLATE_TOKEN;
const translationsDir = process.env.TRANSLATION_DIR;
const translationsPODir = './locales';
const locales = []
const domain = 'locale'
const translations = await got(`${webletInstanceURL}/api/components/${webletComponentName}/glossary/translations/?format=json`, {
const translations = await got(`${weblateInstanceURL}/api/components/${weblateComponentName}/glossary/translations/?format=json`, {
headers: {
"Authorization": `Token ${token}`
}