-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
i18n library #1447
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
Comments
Two more possible choices
Couple of links for comparison:(Metrics and community size) (https://npmcompare.com/compare/i18n-react,react-i18next,react-intl,react-intl-redux) DisclaimerI'm tempted to use react-i18next, what do you think? |
This list of considerations is really good! I have a few things to think about too: Works in node.js Let's keep in mind we might also want to translate things on the server. For example, we send out account emails so it'd be nice if these could be translated in future. This isn't a dealbreaker as we might find another way of translating these. But would be good to have in the list of the pros/cons. Async loading Number formatting Pluralisation Bundle size, Browser support, Intl API It's important that we understand how large the library's bundle size. This is an important feature, so we can consider up the extra page weight against features the library provides. Which web browsers does the library support? It's important that it works for Many web browsers now have a built-in Internationalisation API so a library that uses this if it's available might be smaller? Unicode / string concatenation
Can you explain a little more about what these two mean? I'm not sure I understand. Thanks :-D |
It'd be great to see a list of pros/cons for a few of the most promising libraries to help us reach a decision! The "i18n frameworks — the unfair showdown" article you linked to is from 2016 and I think the libraries have all had updates in the meantime. For example, I used react-intl a couple of years ago and the main issues at the time seem to have been addressed: Owned by Yahoo so wasn't being updated It seems to now be under active development again. Accessing the translator function within the component required using a Higher Order Component This resulted in quite convoluted code and was difficult to use. But now I see they have a useIntl() hook so this is no longer an issue. |
PROS React-i18next
React-Intl
CONS React-i18next
React-Intl
Consideration Node.js Browse detection Async loading Translation files
Approach Once there, we will be using one of the several backends available according if we stick to this solution, use the filesystem, store the data in mongo or even use a service provider as locize (https://locize.com/?lng=en.) to retrieve the translation. These backends can provide async loading capabilities, in my current development branch I am using Size
Important things
|
Thanks for doing such thorough research into the options. It seems like react-18next has a lot of documentation and different helper libraries that we can use.
Looking into it a bit more, it seems that react-i18next doesn't do date formatting at all? They defer to a 3rd party library. We use date-fns in the Editor so would be good to figure out how that would work.
This is absolutely fine. Having the translations in the git repo as JSON makes it much easier for others to contribute. |
Nature of issue?
New feature request / Request For Comments
New feature details:
As a new feature request, the Internationalization of the web editor and in particular, its localization in Latin american Spanish (see #1434) depends in choosing a i18n library.
Currently, there is no library included in the web editor, and while p5 website is using one, maybe it is better to move to another library given the current stack.
I propose the following libraries.
Possible choices
Extending the discussion about two possible libraries mentioned in #595 the possible choices are:
Considerations
The text was updated successfully, but these errors were encountered: