diff options
| author | Ygor Simões <[email protected]> | 2026-01-22 15:36:33 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-22 12:36:33 -0600 |
| commit | 32f72f49a830dfadc32955ffe4bdd7fdf1659fbf (patch) | |
| tree | 2606abd6bef7057e8523e42a238758365f579592 /packages/app/src/context/language.tsx | |
| parent | 923e3da973dc6c47689173fea803b7fd700a7ad9 (diff) | |
| download | opencode-32f72f49a830dfadc32955ffe4bdd7fdf1659fbf.tar.gz opencode-32f72f49a830dfadc32955ffe4bdd7fdf1659fbf.zip | |
feat(i18n): add br locale support (#10086)
Diffstat (limited to 'packages/app/src/context/language.tsx')
| -rw-r--r-- | packages/app/src/context/language.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/app/src/context/language.tsx b/packages/app/src/context/language.tsx index b5830122f..da10e4773 100644 --- a/packages/app/src/context/language.tsx +++ b/packages/app/src/context/language.tsx @@ -16,6 +16,7 @@ import { dict as pl } from "@/i18n/pl" import { dict as ru } from "@/i18n/ru" import { dict as ar } from "@/i18n/ar" import { dict as no } from "@/i18n/no" +import { dict as br } from "@/i18n/br" import { dict as uiEn } from "@opencode-ai/ui/i18n/en" import { dict as uiZh } from "@opencode-ai/ui/i18n/zh" import { dict as uiZht } from "@opencode-ai/ui/i18n/zht" @@ -29,13 +30,14 @@ import { dict as uiPl } from "@opencode-ai/ui/i18n/pl" import { dict as uiRu } from "@opencode-ai/ui/i18n/ru" import { dict as uiAr } from "@opencode-ai/ui/i18n/ar" import { dict as uiNo } from "@opencode-ai/ui/i18n/no" +import { dict as uiBr } from "@opencode-ai/ui/i18n/br" -export type Locale = "en" | "zh" | "zht" | "ko" | "de" | "es" | "fr" | "da" | "ja" | "pl" | "ru" | "ar" | "no" +export type Locale = "en" | "zh" | "zht" | "ko" | "de" | "es" | "fr" | "da" | "ja" | "pl" | "ru" | "ar" | "no" | "br" type RawDictionary = typeof en & typeof uiEn type Dictionary = i18n.Flatten<RawDictionary> -const LOCALES: readonly Locale[] = ["en", "zh", "zht", "ko", "de", "es", "fr", "da", "ja", "pl", "ru", "ar", "no"] +const LOCALES: readonly Locale[] = ["en", "zh", "zht", "ko", "de", "es", "fr", "da", "ja", "pl", "ru", "ar", "no", "br"] function detectLocale(): Locale { if (typeof navigator !== "object") return "en" @@ -62,6 +64,7 @@ function detectLocale(): Locale { language.toLowerCase().startsWith("nn") ) return "no" + if (language.toLowerCase().startsWith("pt")) return "br" } return "en" @@ -90,6 +93,7 @@ export const { use: useLanguage, provider: LanguageProvider } = createSimpleCont if (store.locale === "ru") return "ru" if (store.locale === "ar") return "ar" if (store.locale === "no") return "no" + if (store.locale === "br") return "br" return "en" }) @@ -113,6 +117,7 @@ export const { use: useLanguage, provider: LanguageProvider } = createSimpleCont if (locale() === "ru") return { ...base, ...i18n.flatten({ ...ru, ...uiRu }) } if (locale() === "ar") return { ...base, ...i18n.flatten({ ...ar, ...uiAr }) } if (locale() === "no") return { ...base, ...i18n.flatten({ ...no, ...uiNo }) } + if (locale() === "br") return { ...base, ...i18n.flatten({ ...br, ...uiBr }) } return { ...base, ...i18n.flatten({ ...ko, ...uiKo }) } }) @@ -132,6 +137,7 @@ export const { use: useLanguage, provider: LanguageProvider } = createSimpleCont ru: "language.ru", ar: "language.ar", no: "language.no", + br: "language.br", } const label = (value: Locale) => t(labelKey[value]) |
