GeezerVison is showing github.com — chore(app): i18n sync (#15362) · dotneB/opencode@6ef3af7
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-release-notes.tsx +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { createSignal } from "solid-js" | 2 | 2 | import { Dialog } from "@opencode-ai/ui/dialog" | 3 | 3 | import { Button } from "@opencode-ai/ui/button" | 4 | 4 | import { useDialog } from "@opencode-ai/ui/context/dialog" | | 5 | +import { useLanguage } from "@/context/language" | 5 | 6 | import { useSettings } from "@/context/settings" | 6 | 7 |
| 7 | 8 | export type Highlight = { | @@ -16,6 +17,7 @@ export type Highlight = { | 16 | 17 |
| 17 | 18 | export function DialogReleaseNotes(props: { highlights: Highlight[] }) { | 18 | 19 | const dialog = useDialog() | | 20 | + const language = useLanguage() | 19 | 21 | const settings = useSettings() | 20 | 22 | const [index, setIndex] = createSignal(0) | 21 | 23 |
| @@ -83,16 +85,16 @@ export function DialogReleaseNotes(props: { highlights: Highlight[] }) { | 83 | 85 | <div class="flex flex-col items-start gap-3"> | 84 | 86 | {isLast() ? ( | 85 | 87 | <Button variant="primary" size="large" onClick={handleClose}> | 86 | | - Get started | | 88 | + {language.t("dialog.releaseNotes.action.getStarted")} | 87 | 89 | </Button> | 88 | 90 | ) : ( | 89 | 91 | <Button variant="secondary" size="large" onClick={handleNext}> | 90 | | - Next | | 92 | + {language.t("dialog.releaseNotes.action.next")} | 91 | 93 | </Button> | 92 | 94 | )} | 93 | 95 |
| 94 | 96 | <Button variant="ghost" size="small" onClick={handleDisable}> | 95 | | - Don't show these in the future | | 97 | + {language.t("dialog.releaseNotes.action.hideFuture")} | 96 | 98 | </Button> | 97 | 99 | </div> | 98 | 100 |
| @@ -128,7 +130,7 @@ export function DialogReleaseNotes(props: { highlights: Highlight[] }) { | 128 | 130 | {feature()!.media!.type === "image" ? ( | 129 | 131 | <img | 130 | 132 | src={feature()!.media!.src} | 131 | | - alt={feature()!.media!.alt ?? feature()?.title ?? "Release preview"} | | 133 | + alt={feature()!.media!.alt ?? feature()?.title ?? language.t("dialog.releaseNotes.media.alt")} | 132 | 134 | class="w-full h-full object-cover" | 133 | 135 | /> | 134 | 136 | ) : ( | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-select-file.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -449,7 +449,7 @@ export function DialogSelectFile(props: { mode?: DialogSelectFileMode; onOpenFil | 449 | 449 | </div> | 450 | 450 | <Show when={item.updated}> | 451 | 451 | <span class="text-12-regular text-text-weak whitespace-nowrap ml-2"> | 452 | | - {getRelativeTime(new Date(item.updated!).toISOString())} | | 452 | + {getRelativeTime(new Date(item.updated!).toISOString(), language.t)} | 453 | 453 | </span> | 454 | 454 | </Show> | 455 | 455 | </div> | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/session/session-header.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -430,7 +430,7 @@ export function SessionHeader() { | 430 | 430 | <Spinner class="size-3.5 text-icon-base" /> | 431 | 431 | </Show> | 432 | 432 | </div> | 433 | | - <span class="text-12-regular text-text-strong">Open</span> | | 433 | + <span class="text-12-regular text-text-strong">{language.t("common.open")}</span> | 434 | 434 | </Button> | 435 | 435 | <div class="self-stretch w-px bg-border-weak-base" /> | 436 | 436 | <DropdownMenu | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/components/settings-providers.tsx +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -162,7 +162,7 @@ export const SettingsProviders: Component = () => { | 162 | 162 | when={canDisconnect(item)} | 163 | 163 | fallback={ | 164 | 164 | <span class="text-14-regular text-text-base opacity-0 group-hover:opacity-100 transition-opacity duration-200 pr-3 cursor-default"> | 165 | | - Connected from your environment variables | | 165 | + {language.t("settings.providers.connected.environmentDescription")} | 166 | 166 | </span> | 167 | 167 | } | 168 | 168 | > | @@ -229,10 +229,12 @@ export const SettingsProviders: Component = () => { | 229 | 229 | <div class="flex flex-col min-w-0"> | 230 | 230 | <div class="flex flex-wrap items-center gap-x-3 gap-y-1"> | 231 | 231 | <ProviderIcon id={icon("synthetic")} class="size-5 shrink-0 icon-strong-base" /> | 232 | | - <span class="text-14-medium text-text-strong">Custom provider</span> | | 232 | + <span class="text-14-medium text-text-strong">{language.t("provider.custom.title")}</span> | 233 | 233 | <Tag>{language.t("settings.providers.tag.custom")}</Tag> | 234 | 234 | </div> | 235 | | - <span class="text-12-regular text-text-weak pl-8">Add an OpenAI-compatible provider by base URL.</span> | | 235 | + <span class="text-12-regular text-text-weak pl-8"> | | 236 | + {language.t("settings.providers.custom.description")} | | 237 | + </span> | 236 | 238 | </div> | 237 | 239 | <Button | 238 | 240 | size="large" | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/context/global-sync.tsx +9-1Lines changed: 9 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -204,7 +204,10 @@ function createGlobalSync() { | 204 | 204 | showToast({ | 205 | 205 | variant: "error", | 206 | 206 | title: language.t("toast.session.listFailed.title", { project }), | 207 | | - description: formatServerError(err), | | 207 | + description: formatServerError(err, { | | 208 | + unknown: language.t("error.chain.unknown"), | | 209 | + invalidConfiguration: language.t("error.server.invalidConfiguration"), | | 210 | + }), | 208 | 211 | }) | 209 | 212 | }) | 210 | 213 |
| @@ -234,6 +237,8 @@ function createGlobalSync() { | 234 | 237 | setStore: child[1], | 235 | 238 | vcsCache: cache, | 236 | 239 | loadSessions, | | 240 | + unknownError: language.t("error.chain.unknown"), | | 241 | + invalidConfigurationError: language.t("error.server.invalidConfiguration"), | 237 | 242 | }) | 238 | 243 | })() | 239 | 244 |
| @@ -308,6 +313,9 @@ function createGlobalSync() { | 308 | 313 | url: globalSDK.url, | 309 | 314 | }), | 310 | 315 | requestFailedTitle: language.t("common.requestFailed"), | | 316 | + unknownError: language.t("error.chain.unknown"), | | 317 | + invalidConfigurationError: language.t("error.server.invalidConfiguration"), | | 318 | + formatMoreCount: (count) => language.t("common.moreCountSuffix", { count }), | 311 | 319 | setGlobalStore, | 312 | 320 | }) | 313 | 321 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/context/global-sync/bootstrap.ts +14-3Lines changed: 14 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,6 +36,9 @@ export async function bootstrapGlobal(input: { | 36 | 36 | connectErrorTitle: string | 37 | 37 | connectErrorDescription: string | 38 | 38 | requestFailedTitle: string | | 39 | + unknownError: string | | 40 | + invalidConfigurationError: string | | 41 | + formatMoreCount: (count: number) => string | 39 | 42 | setGlobalStore: SetStoreFunction<GlobalStore> | 40 | 43 | }) { | 41 | 44 | const health = await input.globalSDK.global | @@ -88,8 +91,11 @@ export async function bootstrapGlobal(input: { | 88 | 91 | const results = await Promise.allSettled(tasks) | 89 | 92 | const errors = results.filter((r): r is PromiseRejectedResult => r.status === "rejected").map((r) => r.reason) | 90 | 93 | if (errors.length) { | 91 | | - const message = errors[0] instanceof Error ? errors[0].message : String(errors[0]) | 92 | | - const more = errors.length > 1 ? ` (+${errors.length - 1} more)` : "" | | 94 | + const message = formatServerError(errors[0], { | | 95 | + unknown: input.unknownError, | | 96 | + invalidConfiguration: input.invalidConfigurationError, | | 97 | + }) | | 98 | + const more = errors.length > 1 ? input.formatMoreCount(errors.length - 1) : "" | 93 | 99 | showToast({ | 94 | 100 | variant: "error", | 95 | 101 | title: input.requestFailedTitle, | @@ -116,6 +122,8 @@ export async function bootstrapDirectory(input: { | 116 | 122 | setStore: SetStoreFunction<State> | 117 | 123 | vcsCache: VcsCache | 118 | 124 | loadSessions: (directory: string) => Promise<void> | void | | 125 | + unknownError: string | | 126 | + invalidConfigurationError: string | 119 | 127 | }) { | 120 | 128 | if (input.store.status !== "complete") input.setStore("status", "loading") | 121 | 129 |
| @@ -137,7 +145,10 @@ export async function bootstrapDirectory(input: { | 137 | 145 | showToast({ | 138 | 146 | variant: "error", | 139 | 147 | title: `Failed to reload ${project}`, | 140 | | - description: formatServerError(err), | | 148 | + description: formatServerError(err, { | | 149 | + unknown: input.unknownError, | | 150 | + invalidConfiguration: input.invalidConfigurationError, | | 151 | + }), | 141 | 152 | }) | 142 | 153 | input.setStore("status", "partial") | 143 | 154 | return | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/i18n/ar.ts +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -734,4 +734,18 @@ export const dict = { | 734 | 734 | "workspace.reset.archived.one": "ستتم أرشفة جلسة واحدة.", | 735 | 735 | "workspace.reset.archived.many": "ستتم أرشفة {{count}} جلسات.", | 736 | 736 | "workspace.reset.note": "سيؤدي هذا إلى إعادة تعيين مساحة العمل لتتطابق مع الفرع الافتراضي.", | | 737 | + "common.open": "فتح", | | 738 | + "dialog.releaseNotes.action.getStarted": "البدء", | | 739 | + "dialog.releaseNotes.action.next": "التالي", | | 740 | + "dialog.releaseNotes.action.hideFuture": "عدم إظهار هذا في المستقبل", | | 741 | + "dialog.releaseNotes.media.alt": "معاينة الإصدار", | | 742 | + "toast.project.reloadFailed.title": "فشل في إعادة تحميل {{project}}", | | 743 | + "error.server.invalidConfiguration": "تكوين غير صالح", | | 744 | + "common.moreCountSuffix": " (+{{count}} إضافي)", | | 745 | + "common.time.justNow": "الآن", | | 746 | + "common.time.minutesAgo.short": "قبل {{count}} د", | | 747 | + "common.time.hoursAgo.short": "قبل {{count}} س", | | 748 | + "common.time.daysAgo.short": "قبل {{count}} ي", | | 749 | + "settings.providers.connected.environmentDescription": "متصل من متغيرات البيئة الخاصة بك", | | 750 | + "settings.providers.custom.description": "أضف مزود متوافق مع OpenAI بواسطة عنوان URL الأساسي.", | 737 | 751 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/i18n/br.ts +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -742,4 +742,18 @@ export const dict = { | 742 | 742 | "workspace.reset.archived.one": "1 sessão será arquivada.", | 743 | 743 | "workspace.reset.archived.many": "{{count}} sessões serão arquivadas.", | 744 | 744 | "workspace.reset.note": "Isso redefinirá o espaço de trabalho para corresponder ao branch padrão.", | | 745 | + "common.open": "Abrir", | | 746 | + "dialog.releaseNotes.action.getStarted": "Começar", | | 747 | + "dialog.releaseNotes.action.next": "Próximo", | | 748 | + "dialog.releaseNotes.action.hideFuture": "Não mostrar isso no futuro", | | 749 | + "dialog.releaseNotes.media.alt": "Prévia do lançamento", | | 750 | + "toast.project.reloadFailed.title": "Falha ao recarregar {{project}}", | | 751 | + "error.server.invalidConfiguration": "Configuração inválida", | | 752 | + "common.moreCountSuffix": " (+{{count}} mais)", | | 753 | + "common.time.justNow": "Agora mesmo", | | 754 | + "common.time.minutesAgo.short": "{{count}}m atrás", | | 755 | + "common.time.hoursAgo.short": "{{count}}h atrás", | | 756 | + "common.time.daysAgo.short": "{{count}}d atrás", | | 757 | + "settings.providers.connected.environmentDescription": "Conectado a partir de suas variáveis de ambiente", | | 758 | + "settings.providers.custom.description": "Adicionar um provedor compatível com a OpenAI através do URL base.", | 745 | 759 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/i18n/bs.ts +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -819,4 +819,18 @@ export const dict = { | 819 | 819 | "workspace.reset.archived.one": "1 sesija će biti arhivirana.", | 820 | 820 | "workspace.reset.archived.many": "Biće arhivirano {{count}} sesija.", | 821 | 821 | "workspace.reset.note": "Ovo će resetovati radni prostor da odgovara podrazumijevanoj grani.", | | 822 | + "common.open": "Otvori", | | 823 | + "dialog.releaseNotes.action.getStarted": "Započni", | | 824 | + "dialog.releaseNotes.action.next": "Sljedeće", | | 825 | + "dialog.releaseNotes.action.hideFuture": "Ne prikazuj ovo u budućnosti", | | 826 | + "dialog.releaseNotes.media.alt": "Pregled izdanja", | | 827 | + "toast.project.reloadFailed.title": "Nije uspjelo ponovno učitavanje {{project}}", | | 828 | + "error.server.invalidConfiguration": "Nevažeća konfiguracija", | | 829 | + "common.moreCountSuffix": " (+{{count}} više)", | | 830 | + "common.time.justNow": "Upravo sada", | | 831 | + "common.time.minutesAgo.short": "prije {{count}} min", | | 832 | + "common.time.hoursAgo.short": "prije {{count}} h", | | 833 | + "common.time.daysAgo.short": "prije {{count}} d", | | 834 | + "settings.providers.connected.environmentDescription": "Povezano sa vašim varijablama okruženja", | | 835 | + "settings.providers.custom.description": "Dodajte provajdera kompatibilnog s OpenAI putem osnovnog URL-a.", | 822 | 836 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/app/src/i18n/da.ts +14Lines changed: 14 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -813,4 +813,18 @@ export const dict = { | 813 | 813 | "workspace.reset.archived.one": "1 session vil blive arkiveret.", | 814 | 814 | "workspace.reset.archived.many": "{{count}} sessioner vil blive arkiveret.", | 815 | 815 | "workspace.reset.note": "Dette vil nulstille arbejdsområdet til at matche hovedgrenen.", | | 816 | + "common.open": "Åbn", | | 817 | + "dialog.releaseNotes.action.getStarted": "Kom i gang", | | 818 | + "dialog.releaseNotes.action.next": "Næste", | | 819 | + "dialog.releaseNotes.action.hideFuture": "Vis ikke disse i fremtiden", | | 820 | + "dialog.releaseNotes.media.alt": "Forhåndsvisning af udgivelse", | | 821 | + "toast.project.reloadFailed.title": "Kunne ikke genindlæse {{project}}", | | 822 | + "error.server.invalidConfiguration": "Ugyldig konfiguration", | | 823 | + "common.moreCountSuffix": " (+{{count}} mere)", | | 824 | + "common.time.justNow": "Lige nu", | | 825 | + "common.time.minutesAgo.short": "{{count}}m siden", | | 826 | + "common.time.hoursAgo.short": "{{count}}t siden", | | 827 | + "common.time.daysAgo.short": "{{count}}d siden", | | 828 | + "settings.providers.connected.environmentDescription": "Tilsluttet fra dine miljøvariabler", | | 829 | + "settings.providers.custom.description": "Tilføj en OpenAI-kompatibel udbyder via basis-URL.", | 816 | 830 | } |
|