![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
react-easy-intl
Advanced tools
React Intl made easy.
There are a couple big libraries to do i18n in React out there. I've had a hard time setting up both, I don't think it should be so complex.
So I've started baking this quick and dirty intl library based on messageformat.js with ICU support that simply gets the job done. Perhaps not in the best manner, but it fits my needs for a MVP that must be shipped quickly.
I haven't run any benchmark against this. Improvements and features will be missing.
Start installing the lib with yarn add react-easy-intl
or npm install --save react-easy-intl
.
Import the Globalize
static class in your main app file to initialise the messages dictionary and set your current locale:
import { Globalize } from 'react-easy-intl'
const messages = {
en: {
'Hi #name!': 'Hi {name}!',
'I have #qty books.': 'I have {qty, plural, =0{no books} one{1 book} other{# books} }.'
},
pt: {
'Hi #name!': 'Olá {name}!',
'I have #qty books.': 'Eu {qty, plural, =0{não tenho nenhum livro} one{tenho 1 livro} other{tenho # livros} }.'
}
}
Globalize.setMessages(messages)
Globalize.setLocale('en')
Import the FormatMessage
component to start rendering your translated strings:
import { FormatMessage } from 'react-easy-intl'
render () {
return <FormatMessage name='John Doe'>Hi #name!</FormatMessage>
}
render () {
return <FormatMessage qty={100}>I have #qty books.</FormatMessage>
}
Any help is appreciated on improving this library. There's a lot of room for improvement, such as better messages loading, number and currency formatting, possible support to state management with Redux, etc.
This is just the beginning. Feel free to contribute by opening issues with critiques or suggestions, or by sending pull requests.
MIT.
FAQs
React Intl made easy.
The npm package react-easy-intl receives a total of 1 weekly downloads. As such, react-easy-intl popularity was classified as not popular.
We found that react-easy-intl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.