fix(notifications): a notice value is no plain string, so a translated name cannot freeze in one language
A name goes in as raw(), a translated word as its own msg(): tsc now lists every value, and the ones that froze are said when shown — Watch later and an untitled channel in the pin and channel notices, a Plex season's name in its removal toast (a new seasonTitleText, which seasonTitle says).
This commit is contained in:
@@ -13,9 +13,11 @@ import { log, type Level } from "./log";
|
||||
// the reader's language each time it is shown. The text a caller translated at raise time was kept
|
||||
// in the history, so a language switch left every notice in the language it was raised in. `raw` is
|
||||
// text that has no translation (a video's title, a name); `detail` is a server refusal, localized at
|
||||
// display like the key. `notify` takes nothing else, so a pre-translated string does not type-check.
|
||||
// display like the key. `notify` takes nothing else, and a value is no plain string either (a name
|
||||
// goes in as `raw`, a translated word as its own `msg`), so a pre-translated string does not
|
||||
// type-check anywhere in a notice — only `raw(t(…))` would say it once, and that reads as what it is.
|
||||
// A value is formatted when shown too: `{ number }` / `{ bytes }` group digits the reader's way.
|
||||
export type NotifValue = string | number | NotifText | { number: number } | { bytes: number };
|
||||
export type NotifValue = number | NotifText | { number: number } | { bytes: number };
|
||||
export type NotifText =
|
||||
| { key: string; values?: Readonly<Record<string, NotifValue>> }
|
||||
| { raw: string }
|
||||
|
||||
Reference in New Issue
Block a user