Skip to content

Added i18n#105

Open
caioflores wants to merge 3 commits intolvarayut:canaryfrom
caioflores:i18n
Open

Added i18n#105
caioflores wants to merge 3 commits intolvarayut:canaryfrom
caioflores:i18n

Conversation

@caioflores
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

2 participants