i18n(desktop): translate backend update apply status messages

Two independent reviewers flagged that applyBackendUpdate's in-progress and
error messages were inline English while the rest of the update overlay is
i18n'd. Move them into updates.applyStatus (preparing/pulling/restarting/
notAvailable/failed/noReturn) across en, ja, zh, zh-hant + types.
This commit is contained in:
yoniebans 2026-06-08 14:20:40 +02:00 committed by Teknium
parent b000e05b11
commit 74239b4942
6 changed files with 51 additions and 11 deletions

View file

@ -1258,7 +1258,15 @@ export const en: Translations = {
applyingClose: 'Hermes will close to apply the update.',
errorTitle: 'Update didnt 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 didnt come back online. The update may not have completed — check the backend host.'
}
},
install: {

View file

@ -1400,7 +1400,15 @@ export const ja = defineLocale({
applyingClose: 'Hermes は更新を適用するために閉じます。',
errorTitle: '更新が完了しませんでした',
errorBody: 'ご安心ください。何も失われていません。今すぐ再試行できます。',
notNow: '今は後で'
notNow: '今は後で',
applyStatus: {
preparing: 'バックエンドを更新しています…',
pulling: 'バックエンドを更新中…',
restarting: 'バックエンドが更新を読み込むため再起動しています…',
notAvailable: 'このバックエンドでは更新を利用できません。',
failed: 'バックエンドの更新に失敗しました。',
noReturn: 'バックエンドがオンラインに戻りませんでした。更新が完了していない可能性があります。バックエンドホストを確認してください。'
}
},
install: {

View file

@ -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: {

View file

@ -1365,7 +1365,15 @@ export const zhHant = defineLocale({
applyingClose: 'Hermes 將關閉以套用更新。',
errorTitle: '更新未完成',
errorBody: '沒有資料遺失。您可以現在重試。',
notNow: '暫不'
notNow: '暫不',
applyStatus: {
preparing: '正在更新後端…',
pulling: '後端更新中…',
restarting: '後端正在重新啟動以載入更新…',
notAvailable: '此後端無法更新。',
failed: '後端更新失敗。',
noReturn: '後端未恢復連線。更新可能未完成——請檢查後端主機。'
}
},
install: {

View file

@ -1445,7 +1445,15 @@ export const zh: Translations = {
applyingClose: 'Hermes 将关闭以应用更新。',
errorTitle: '更新未完成',
errorBody: '没有数据丢失。你可以现在重试。',
notNow: '暂不'
notNow: '暂不',
applyStatus: {
preparing: '正在更新后端…',
pulling: '后端更新中…',
restarting: '后端正在重启以加载更新…',
notAvailable: '此后端无法更新。',
failed: '后端更新失败。',
noReturn: '后端未恢复在线。更新可能未完成——请检查后端主机。'
}
},
install: {

View file

@ -336,7 +336,7 @@ function finishBackendApply(returned: boolean): DesktopUpdateApplyResult {
applying: false,
stage: 'error',
error: 'apply-failed',
message: 'Backend didnt 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<DesktopUpdateApplyResult> {
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<ReturnType<typeof getActionStatus>> | null = null
for (let attempt = 0; attempt < 30; attempt += 1) {
@ -370,7 +370,7 @@ export async function applyBackendUpdate(): Promise<DesktopUpdateApplyResult> {
...$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<DesktopUpdateApplyResult> {
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<DesktopUpdateApplyResult> {
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.' }