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
Improve i18n utility, add English fallbacks #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 16aebc8
Continually getting better for the i18n system translations 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK cc87b58
Attacked this a few times, it looks much better now and well continue to overhaul the i18n!
Abstract
This PR adds a well-needed cleanup to the way devs interface with the i18n system.
tr()
utility function, for in-line translations of strings with variables.This means a few small changes to how we previously used it, for ex:
Translating variables in-line is now super easy, i.e:
Alerts no longer have the additional
variables
param, devs are now expected to usetr()
in-line to translate alerts on-the-fly.Before
After
Previously, dynamic JS-selected translations would return
''
orundefined
to the user in the GUI, if the i18n keys were missing or unset for their language; with the English fallback, this is no longer the case, and users will never be presented with undefined or empty text now.Testing
To test this PR, it's suggested to attempt these user flows, or variations of these:
undefined
. (Send TXs, try causing errors, change settings, create a proposal on Testnet, etc).If any errors are found, the PR works unexpectedly, or you have viable suggestions to improve the UX or functionality of the PR, let me know!