import { BadgeKey, ButtonKey, OptionKey, PromptKey, StatusKey, SubOptionKey, SubPromptKey, SubTitleKey, TextKey, TitleKey } from './LocalizationKey'; export type Language = { button: { [key in ButtonKey]: string; }; badge: { [key in BadgeKey]: string; }; status: { [key in StatusKey]: string; }; prompt: { [key in PromptKey]: string; }; subPrompt: { [key in SubPromptKey]: string; }; title: { [key in TitleKey]: string; }; subTitle: { [key in SubTitleKey]: string; }; option: { [key in OptionKey]: string; }; subOption: { [key in SubOptionKey]: string; }; text: { [key in TextKey]: string; }; }; export type LanguageWithProperties = Language & { properties: { nameInEnglish: string; label: string; lang: string; direction?: 'ltr' | 'rtl'; /** * Which key universe this locale covers — the single, type-checked source * of truth the i18n tooling (validate / generate-schema / sync) reads via * `scripts/i18n-sync/src/language-classifier.ts`. A `full` language covers * every key; `full-partial` is a dialect override that may be sparse. */ coverage: 'full' | 'full-partial'; }; }; /** * A locale that only translates the subset of keys used by international * (DPS / Self-Cert) flows. Missing keys fall back to en-us at runtime via * the lookup helpers in `i18n/utils/getText.ts`. */ export type ForeignLanguageWithProperties = ForeignLanguage & { properties: { nameInEnglish: string; label: string; lang: string; direction?: 'ltr' | 'rtl'; /** See `LanguageWithProperties.properties.coverage`. Subset locales cover * only the `ForeignLanguage` key set; `subset-partial` is a dialect * override of a subset locale. */ coverage: 'subset' | 'subset-partial'; }; }; type Index = 1 | 2 | 3 | 4 | 5; type ExpandedStatusKey = `controllingPerson${Index}ResidencesMustIncludeAddressCountry` | 'accountHolderResidencesMustIncludeAddressCountry' | 'accountHolderResidencesMustIncludeVatCountry' | 'accountHolderResidencesMustIncludeBusinessRegistrationCountry'; type ExpandedLanguageFields = { status: Language['status'] & { [key in ExpandedStatusKey]: string; }; }; export type ExpandedLanguage = Language & ExpandedLanguageFields; export type ForeignLanguage = { button: Language['button']; prompt: Pick; subPrompt: Pick; subTitle: Pick; title: Pick; text: Pick; status: Pick; option: Pick; subOption: Pick; }; export {};