Skip to content

fix(i18n): highlight the detected language before the first pick - #15

Merged
ghostcoder42 merged 1 commit into
mainfrom
fix/language-selector-default
Oct 14, 2026
Merged

ghostcoder42 merged 1 commit into
mainfrom
fix/language-selector-default

Conversation

@ghostcoder42

Copy link
Copy Markdown
Owner

The bootstrap (detectLanguage in index) maps the device locale to an app language — including the zh vs zh-TW script split — but the settings selector read only the stored preference, so on a fresh install nothing was highlighted until the user picked a language. The selector now falls back to i18n.language — what is actually being rendered — so the highlighted pill and the rendered language can never disagree.

The bootstrap (detectLanguage in index) maps the device locale to an app
language — including the zh vs zh-TW script split — but the settings
selector read only the stored preference, so on a fresh install nothing
was highlighted until the user picked a language. The selector now
falls back to i18n.language — what is actually being rendered — so the
highlighted pill and the rendered language can never disagree.
@github-actions

Copy link
Copy Markdown

💯 Test Coverage

Lines Statements Branches Functions
Coverage: 57%
56.57% (977/1727) 49.3% (532/1079) 47.03% (254/540)

😎 Tests Results

Tests Skipped Failures Errors Time
307 0 💤 0 ❌ 0 🔥 24.169s ⏱️
👀 Tests Details • (57%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files56.5749.347.0357.01 
src/lib/i18n91.6660.7110093.54 
   utils.tsx10083.3310010050–55

@ghostcoder42
ghostcoder42 merged commit 6c0945e into main Oct 14, 2026
1 check passed
@ghostcoder42
ghostcoder42 deleted the fix/language-selector-default branch October 14, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant