mirror of
https://github.com/phantomptr/ps5upload.git
synced 2026-10-21 19:33:08 -05:00
formatLastSeen returned hard-coded English words ("today", "yesterday",
"N days ago") that were then substituted into the translated line
installed_playtime_line, so every non-English UI showed e.g. Spanish
"visto por ultima vez yesterday".
Format the day count with Intl.RelativeTimeFormat in the app language
(numeric: "auto"), so 0 / 1 days read as today / yesterday and their
equivalents in each locale (hoy / ayer / hace 5 dias, heute / gestern, ...).
This covers every shipped locale without new i18n keys.
- formatLastSeen takes an optional `locale` (default "en"), so existing
callers and the English output are unchanged. An invalid tag falls back
to the previous English strings.
- AppCard passes the active language from useLangStore.
- Tests: Spanish and German labels, and the invalid-tag fallback.
The "never" label (a title with play time but no last-seen timestamp) is
still English; it has no Intl equivalent and is left out of this change.
Not run locally: npm run validate / vitest / tsc / eslint (no Node toolchain
on the machine used). Intl outputs were checked in a browser console.