Files
cloud-host/frontend/src/i18n/dictionaries.ts
T
keyhan 34993d417f Add i18n foundation (fa-IR/en-US) and localize landing + auth.
Introduce path-prefixed locale routing under app/[lang] with a middleware
that detects locale from cookie/Accept-Language (default fa-IR) and
redirects. Add fa-IR (source of truth) and en-US dictionaries, a server
getDictionary, a client I18nProvider/useT, locale-aware Link + router
helpers, and a language switcher. The root [lang] layout sets html
lang/dir and the per-locale font (Peyda for fa, Inter for en).

Landing sections and the login/register/auth shell now read all copy from
the dictionaries; dashboard localization follows in a later commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 12:05:03 +03:30

12 lines
421 B
TypeScript

import type { Locale } from './config';
import type { Dictionary } from './dictionaries/fa';
const loaders: Record<Locale, () => Promise<Dictionary>> = {
'fa-IR': () => import('./dictionaries/fa').then((m) => m.default),
'en-US': () => import('./dictionaries/en').then((m) => m.default),
};
export const getDictionary = async (locale: Locale): Promise<Dictionary> => loaders[locale]();
export type { Dictionary };