We're on the decision on where to go on localization in react.js, surely there are ways to doing localization, but what would be your recommendation?
I tried yahoo's react-intl but to no avail:
var ReactIntl = require('react-intl') // we did npm install react-intl
// somewhere in the react component
render: function() {
return (<div><ReactIntl.Number>{600}</ReactIntl.Number></div>);
}
gives the error: Cannot read property '_mockedReactClassConstructor' of undefined
spent few hours try to resolve this error, still can't resolve -> give up
I tried l20n by mozilla but not sure if it'll work with react.js
wondering what would you suggest for react.js localization, thanks!
Localization (also referred to as i10n) is the process of adapting the website/application to a specific locale/region. Translation of text is only one of several elements in the localization process. Translating a bunch of sentences might seem very easy and intuitive.
There are two ways to go at JavaScript localization: File-based: Meaning that you extract your content in the form of a file, upload it to the Translation Management System (TMS), translate the content, then download it from the TMS and upload it back to your app/website and deploy the changes.
Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for a specific region or language by translating text and adding locale-specific components.
in response to my question. we decided not to use yahoo's react-intl but use i18next instead. Considering using something more stable and popular for our production is important.
what you can do is to initialize i18next at the root of your page, and pass that down through props. Do use a state to prevent page rendering before i18next is initialized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With