From 88135d27509c159cb24ff184fc99329fc8da6545 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 23 Nov 2022 11:09:46 +0100 Subject: [PATCH] workaround for default language en and basetranslation pl --- .github/workflows/pre_release.yml | 1 + interface/src/i18n/en/index.ts | 4 ++-- interface/src/i18n/pl/index.ts | 4 ++-- scripts/build_interface.py | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml index a7794885f..5e54e3d95 100644 --- a/.github/workflows/pre_release.yml +++ b/.github/workflows/pre_release.yml @@ -36,6 +36,7 @@ jobs: cd interface npm ci npx typesafe-i18n --no-watch + sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts npm run build - name: Build firmware diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index c5f8aa953..2e949f2e8 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -1,8 +1,8 @@ -import type { BaseTranslation } from '../i18n-types'; +import type { Translation } from '../i18n-types'; /* prettier-ignore */ /* eslint-disable */ -const en: BaseTranslation = { +const en: Translation = { LANGUAGE: 'Language', RETRY: 'Retry', LOADING: 'Loading', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index 582d790f7..413d21c66 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -1,8 +1,8 @@ -import type { Translation } from '../i18n-types'; +import type { BaseTranslation } from '../i18n-types'; /* prettier-ignore */ /* eslint-disable */ -const pl: Translation = { +const pl: BaseTranslation = { LANGUAGE: 'Język', RETRY: 'Ponów', LOADING: 'Ładowanie', diff --git a/scripts/build_interface.py b/scripts/build_interface.py index e4a5fc0f9..6da3e54ec 100644 --- a/scripts/build_interface.py +++ b/scripts/build_interface.py @@ -24,6 +24,10 @@ def buildWeb(): try: env.Execute("npm install") env.Execute("npx typesafe-i18n --no-watch") + with open("./src/i18n/i18n-util.ts") as r: + text = r.read().replace("Locales = 'pl'", "Locales = 'en'") + with open("./src/i18n/i18n-util.ts", "w") as w: + w.write(text) env.Execute("npm run build") buildPath = Path("build") wwwPath = Path("../data/www")