fix(i18n): banner/push language follows the device's saved choice #113
Reference in New Issue
Block a user
Delete Branch "feature/banner-language-sync"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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) leavespreferred_languagestale, so the banner — and pushes — stay in the wrong language until a Settings change rewrites it. The Settings toggle worked only because itsen→rustep finally persistedpreferred_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.