diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts index 1f1d511e971..62ddb4fd581 100644 --- a/apps/desktop/src/i18n/en.ts +++ b/apps/desktop/src/i18n/en.ts @@ -1258,7 +1258,15 @@ export const en: Translations = { applyingClose: 'Hermes will close to apply the update.', errorTitle: 'Update didn’t finish', errorBody: 'No worries — nothing was lost. You can try again now.', - notNow: 'Not now' + notNow: 'Not now', + applyStatus: { + preparing: 'Updating backend…', + pulling: 'Backend updating…', + restarting: 'Backend restarting to load the update…', + notAvailable: 'Update not available for this backend.', + failed: 'Backend update failed.', + noReturn: 'Backend didn’t come back online. The update may not have completed — check the backend host.' + } }, install: { diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts index b1c944f30e1..f2f4f5effa4 100644 --- a/apps/desktop/src/i18n/ja.ts +++ b/apps/desktop/src/i18n/ja.ts @@ -1400,7 +1400,15 @@ export const ja = defineLocale({ applyingClose: 'Hermes は更新を適用するために閉じます。', errorTitle: '更新が完了しませんでした', errorBody: 'ご安心ください。何も失われていません。今すぐ再試行できます。', - notNow: '今は後で' + notNow: '今は後で', + applyStatus: { + preparing: 'バックエンドを更新しています…', + pulling: 'バックエンドを更新中…', + restarting: 'バックエンドが更新を読み込むため再起動しています…', + notAvailable: 'このバックエンドでは更新を利用できません。', + failed: 'バックエンドの更新に失敗しました。', + noReturn: 'バックエンドがオンラインに戻りませんでした。更新が完了していない可能性があります。バックエンドホストを確認してください。' + } }, install: { diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts index bc442951e37..55f0691b2e1 100644 --- a/apps/desktop/src/i18n/types.ts +++ b/apps/desktop/src/i18n/types.ts @@ -959,6 +959,14 @@ export interface Translations { errorTitle: string errorBody: string notNow: string + applyStatus: { + preparing: string + pulling: string + restarting: string + notAvailable: string + failed: string + noReturn: string + } } install: { diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts index c7b2018fd3e..0556540d5c6 100644 --- a/apps/desktop/src/i18n/zh-hant.ts +++ b/apps/desktop/src/i18n/zh-hant.ts @@ -1365,7 +1365,15 @@ export const zhHant = defineLocale({ applyingClose: 'Hermes 將關閉以套用更新。', errorTitle: '更新未完成', errorBody: '沒有資料遺失。您可以現在重試。', - notNow: '暫不' + notNow: '暫不', + applyStatus: { + preparing: '正在更新後端…', + pulling: '後端更新中…', + restarting: '後端正在重新啟動以載入更新…', + notAvailable: '此後端無法更新。', + failed: '後端更新失敗。', + noReturn: '後端未恢復連線。更新可能未完成——請檢查後端主機。' + } }, install: { diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts index 27c0b1840bc..e3610272696 100644 --- a/apps/desktop/src/i18n/zh.ts +++ b/apps/desktop/src/i18n/zh.ts @@ -1445,7 +1445,15 @@ export const zh: Translations = { applyingClose: 'Hermes 将关闭以应用更新。', errorTitle: '更新未完成', errorBody: '没有数据丢失。你可以现在重试。', - notNow: '暂不' + notNow: '暂不', + applyStatus: { + preparing: '正在更新后端…', + pulling: '后端更新中…', + restarting: '后端正在重启以加载更新…', + notAvailable: '此后端无法更新。', + failed: '后端更新失败。', + noReturn: '后端未恢复在线。更新可能未完成——请检查后端主机。' + } }, install: { diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts index 9365690a370..b3b05c1066f 100644 --- a/apps/desktop/src/store/updates.ts +++ b/apps/desktop/src/store/updates.ts @@ -336,7 +336,7 @@ function finishBackendApply(returned: boolean): DesktopUpdateApplyResult { applying: false, stage: 'error', error: 'apply-failed', - message: 'Backend didn’t come back online. The update may not have completed — check the backend host.' + message: translateNow('updates.applyStatus.noReturn') }) return { ok: false, error: 'apply-failed', message: 'Backend did not come back online.' } @@ -344,20 +344,20 @@ function finishBackendApply(returned: boolean): DesktopUpdateApplyResult { export async function applyBackendUpdate(): Promise { dismissNotification(UPDATE_TOAST_ID) - $backendUpdateApply.set({ ...IDLE, applying: true, stage: 'prepare', message: 'Updating backend…' }) + $backendUpdateApply.set({ ...IDLE, applying: true, stage: 'prepare', message: translateNow('updates.applyStatus.preparing') }) try { const started = await updateHermes() if (!started.ok) { - const message = (started as { message?: string }).message || 'Update not available for this backend.' + const message = (started as { message?: string }).message || translateNow('updates.applyStatus.notAvailable') const command = (started as { update_command?: string }).update_command || 'hermes update' $backendUpdateApply.set({ ...IDLE, applying: false, stage: 'manual', message, command }) return { ok: false, error: 'manual', manual: true, message, command } } - $backendUpdateApply.set({ ...IDLE, applying: true, stage: 'pull', message: 'Backend updating…' }) + $backendUpdateApply.set({ ...IDLE, applying: true, stage: 'pull', message: translateNow('updates.applyStatus.pulling') }) let last: Awaited> | null = null for (let attempt = 0; attempt < 30; attempt += 1) { @@ -370,7 +370,7 @@ export async function applyBackendUpdate(): Promise { ...$backendUpdateApply.get(), applying: true, stage: 'restart', - message: 'Backend restarting to load the update…' + message: translateNow('updates.applyStatus.restarting') }) return finishBackendApply(await waitForBackendReturn()) @@ -383,7 +383,7 @@ export async function applyBackendUpdate(): Promise { const ok = !!last && (last.exit_code ?? 1) === 0 if (ok) { - $backendUpdateApply.set({ ...$backendUpdateApply.get(), applying: true, stage: 'restart', message: 'Backend restarting to load the update…' }) + $backendUpdateApply.set({ ...$backendUpdateApply.get(), applying: true, stage: 'restart', message: translateNow('updates.applyStatus.restarting') }) return finishBackendApply(await waitForBackendReturn()) } @@ -393,7 +393,7 @@ export async function applyBackendUpdate(): Promise { applying: false, stage: 'error', error: 'apply-failed', - message: 'Backend update failed.' + message: translateNow('updates.applyStatus.failed') }) return { ok: false, error: 'apply-failed', message: 'Backend update failed.' }