diff options
| author | Adam <[email protected]> | 2026-01-20 15:00:46 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-20 17:58:06 -0600 |
| commit | b13c269162e6c858acbce6cc792636cd4cb921a9 (patch) | |
| tree | d4e81f96109919ce41b36c175bd8da9aba5506ee /packages/app/src/context | |
| parent | ef36af0e55d814dc80893af923886ccff40f46e5 (diff) | |
| download | opencode-b13c269162e6c858acbce6cc792636cd4cb921a9.tar.gz opencode-b13c269162e6c858acbce6cc792636cd4cb921a9.zip | |
wip(app): i18n
Diffstat (limited to 'packages/app/src/context')
| -rw-r--r-- | packages/app/src/context/language.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/app/src/context/language.tsx b/packages/app/src/context/language.tsx index 3178cb6b6..b04b4dfc4 100644 --- a/packages/app/src/context/language.tsx +++ b/packages/app/src/context/language.tsx @@ -5,10 +5,12 @@ import { createSimpleContext } from "@opencode-ai/ui/context" import { Persist, persisted } from "@/utils/persist" import { dict as en } from "@/i18n/en" import { dict as zh } from "@/i18n/zh" +import { dict as uiEn } from "@opencode-ai/ui/i18n/en" +import { dict as uiZh } from "@opencode-ai/ui/i18n/zh" export type Locale = "en" | "zh" -type RawDictionary = typeof en +type RawDictionary = typeof en & typeof uiEn type Dictionary = i18n.Flatten<RawDictionary> const LOCALES: readonly Locale[] = ["en", "zh"] @@ -43,10 +45,10 @@ export const { use: useLanguage, provider: LanguageProvider } = createSimpleCont setStore("locale", current) }) - const base = i18n.flatten(en) + const base = i18n.flatten({ ...en, ...uiEn }) const dict = createMemo<Dictionary>(() => { if (locale() === "en") return base - return { ...base, ...i18n.flatten(zh) } + return { ...base, ...i18n.flatten({ ...zh, ...uiZh }) } }) const t = i18n.translator(dict, i18n.resolveTemplate) |
