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
ℹ️ 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
📝 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
react-i18next
and configure it.en-US
andpt-BR
.Toolbar
to use the translation.🧪 Testing
LanguageComponent
.Toolbar
tests for support i18n, not more usinggetByText
.📸 Screenshots
ℹ️ Additional notes
getByText
, we should pay attention when creating more translations like this one.