summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context/global-sync
diff options
context:
space:
mode:
authorAdam <[email protected]>2026-03-13 06:48:38 -0500
committerGitHub <[email protected]>2026-03-13 06:48:38 -0500
commit05cb3c87ca387be41aceb5ccad978c6848a56f70 (patch)
tree2b592d2aa90d0fdb7ea72aa392507e2277b92ba5 /packages/app/src/context/global-sync
parent270cb0b8b4265ac0965ac8b94a58a3bca86fa558 (diff)
downloadopencode-05cb3c87ca387be41aceb5ccad978c6848a56f70.tar.gz
opencode-05cb3c87ca387be41aceb5ccad978c6848a56f70.zip
chore(app): i18n sync (#17283)
Diffstat (limited to 'packages/app/src/context/global-sync')
-rw-r--r--packages/app/src/context/global-sync/bootstrap.ts2
-rw-r--r--packages/app/src/context/global-sync/child-store.test.ts1
-rw-r--r--packages/app/src/context/global-sync/child-store.ts9
3 files changed, 7 insertions, 5 deletions
diff --git a/packages/app/src/context/global-sync/bootstrap.ts b/packages/app/src/context/global-sync/bootstrap.ts
index 8b1a3c48c..13494b7ad 100644
--- a/packages/app/src/context/global-sync/bootstrap.ts
+++ b/packages/app/src/context/global-sync/bootstrap.ts
@@ -139,7 +139,7 @@ export async function bootstrapDirectory(input: {
const project = getFilename(input.directory)
showToast({
variant: "error",
- title: `Failed to reload ${project}`,
+ title: input.translate("toast.project.reloadFailed.title", { project }),
description: formatServerError(err, input.translate),
})
input.setStore("status", "partial")
diff --git a/packages/app/src/context/global-sync/child-store.test.ts b/packages/app/src/context/global-sync/child-store.test.ts
index cec76ff87..eee763f16 100644
--- a/packages/app/src/context/global-sync/child-store.test.ts
+++ b/packages/app/src/context/global-sync/child-store.test.ts
@@ -21,6 +21,7 @@ describe("createChildStoreManager", () => {
isLoadingSessions: () => false,
onBootstrap() {},
onDispose() {},
+ translate: (key) => key,
})
Array.from({ length: 30 }, (_, index) => `/pinned-${index}`).forEach((directory) => {
diff --git a/packages/app/src/context/global-sync/child-store.ts b/packages/app/src/context/global-sync/child-store.ts
index e2ada244f..d5904c609 100644
--- a/packages/app/src/context/global-sync/child-store.ts
+++ b/packages/app/src/context/global-sync/child-store.ts
@@ -21,6 +21,7 @@ export function createChildStoreManager(input: {
isLoadingSessions: (directory: string) => boolean
onBootstrap: (directory: string) => void
onDispose: (directory: string) => void
+ translate: (key: string, vars?: Record<string, string | number>) => string
}) {
const children: Record<string, [Store<State>, SetStoreFunction<State>]> = {}
const vcsCache = new Map<string, VcsCache>()
@@ -129,7 +130,7 @@ export function createChildStoreManager(input: {
createStore({ value: undefined as VcsInfo | undefined }),
),
)
- if (!vcs) throw new Error("Failed to create persisted cache")
+ if (!vcs) throw new Error(input.translate("error.childStore.persistedCacheCreateFailed"))
const vcsStore = vcs[0]
vcsCache.set(directory, { store: vcsStore, setStore: vcs[1], ready: vcs[3] })
@@ -139,7 +140,7 @@ export function createChildStoreManager(input: {
createStore({ value: undefined as ProjectMeta | undefined }),
),
)
- if (!meta) throw new Error("Failed to create persisted project metadata")
+ if (!meta) throw new Error(input.translate("error.childStore.persistedProjectMetadataCreateFailed"))
metaCache.set(directory, { store: meta[0], setStore: meta[1], ready: meta[3] })
const icon = runWithOwner(input.owner, () =>
@@ -148,7 +149,7 @@ export function createChildStoreManager(input: {
createStore({ value: undefined as string | undefined }),
),
)
- if (!icon) throw new Error("Failed to create persisted project icon")
+ if (!icon) throw new Error(input.translate("error.childStore.persistedProjectIconCreateFailed"))
iconCache.set(directory, { store: icon[0], setStore: icon[1], ready: icon[3] })
const init = () =>
@@ -211,7 +212,7 @@ export function createChildStoreManager(input: {
}
mark(directory)
const childStore = children[directory]
- if (!childStore) throw new Error("Failed to create store")
+ if (!childStore) throw new Error(input.translate("error.childStore.storeCreateFailed"))
return childStore
}