Fix missing type support for i18n resources

Due to the change in 65a9a905be - moving to a json file - it wasn't ensured anymore that IsoLanguages contained the i18n language codes
This commit is contained in:
schroda
2026-01-30 21:46:20 +01:00
parent c5cdd347b7
commit edbbc81575
5 changed files with 47 additions and 37 deletions

View File

@@ -34,7 +34,7 @@ import { LibraryOptions } from '@/features/library/Library.types.ts';
import { MetadataThemeSettings } from '@/features/theme/AppTheme.types.ts';
import { TapZoneInvertMode } from '@/features/reader/tap-zones/TapZoneLayout.types.ts';
import { detectLocale, getISOLanguage } from '@/lib/ISOLanguageUtil.ts';
import { i18nResources } from '@/i18n';
import { I18nResourceCode, i18nResources } from '@/i18n';
import { toUniqueLanguageCodes } from '@/base/utils/Languages.ts';
export const APP_METADATA_KEY_PREFIX = 'webUI';
@@ -385,7 +385,7 @@ export const APP_METADATA: Record<
toConstrainedValue: (value: string) => {
const locale = getISOLanguage(value)?.isoCode;
if (!locale || !i18nResources.includes(locale)) {
if (!locale || !i18nResources.includes(locale as I18nResourceCode)) {
return detectLocale();
}