fix(i18n): banner/push language follows the device's saved choice #113

Merged
developer merged 1 commits from feature/banner-language-sync into development 2026-06-22 14:26:38 +00:00
Owner

Bug: open with an English system language but an in-app choice of Russian → UI Russian (correct, follows the device) but the banner runs English; toggling the language in Settings fixes it permanently.

Root cause: the UI language follows the device-local choice and is deliberately not overridden from the account (a ru-bot launch on an English system must stay English), but the banner and out-of-app push routing resolve server-side from preferred_language. A saved device choice the account never recorded (picked while a guest, or differing from the Telegram system-language seed) leaves preferred_language stale, so the banner — and pushes — stay in the wrong language until a Settings change rewrites it. The Settings toggle worked only because its en→ru step finally persisted preferred_language.

Fix: on profile load (adoptSession, and the in-place link path) reconcile — push the saved local choice to the account when it differs (languageNeedsServerSync; no-op for guests and when already equal). Banner + pushes now match the visible UI from the first open.

Pure helper extracted + unit-tested (node-env). check 0/0, unit 311/311, build OK.

**Bug:** open with an English system language but an in-app choice of Russian → UI Russian (correct, follows the device) but the **banner runs English**; toggling the language in Settings fixes it permanently. **Root cause:** the UI language follows the device-local choice and is deliberately not overridden from the account (a ru-bot launch on an English system must stay English), but the banner and out-of-app **push routing** resolve server-side from `preferred_language`. A saved device choice the account never recorded (picked while a guest, or differing from the Telegram system-language seed) leaves `preferred_language` stale, so the banner — and pushes — stay in the wrong language until a Settings change rewrites it. The Settings toggle worked only because its `en→ru` step finally persisted `preferred_language`. **Fix:** on profile load (`adoptSession`, and the in-place link path) reconcile — push the saved local choice to the account when it differs (`languageNeedsServerSync`; no-op for guests and when already equal). Banner + pushes now match the visible UI from the first open. Pure helper extracted + unit-tested (node-env). check 0/0, unit 311/311, build OK.
developer added 1 commit 2026-06-22 14:16:47 +00:00
fix(i18n): reconcile preferred_language with the device's saved language
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 53s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m18s
90f0424de2
The UI language follows the device (the local choice / system guess) and is
deliberately not overridden from the account, but the advertising banner and
out-of-app push routing are resolved server-side from preferred_language. A
saved device choice the account had not recorded — picked while a guest, or
differing from the Telegram system-language seed — left the banner (and pushes)
in the wrong language until a Settings change rewrote preferred_language.

On profile load (adoptSession and the in-place link path) push the saved local
choice to the account when it differs (new pure helper languageNeedsServerSync;
no-op for guests and when already equal), so the banner and pushes match the
visible UI from the first open. Unit-tested.
owner approved these changes 2026-06-22 14:26:03 +00:00
developer merged commit 08c2c5f660 into development 2026-06-22 14:26:38 +00:00
developer deleted branch feature/banner-language-sync 2026-06-22 14:26:38 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#113