Skip to main content
React Email supports react-i18next for internationalization. This guide shows how to convert an English React Email template to support multiple locales.

Prerequisites

To get the most out of this guide, you’ll need to:
This guide will use the following email template as a base.
emails/welcome.jsx

Internationalization with react-i18next

react-i18next is a library for internationalization and localization that provides a way to format messages in different languages.

1. Create messages for each locale

For each locale, create a new JSON file containing the content of the email in that locale.

2. Update the email props

Add the locale prop to the email template, interface, and test data.
emails/welcome.jsx

3. Setting up helpers

If you don’t already, go ahead and create a getT helper meant for getting translations on the server:
get-t.js
Where ./i18n is where you would have setup your i18next, for example:
i18n.js

4. Update the email template

In the email template, remove the hardcoded content and use getT’s t to format the email message strings.
emails/welcome.jsx

5. Update any email calls

When calling the email template, pass the locale prop to the email component.

Try it yourself

React Email with react-i18next example

See the full source code.

Resend with react-i18next example

See the full source code.