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: config i18n and language control #85

Merged
merged 5 commits into from
Jul 31, 2023

Conversation

vnscosta
Copy link
Contributor

📝 Description

This pull request addresses issue #77, a suggestion about implementing i18n with JSON string texts.
The translation detects the browser language and starts with it or if have ?lng=en on params for example.

🛠️ Changes made

  • Added a new library for translation react-i18next and configure it.
  • Created initial translate files for en-US and pt-BR.
  • Modified existing component of Toolbar to use the translation.

🧪 Testing

  • Added unit tests to ensure the correct change of language on LanguageComponent.
  • Adjust Toolbar tests for support i18n, not more using getByText.

📸 Screenshots

Untitled

ℹ️ Additional notes

  • We should encourage to contributors add translations and take care of patterns on JSON files.
  • On the tests I have to change some things that are with getByText, we should pay attention when creating more translations like this one.
  • I won't translate all the things because I want to know what you guys think about this pattern. Any suggestions? We should already deploy this? @hellomuthu23 @johnfelipe

Copy link
Owner

@hellomuthu23 hellomuthu23 left a comment

Choose a reason for hiding this comment

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

nice work @vnscosta . LGTM!.

@hellomuthu23 hellomuthu23 merged commit 08ba26c into hellomuthu23:master Jul 31, 2023
1 of 2 checks passed
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.

None yet

2 participants