workaround for default language en and basetranslation pl

This commit is contained in:
MichaelDvP
2022-11-23 11:09:46 +01:00
parent 1b1a4bcad4
commit 88135d2750
4 changed files with 9 additions and 4 deletions

View File

@@ -36,6 +36,7 @@ jobs:
cd interface cd interface
npm ci npm ci
npx typesafe-i18n --no-watch npx typesafe-i18n --no-watch
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
npm run build npm run build
- name: Build firmware - name: Build firmware

View File

@@ -1,8 +1,8 @@
import type { BaseTranslation } from '../i18n-types'; import type { Translation } from '../i18n-types';
/* prettier-ignore */ /* prettier-ignore */
/* eslint-disable */ /* eslint-disable */
const en: BaseTranslation = { const en: Translation = {
LANGUAGE: 'Language', LANGUAGE: 'Language',
RETRY: 'Retry', RETRY: 'Retry',
LOADING: 'Loading', LOADING: 'Loading',

View File

@@ -1,8 +1,8 @@
import type { Translation } from '../i18n-types'; import type { BaseTranslation } from '../i18n-types';
/* prettier-ignore */ /* prettier-ignore */
/* eslint-disable */ /* eslint-disable */
const pl: Translation = { const pl: BaseTranslation = {
LANGUAGE: 'Język', LANGUAGE: 'Język',
RETRY: 'Ponów', RETRY: 'Ponów',
LOADING: 'Ładowanie', LOADING: 'Ładowanie',

View File

@@ -24,6 +24,10 @@ def buildWeb():
try: try:
env.Execute("npm install") env.Execute("npm install")
env.Execute("npx typesafe-i18n --no-watch") 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") env.Execute("npm run build")
buildPath = Path("build") buildPath = Path("build")
wwwPath = Path("../data/www") wwwPath = Path("../data/www")