From c5cdd347b70582e95623774163ec95f0ad1e33c5 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 30 Jan 2026 21:29:43 +0100 Subject: [PATCH] Update available languages --- lingui.config.ts | 25 +++++++++++++++++++++---- src/i18n/index.ts | 24 +++++++++++++++++++++--- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/lingui.config.ts b/lingui.config.ts index 5b8f6005..5ed5534f 100644 --- a/lingui.config.ts +++ b/lingui.config.ts @@ -9,13 +9,30 @@ import { defineConfig } from '@lingui/cli'; // eslint-disable-next-line import/no-extraneous-dependencies import { formatter } from '@lingui/format-po'; -// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths -import localesConfig from './src/i18n/locales.json'; // eslint-disable-next-line import/no-default-export export default defineConfig({ - sourceLocale: localesConfig.defaultLocale, - locales: localesConfig.locales, + sourceLocale: 'en', + // This array is auto-generated by tools/scripts/weblate/generatei18nResources.ts. Do not edit manually. + locales: [ + 'de', + 'en', + 'es', + 'fa', + 'fr', + 'hu', + 'it', + 'ja', + 'ko', + 'pl', + 'pt', + 'ru', + 'ta', + 'tr', + 'vi', + 'zh_Hans', + 'zh_Hant', + ], catalogs: [ { path: '/src/i18n/locales/{locale}', diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 4e403417..1fd9f3c6 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -8,14 +8,32 @@ import { i18n } from '@lingui/core'; import { detectLocale, SELECTED_LANGUAGE_CODE_KEY } from '@/lib/ISOLanguageUtil.ts'; -import localesConfig from '@/i18n/locales.json'; import { AppStorage } from '@/lib/storage/AppStorage.ts'; -export const i18nResources = localesConfig.locales; +// This array is auto-generated by tools/scripts/weblate/generatei18nResources.ts. Do not edit manually. +export const i18nResources = [ + 'de', + 'en', + 'es', + 'fa', + 'fr', + 'hu', + 'it', + 'ja', + 'ko', + 'pl', + 'pt', + 'ru', + 'ta', + 'tr', + 'vi', + 'zh_Hans', + 'zh_Hant', +] as const; export type I18nResourceCode = (typeof i18nResources)[number]; -const DEFAULT_LOCALE = localesConfig.defaultLocale; +const DEFAULT_LOCALE = 'en'; export async function loadCatalog(locale: string): Promise { const localeToLoad = i18nResources.includes(locale as (typeof i18nResources)[number]) ? locale : DEFAULT_LOCALE;