Localize sync server error codes

This commit is contained in:
2026-07-17 05:09:59 +08:00
parent 126d90cd68
commit 1bcad23b58
3 changed files with 23 additions and 0 deletions
@@ -31,6 +31,9 @@
function reportError(key, fallback, error) {
console.warn('[verstak.sync] operation failed:', error)
const code = String(error?.message || error || '').match(/sync-server:([a-z_]+)/)?.[1]
const localized = code ? tr(`ui.serverError.${code}`, null, '') : ''
if (localized && localized !== `ui.serverError.${code}`) return localized
return tr(key, null, fallback)
}