/** * The three languages the showcase speaks, in the order the switcher draws them. * * `az` is the default because the kit documents a Baku bank's design system and * CBAR's own site opens in Azerbaijani. `useParam` drops a value equal to its * fallback from the hash, so the default language costs the URL nothing. */ export const LANGS = ['az', 'ru', 'en'] as const; export type Lang = (typeof LANGS)[number]; export const DEFAULT_LANG: Lang = 'az'; /** Short labels for the switcher — never translated, they name themselves. */ export const LANG_LABELS: Record = { az: 'AZ', ru: 'RU', en: 'EN', }; /** * The hash is user-editable, so `?lang=zz` has to fall back rather than index a * catalogue with `undefined`. */ export function isLang(value: string): value is Lang { return (LANGS as readonly string[]).includes(value); }