fix(i18n): fix Telegram plugin raw keys, UI separator scaling and add ETA format unit tests - #266
Conversation
…, format ETA tests
tonhowtf
left a comment
There was a problem hiding this comment.
Thanks — the core diagnosis is exactly right, and I appreciate that you verified with check:i18n --strict. I reproduced everything locally: en.json now parses with a single 102-key telegram object, keys.ts matches the generator output byte-for-byte, all 69 tests pass, svelte-check is clean. The .separator collision is also real (primitives.css is global and applies height: 1px + scaleY(0.5) on 2dppx displays to anything with that class), so the rename to .or-divider is the right call.
Two changes before I can merge:
-
Restore the real translations instead of English placeholders. The 65 keys you re-added to the 9 locale files existed with full translations right up until #197 wiped them — e.g. pt had
"qr_title": "Escaneie para entrar", ru had"Сканируйте QR-код для входа". They're all recoverable withgit show 9a6abc8e^:src/lib/i18n/<locale>.json, and it's the exact same key set. As it stands the PR regresses 9 languages to English when the translations already exist in history. -
Revert the
.separator-textrestyle. The class rename fixes the bug; the rest (font-size: 11px,font-weight: 600, uppercase, letter-spacing,padding-inline) is a visual redesign that also breaks our convention of using CSS custom properties instead of hardcoded values. Please keepfont-size: var(--text-sm); font-weight: 500as before, and dropmargin-block: 4pxunless it fixes something concrete.
Smaller notes, non-blocking:
- The ETA-format extraction + tests are fine work, but they're a third topic in a
fix(i18n)PR. I'll take it this time; please split next time. download-format.tsisn't a store —src/lib/(next totime-ago.ts) is a better home thansrc/lib/stores/.- In the locale files the restored keys sit after the uploader keys, unlike en.json. Harmless, but if you regenerate via
scripts/sync-locales.mjswhile restoring translations it'll come out consistent.
Happy to merge once the translations are restored and the separator styling is back on tokens.
Address review feedback on tonhowtf#266. - Restore the 65 telegram keys that existed translated until tonhowtf#197 wiped them, recovered from 9a6abc8^ for all 9 non-en locales. The key set is identical and the en source text has not drifted, so the restore is lossless. Reorder the telegram object to match en.json key order. - Revert the .separator-text restyle to the previous token-based values. The .or-divider rename stays: it is what fixes the collision with the global .separator rule in primitives.css. - Move download-format.ts and its test out of stores/ to src/lib/, next to the other pure helpers.
|
Sorry for the trouble this PR caused. I should have checked the history before re-adding those keys. Thanks for taking the time to reproduce everything locally and to point me at the exact commit. Pushed 1. Translations restored. You were right that they were all recoverable — I pulled the 65 keys from
Some locales show fewer than 65 changed values (59–64) because a handful were already identical — entries like I also reordered the 2. Separator styling back on tokens. 3. Moved Verification after the changes: The warnings are all pre-existing (a11y/CSS under Two small things I wanted to flag rather than guess at:
And noted on splitting topics — the ETA extraction shouldn't have ridden along in a |
|
Merged. The restored translations check out against the pre-#197 history and the separator fix is down to exactly the class rename — thanks for turning it around fast and for taking the feedback well. Ships in the next release. |
Summary of Changes
"telegram"root object inen.jsonthat was overwriting 65 translation keys for the Telegram login QR screen and chat view.el,es,fr,it,ja,pt,ru,zh,zh-TW). Verified withpnpm check:i18n --strict..separatorcontainer to.or-dividerinsrc/routes/telegram/+page.svelteto prevent collision with globalprimitives.cssscaleY(0.5)rule on Retina/High-DPI displays.src/lib/stores/download-format.tsandsrc/lib/stores/download-format.test.tsfor ETA and download speed formatting tests (11/11 tests passing).Closes #264