fix(notifications): the English log formats its numbers in English; the ui/ contract sees msg() keys

A formatted value took the reader's language even when the notice was said in English for the
log. The platform-namespace contract matched only t("…"), so a domain key passed through msg()
in components/ui/ went unseen. Three comments pointed at localizeDetail's old home.
This commit is contained in:
2026-10-30 00:15:22 +01:00
parent b515c16117
commit 74f58ea001
6 changed files with 34 additions and 8 deletions
+4 -2
View File
@@ -42,8 +42,10 @@ export function sayNotif(text: NotifText, t: TFunction = i18n.t.bind(i18n)): str
function sayValue(v: NotifValue, t: TFunction): string | number {
if (typeof v !== "object") return v;
if ("number" in v) return formatNumber(v.number, i18n.language);
if ("bytes" in v) return formatBytes(v.bytes, i18n.language);
// In the language `t` speaks: a fixed one (the English log) names it, a component's follows i18n.
const lang = (t as { lng?: string }).lng ?? i18n.language;
if ("number" in v) return formatNumber(v.number, lang);
if ("bytes" in v) return formatBytes(v.bytes, lang);
return sayNotif(v, t);
}