feat(i18n): localize the app into 13 languages - #18
Merged
Conversation
…backup, sheets) Adds a typed i18n module: src/i18n with an English master catalog (Strings = typeof en) and 12 full translations - de, fr, es, it, pt, ja, ko, nl, ru, zh-Hans, zh-Hant - each typed as Strings so the compiler rejects any missing key or wrong parameter arity. Parameterized strings are plain functions (correct pluralization per language, including Russian three-form plurals; CJK languages drop the singular branch). Locale resolution uses expo-localization once at startup, with a lazy require so a missing native module degrades to English instead of crashing. The Chinese branch resolves by script code first (region is only a fallback via languageRegionCode) so a Simplified-Chinese user with a TW/HK/MO device region is not misrouted to Traditional. All user-facing strings outside the editor now come from the catalog: library and folder screens, note/folder menus and dialogs, onboarding (including the backup slide), backup status lines and alerts, support and community sheets, and relative timestamps. The editor screen is the follow-up PR. Verified on iPad simulator with device language set to German (native rebuild with the ExpoLocalization pod); typecheck and all 43 tests pass; Metro export bundles. Claude-Session: https://claude.ai/code/session_01YM3PBapEXHwuXY97Bibsqk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
App-side i18n (PR A of 2 — do not merge B before this)
New
src/i18n/module:Strings = typeof en— every other locale file is typed asStrings, so a missing key or wrong function arity in ANY translation is a compile error, not a runtime surprise.requirein try/catch — a missing native module (old binary, tests) degrades to English instead of crashing (hit exactly this on the simulator before the rebuild). Chinese resolves by script code first; region only as fallback, so a zh-Hans user with device region TW isn't misrouted (review-caught bug).Everything outside the editor is localized: library + folder screens, all dialogs and menus, onboarding (incl. the backup slide), backup status/alerts/restore flow, support + community sheets, relative timestamps. Editor strings + the 1.3 (build 10) bump come in PR B, stacked on this branch.
Verification
Note: adds the expo-localization pod — needs a native rebuild after merge (
pod installalready reflected in Podfile.lock).https://claude.ai/code/session_01YM3PBapEXHwuXY97Bibsqk