Magic Translate vs. react-intl
react-intl is part of FormatJS. It formats messages, dates and numbers with the ICU message syntax, and you supply the translations for each language. Magic Translate translates the text in your components directly, so you don't write or maintain any translations.
At a glance
| Magic Translate | react-intl | |
|---|---|---|
| How you write text | Your own words, wrapped in <T> | <FormattedMessage> with an id and a default message |
| Translations | Machine translation, created automatically | You extract messages and have them translated |
| Message files | None | One file per language |
| Dates and numbers | Use the browser's Intl APIs | Built-in components and ICU syntax |
| Server rendering | React Server Components and Next.js | Yes, with extra setup |
| Price | Free plan, then monthly plans based on usage | Open source and free |
How the code differs
With react-intl, each message has an id, and the translations live in separate files:
import { FormattedMessage } from 'react-intl';const Welcome = () => (<FormattedMessage id="home.welcome" defaultMessage="Welcome back!" />);// Then extract the messages, translate them for every language// and load the right file when the app starts.
With Magic Translate, you write the message once:
import { T } from '@magic-translate/react';const Welcome = () => <T>Welcome back!</T>;
When to choose Magic Translate
- You want your app in many languages without a translation workflow.
- Your texts change often, and you want every language to stay up to date.
- You want new languages without paying for or waiting on translators.
When to choose react-intl
- You need ICU message syntax for complex plurals and gender.
- Your translations must be written or reviewed by people.
- You want a free, open-source library with no external service.
Using both
The two work well together. Use react-intl or the Intl APIs to format dates, numbers and currencies, and Magic Translate to translate the text around them.
Ready to try it? Follow the getting started guide to translate your first component in five minutes.