New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localize strings #426
Merged
Merged
Localize strings #426
Conversation
This file contains 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
oshorefueled
suggested changes
May 24, 2021
oshorefueled
approved these changes
May 25, 2021
song50119
pushed a commit
to song50119/godcr
that referenced
this pull request
May 29, 2021
* Add key value string parser and add localizable strings * Move all overview page text to localized strings * Add Chinese translation with fallback support to other languages * Add french translation * Move statically typed strings from transactions page to strings file * Move statically typed strings from wallet page to strings file * Add setting to switch app language * Move statically typed strings from settings page to strings file * Add ListPreference and use ListPreference to handle language preference setup * Use ListPreference to handle exchange preference setup * settings: update language config after confirm button is pressed
song50119
pushed a commit
to song50119/godcr
that referenced
this pull request
Apr 24, 2022
* Add key value string parser and add localizable strings * Move all overview page text to localized strings * Add Chinese translation with fallback support to other languages * Add french translation * Move statically typed strings from transactions page to strings file * Move statically typed strings from wallet page to strings file * Add setting to switch app language * Move statically typed strings from settings page to strings file * Add ListPreference and use ListPreference to handle language preference setup * Use ListPreference to handle exchange preference setup * settings: update language config after confirm button is pressed
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.
Closes #422
This pull request adds strings localization feature to the project which will enable strings to be translated to multiple languages. Currently, only a few pages have had their strings moved to strings file and only 2 translations have been added (French & Chinese). The
values.String(key)
function is used the get strings and the key is passed as a parameter, the function also handles falling back to the default language if a string is not available for the current language. There's also avalues.StringF(key, format...)
function used for getting strings that require formatting (e.g"Step %d/3"
).This pr also adds
ListPreference
for the handling of list settings and it's currently being used to implement the exchange rate and language settings. ThisListPreference
helps by taking away the entire UI logic for a list setting out of the settings page and handle showing/dismissing the modal when tapped.