mirror of
https://github.com/Dvorinka/Dash.git
synced 2026-10-29 08:04:58 +00:00
feat: i18n seam — typed t() + en dictionary
Nav and header wired as proof. Full string extraction deferred until a second locale exists; CONTRIBUTING records the convention. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a89a81d46c
commit
88a8210bf8
5 files changed
+58
-15
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { en, type Key } from "@/i18n/en";
|
||||
|
||||
export type { Key } from "@/i18n/en";
|
||||
|
||||
// i18n seam: dictionaries are plain objects keyed by dotted names. `t` is a
|
||||
// typed lookup that falls back to the key itself, so a missing translation
|
||||
// renders the key — loud in dev, never a crash. Locales beyond `en` plug in
|
||||
// here later (settings key + lazy import); nothing else changes.
|
||||
const dict: Record<Key, string> = en;
|
||||
|
||||
export function t(key: Key): string {
|
||||
return dict[key] ?? key;
|
||||
}
|
||||
Reference in new issue
Block a user