Skip to content

feat(ui): accept optional lng on YouVersionProvider (YPE-5119) - #344

Closed
Dustin-Kelley wants to merge 2 commits into
mainfrom
cursor/ype-5119-zh-locale-mapping-72f5
Closed

feat(ui): accept optional lng on YouVersionProvider (YPE-5119)#344
Dustin-Kelley wants to merge 2 commits into
mainfrom
cursor/ype-5119-zh-locale-mapping-72f5

Conversation

@Dustin-Kelley

@Dustin-Kelley Dustin-Kelley commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes YPE-5119. Unblocks YPE-4820 once Expo forwards its locale into the WebView; this web-only change does not fix that ticket by itself.

What was wrong

The React web SDK always set UI copy from navigator.languages. In Expo, Verse of the Day lives in a WebView whose browser language stays English, so locale="es" on the Expo provider never reached headings like verseOfTheDay.

What this does

  • Adds optional lng on the UI YouVersionProvider (BCP-47, e.g. es or es-MX)
  • When lng is set, skip navigator detection and use that language for bundled copy
  • Regional tags resolve to a bundled locale; unsupported tags fall back to English
  • No new platform-localization keys — existing Spanish verseOfTheDay is used as-is

Merged latest main (oxlint/TypeScript 7, localization sync, and related work).

Open in Web Open in Cursor 

@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ae2fd0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@youversion/platform-react-ui Minor
vite-react Patch
@youversion/platform-core Minor
@youversion/platform-react-hooks Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Hosts can set bundled UI copy instead of following the browser locale.
When lng is set, skip navigator language detection so Expo can pass its
provider locale through the WebView (YPE-5119, unblocks YPE-4820).
@cursor
cursor Bot force-pushed the cursor/ype-5119-zh-locale-mapping-72f5 branch from c954e39 to f856dc9 Compare August 19, 2026 20:19
@cursor cursor Bot changed the title fix(ui): map only Traditional Chinese tags to zh locale (YPE-5119) feat(ui): accept optional lng on YouVersionProvider (YPE-5119) Aug 19, 2026
Resolve YouVersionProvider test imports: keep main's context probe and this
branch's host lng coverage without mocking the hooks provider.
@Dustin-Kelley

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #345.

We do not need a second lng prop. #345 already has locale on YouVersionProvider (same Expo WebView problem as YPE-5119 / YPE-4820) plus defaultLanguageId on BibleReader.Root (YPE-4813). The Verse of the Day copy tests, regional-tag coverage, and host-language docs from this PR were folded into #345 under locale.

@Dustin-Kelley

Copy link
Copy Markdown
Collaborator Author

Superseded by #345.

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.

2 participants