[wallet/symbol/mobile] fix: localization mess - #2571
Open
OlegMakarenko wants to merge 9 commits into
Open
OlegMakarenko wants to merge 9 commits into
OlegMakarenko wants to merge 9 commits into
Conversation
…zation keys to follow guidelines
OlegMakarenko
force-pushed
the
wallet/locale
branch
from
September 18, 2026 15:14
b8088a7 to
84c8343
Compare
OlegMakarenko
marked this pull request as ready for review
September 18, 2026 15:16
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.
Problem
English (
en.json) is the only locale file that feeds the UI with up-to-date text, and it degraded over time:Solution
1. Localization guidelines
Researched, finalized and committed as
wallet/symbol/mobile/docs/localization.md. The core rules:_, camelCase inside a segment.<element>_<name>[_<element>[_<name>]], at most 7 segments in total.<element>_<name>…button_okscreen_<folder>[_<section>]_…screen_bridge_swap_dialog_confirm_titlecomponent_<componentName>_…component_navigationMenu_tab_homebutton,dialog,title,fieldTitle,errorMessage, …); names are free camelCase words chosen by meaning.%{name}.2. en.json cleanup
3. Mapper functions (
src/utils/localization.js)getErrorMessageLocaleKey(code)maps error codes to those keys — no more raw code strings passed to the translation function. Unknown codes fall back to a generic message.getTransactionTypeLocaleKey(type, chainName, direction)maps the raw chain-specific numeric descriptors to human-readable locale keys (andgetReceiptTypeLocaleKeydoes the same for receipt types).4. Test system enforcing the guidelines (3 files)
__tests__/localization/en-json.test.jssrc/screensandsrc/componentsdirectories and rejects keys pointing to a screen or component that does not exist.__tests__/localization/translations.test.jsen.json, no extra keys, and the same key order. A registry check ensures every file in the locales directory is consciously listed.__tests__/utils/localization.test.jsen.jsonkey.5. Usage updates
The other locale files (
cn/ja/ko/uk/zh) are kept temporarily to reuse texts from; they will be rewritten from scratch separately and added to the consistency test one by one as they land.