agent-ecosystem/src/features/localization/contracts/appLocale.ts
777genius 46bd1eb86c feat(i18n): add 15 app and landing languages
Add full app (7 namespaces) and landing translations for: it, tr, vi,
pl, fa (RTL), th, uk, nl, ta, te, mr, fil, ms, sw, ro. Bringing the
supported set to 29 languages.

- register locales in appLocale.ts and landing/data/i18n.ts
- regenerate resources.d.ts language-name keys
- add native exonyms for the new languages to every existing common.json
- extend localePolicy tests to cover the new locales

Catalogs verified for key/placeholder parity (i18n:validate, 29 locales).
2026-05-31 19:26:36 +03:00

80 lines
1.2 KiB
TypeScript

export const APP_LOCALE_PREFERENCES = [
'system',
'en',
'ru',
'zh',
'ja',
'ko',
'es',
'hi',
'pt',
'fr',
'ar',
'bn',
'ur',
'id',
'de',
'it',
'tr',
'vi',
'pl',
'fa',
'th',
'uk',
'nl',
'ta',
'te',
'mr',
'fil',
'ms',
'sw',
'ro',
] as const;
export const RESOLVED_APP_LOCALES = [
'en',
'ru',
'zh',
'ja',
'ko',
'es',
'hi',
'pt',
'fr',
'ar',
'bn',
'ur',
'id',
'de',
'it',
'tr',
'vi',
'pl',
'fa',
'th',
'uk',
'nl',
'ta',
'te',
'mr',
'fil',
'ms',
'sw',
'ro',
] as const;
export type AppLocalePreference = (typeof APP_LOCALE_PREFERENCES)[number];
export type ResolvedAppLocale = (typeof RESOLVED_APP_LOCALES)[number];
export const DEFAULT_APP_LOCALE_PREFERENCE: AppLocalePreference = 'system';
export const FALLBACK_APP_LOCALE: ResolvedAppLocale = 'en';
export function isAppLocalePreference(value: unknown): value is AppLocalePreference {
return typeof value === 'string' && APP_LOCALE_PREFERENCES.includes(value as AppLocalePreference);
}
export function isResolvedAppLocale(value: unknown): value is ResolvedAppLocale {
return typeof value === 'string' && RESOLVED_APP_LOCALES.includes(value as ResolvedAppLocale);
}