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

Added i18n #105

Open
wants to merge 3 commits into
base: canary
Choose a base branch
from
Open

Added i18n #105

wants to merge 3 commits into from

Conversation

caioflores
Copy link

I added a i18n library (react-i18next) and created the base structure to make the internationalization.
I also updated almost all the texts to the new i18n pattern and translated the file to Brazilian Portuguese.
I also added i18n as a feature of the boilerplate.

Added react-i18next library for internationalization.
Created a i18n file to organize internationalization and added English and Brazilian Portuguese translations.
Added translation labels in almost all texts in the components.
@caioflores
Copy link
Author

@Neitsch the PR that you asked for! Tell me what you think.
There are some constants that were not translated, and I didn't created a option to change the language (we can use the browser's language).
I set up the translation options in the index.js file, I don't know if it's the best option.
All the components that needs translations will need to be exported using translate method (Ex: export default translate()(Feature);), I don't know any way that we can improve this.

@Neitsch
Copy link
Collaborator

Neitsch commented Oct 3, 2017

Hi Caio, thank you so much for the PR! I think instead of using translate()(...) we can wrap the top level component in a i18nProvider (https://react.i18next.com/components/i18nextprovider.html) and then get { t } from this.context. I'll give that a shot tomorrow. Other than that looks really good. Thank you!

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