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

feat: add supported languages to ConfigurationContext #14

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

fc-santos
Copy link

Summary of Changes

Currently, all wallets need to support the three languages configured in the bifold (English, French and Portuguese). The aim of this PR is to enable you to change the default languages, so that you can choose only those you want to support.

Related Issues

N/A

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this);
  • Updated LICENSE-3RD-PARTY.md for any added dependencies or vendored components;
  • Updated documentation as needed for changed code and new or modified features;
  • Added sufficient tests so that overall code coverage is not reduced.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated tests have passed.

PR template adapted from the Python attrs project.

Comment on lines 31 to 35
for (const pl of possibleLanguages) {
if (supportedLanguagesKeys.includes(pl.id)) {
languages.push(pl)
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aime mieux le filter je pense ? C'est plus clean que de faire un array vide qu'on ajoute ceux qu'on veut, non ?

fc-santos and others added 13 commits October 18, 2023 13:27
The ConfigurationContext still has a supportedLanguage prop that now is
of type Locales[].

It's also possible now pass a defaultLanguage (optional) in the initLanguage
function. It was always English by default before. The languages array in the
Language screen is not hardcoded anymore and in the Settings Screen the
currentLanguage doesn't use anymore the hardcoded languages array.

In the supportedLanguages prop from ConfigurationContext you can pass
the locales you want to support (ex: [Locales.en, Locales.fr])

Eventually it would be a nice feature to add where in the Settings
screen if the wallet you are working on supports only one language (ex:
Portuguese), it would make sense to not display in the App Setttins the
Language option to switch the (Only show the Biometrics and Change PIN).

Signed-off-by: fc-santos <[email protected]>
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.

2 participants