Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/app/src/context/language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -62,6 +64,7 @@ function detectLocale(): Locale {
language.toLowerCase().startsWith("nn")
)
return "no"
if (language.toLowerCase().startsWith("pt")) return "br"
}

return "en"
Expand Down Expand Up @@ -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"
})

Expand All @@ -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 }) }
})

Expand All @@ -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])
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export const dict = {
"language.pl": "البولندية",
"language.ar": "العربية",
"language.no": "النرويجية",
"language.br": "البرتغالية (البرازيل)",

"toast.language.title": "لغة",
"toast.language.description": "تم التبديل إلى {{language}}",
Expand Down
665 changes: 665 additions & 0 deletions packages/app/src/i18n/br.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/app/src/i18n/da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const dict = {
"language.pl": "Polsk",
"language.ar": "Arabisk",
"language.no": "Norsk",
"language.br": "Portugisisk (Brasilien)",

"toast.language.title": "Sprog",
"toast.language.description": "Skiftede til {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export const dict = {
"language.pl": "Polnisch",
"language.ar": "Arabisch",
"language.no": "Norwegisch",
"language.br": "Portugiesisch (Brasilien)",

"toast.language.title": "Sprache",
"toast.language.description": "Zu {{language}} gewechselt",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export const dict = {
"language.pl": "Polish",
"language.ar": "Arabic",
"language.no": "Norwegian",
"language.br": "Portuguese (Brazil)",

"toast.language.title": "Language",
"toast.language.description": "Switched to {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const dict = {
"language.pl": "Polaco",
"language.ar": "Árabe",
"language.no": "Noruego",
"language.br": "Portugués (Brasil)",

"toast.language.title": "Idioma",
"toast.language.description": "Cambiado a {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const dict = {
"language.pl": "Polonais",
"language.ar": "Arabe",
"language.no": "Norvégien",
"language.br": "Portugais (Brésil)",

"toast.language.title": "Langue",
"toast.language.description": "Passé à {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export const dict = {
"language.pl": "ポーランド語",
"language.ar": "アラビア語",
"language.no": "ノルウェー語",
"language.br": "ポルトガル語(ブラジル)",

"toast.language.title": "言語",
"toast.language.description": "{{language}}に切り替えました",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export const dict = {
"language.pl": "폴란드어",
"language.ar": "아랍어",
"language.no": "노르웨이어",
"language.br": "포르투갈어 (브라질)",

"toast.language.title": "언어",
"toast.language.description": "{{language}}(으)로 전환됨",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/no.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export const dict = {
"language.pl": "Polsk",
"language.ar": "Arabisk",
"language.no": "Norsk",
"language.br": "Portugisisk (Brasil)",

"toast.language.title": "Språk",
"toast.language.description": "Byttet til {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ export const dict = {
"language.ru": "Rosyjski",
"language.ar": "Arabski",
"language.no": "Norweski",
"language.br": "Portugalski (Brazylia)",

"toast.language.title": "Język",
"toast.language.description": "Przełączono na {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ export const dict = {
"language.ru": "Русский",
"language.ar": "Арабский",
"language.no": "Норвежский",
"language.br": "Португальский (Бразилия)",

"toast.language.title": "Язык",
"toast.language.description": "Переключено на {{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export const dict = {
"language.pl": "波兰语",
"language.ar": "阿拉伯语",
"language.no": "挪威语",
"language.br": "葡萄牙语(巴西)",

"toast.language.title": "语言",
"toast.language.description": "已切换到{{language}}",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/i18n/zht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export const dict = {
"language.ru": "俄語",
"language.ar": "阿拉伯語",
"language.no": "挪威語",
"language.br": "葡萄牙語(巴西)",

"toast.language.title": "語言",
"toast.language.description": "已切換到 {{language}}",
Expand Down
92 changes: 92 additions & 0 deletions packages/ui/src/i18n/br.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
export const dict = {
"ui.sessionReview.title": "Alterações da sessão",
"ui.sessionReview.diffStyle.unified": "Unificado",
"ui.sessionReview.diffStyle.split": "Dividido",
"ui.sessionReview.expandAll": "Expandir tudo",
"ui.sessionReview.collapseAll": "Recolher tudo",

"ui.sessionTurn.steps.show": "Mostrar passos",
"ui.sessionTurn.steps.hide": "Ocultar passos",
"ui.sessionTurn.summary.response": "Resposta",
"ui.sessionTurn.diff.showMore": "Mostrar mais alterações ({{count}})",

"ui.sessionTurn.retry.retrying": "tentando novamente",
"ui.sessionTurn.retry.inSeconds": "em {{seconds}}s",

"ui.sessionTurn.status.delegating": "Delegando trabalho",
"ui.sessionTurn.status.planning": "Planejando próximos passos",
"ui.sessionTurn.status.gatheringContext": "Coletando contexto",
"ui.sessionTurn.status.searchingCodebase": "Pesquisando no código",
"ui.sessionTurn.status.searchingWeb": "Pesquisando na web",
"ui.sessionTurn.status.makingEdits": "Fazendo edições",
"ui.sessionTurn.status.runningCommands": "Executando comandos",
"ui.sessionTurn.status.thinking": "Pensando",
"ui.sessionTurn.status.thinkingWithTopic": "Pensando - {{topic}}",
"ui.sessionTurn.status.gatheringThoughts": "Organizando pensamentos",
"ui.sessionTurn.status.consideringNextSteps": "Considerando próximos passos",

"ui.messagePart.diagnostic.error": "Erro",
"ui.messagePart.title.edit": "Editar",
"ui.messagePart.title.write": "Escrever",
"ui.messagePart.option.typeOwnAnswer": "Digite sua própria resposta",
"ui.messagePart.review.title": "Revise suas respostas",

"ui.list.loading": "Carregando",
"ui.list.empty": "Nenhum resultado",
"ui.list.clearFilter": "Limpar filtro",
"ui.list.emptyWithFilter.prefix": "Nenhum resultado para",
"ui.list.emptyWithFilter.suffix": "",

"ui.messageNav.newMessage": "Nova mensagem",

"ui.textField.copyToClipboard": "Copiar para área de transferência",
"ui.textField.copied": "Copiado",

"ui.imagePreview.alt": "Visualização de imagem",

"ui.tool.read": "Ler",
"ui.tool.list": "Listar",
"ui.tool.glob": "Glob",
"ui.tool.grep": "Grep",
"ui.tool.webfetch": "Buscar Web",
"ui.tool.shell": "Shell",
"ui.tool.patch": "Patch",
"ui.tool.todos": "Tarefas",
"ui.tool.todos.read": "Ler tarefas",
"ui.tool.questions": "Perguntas",
"ui.tool.agent": "Agente {{type}}",

"ui.common.file.one": "arquivo",
"ui.common.file.other": "arquivos",
"ui.common.question.one": "pergunta",
"ui.common.question.other": "perguntas",

"ui.common.add": "Adicionar",
"ui.common.cancel": "Cancelar",
"ui.common.confirm": "Confirmar",
"ui.common.dismiss": "Descartar",
"ui.common.close": "Fechar",
"ui.common.next": "Próximo",
"ui.common.submit": "Enviar",

"ui.permission.deny": "Negar",
"ui.permission.allowAlways": "Permitir sempre",
"ui.permission.allowOnce": "Permitir uma vez",

"ui.message.expand": "Expandir mensagem",
"ui.message.collapse": "Recolher mensagem",
"ui.message.copy": "Copiar",
"ui.message.copied": "Copiado!",
"ui.message.attachment.alt": "anexo",

"ui.patch.action.deleted": "Excluído",
"ui.patch.action.created": "Criado",
"ui.patch.action.moved": "Movido",
"ui.patch.action.patched": "Aplicado patch",

"ui.question.subtitle.answered": "{{count}} respondidas",
"ui.question.answer.none": "(sem resposta)",
"ui.question.review.notAnswered": "(não respondida)",
"ui.question.multiHint": "(selecione todas que se aplicam)",
"ui.question.custom.placeholder": "Digite sua resposta...",
}