relay-fullstack icon indicating copy to clipboard operation
relay-fullstack copied to clipboard

Added i18n

Open caioflores opened this issue 7 years ago • 2 comments

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.

caioflores avatar Oct 03 '17 01:10 caioflores

@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.

caioflores avatar Oct 03 '17 01:10 caioflores

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!

Neitsch avatar Oct 03 '17 02:10 Neitsch