Skip to content
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 14 commits into from May 25, 2021
Merged

Localize strings #426

merged 14 commits into from May 25, 2021

Conversation

beansgum
Copy link
Contributor

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 a values.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. This ListPreference 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.

ezgif com-video-to-gif-2

ui/preference/list_preference.go Show resolved Hide resolved
ui/preference/list_preference.go Show resolved Hide resolved
ui/preference/list_preference.go Outdated Show resolved Hide resolved
ui/preference/list_preference.go Show resolved Hide resolved
@oshorefueled oshorefueled merged commit 7406797 into planetdecred:master 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
@beansgum beansgum deleted the localizations branch June 1, 2021 07:16
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localize strings
2 participants