-
Notifications
You must be signed in to change notification settings - Fork 133
Replace i18n-webpack-plugin with react-i18next #77
Comments
Hi @Nate0001 , I agree with you probably it'd be better move to a library like i18next. But there is the next issue: How is it good for performance? If I understand correctly this lib replace text in runtime. So it requires additional time to render the page. Anyway react-i18next probably will be used in next release, because current dist folder structure might be too complicated for users. |
If you follow the best practices, performance hits are very minor. With the current library, you can only select the language during webpack build. This makes having translations pretty useless as they can't be changed on the fly. |
I use similar i18n technique in the side-project and it works well, but I agree with you because it requires some additional code. I reviewed react-i18next, probably it'd be added, but I still search for alternatives. |
What do you think about react-intl? @Nate0001 |
react-intl looks like something to be used alongside an i18n library, right? So you can get plurals, numbers, dates, etc formatted correctly. I've used the FormatJS library that react-intl uses. It's a nice library. Looks like i18next make it easy to plugin for number formating, interpolation, passing in objects, etc. I think the biggest benefit is there's a caching plugin. |
React-intl is a complex i18n library, but react-i18next seems easier to integrate and has a simple API. So I'm going to integrate react-i18next. |
There is also https://github.com/oklas/intl-webpack-plugin |
|
I'm submitting a ...
Feature Request:
Is feature important in common use cases?
Yes as i18n is already implemented in a fashion.
Describe requested feature:
The current i18n library is webpack based and can only display the language it was built with. The react-i18next library is one of the most robust i18n libraries for react. The benefit is that this allows the language to be detected from the browser and also changed on the fly.
https://github.com/i18next/react-i18next
The text was updated successfully, but these errors were encountered: