react-i18next documentation
🏠 i18next🌐 localization as a service🎓 i18next crash course💾 GitHub Repository
  • Introduction
  • Getting started
  • Guides
    • Drawbacks of other i18n solutions
    • Quick start
    • Multiple Translation Files
    • Extracting translations
  • latest
    • Step by step guide
    • i18next instance
    • useTranslation (hook)
    • withTranslation (HOC)
    • Translation (render prop)
    • Trans Component
    • I18nextProvider
    • SSR (additional components)
    • Migrating v9 to v10
    • TypeScript
  • Misc
    • Using with ICU format
    • Using with fluent format
    • Testing
  • legacy v9
    • Step by step guide (v9)
    • Overview (v9)
    • i18next instance (v9)
    • I18nextProvider (v9)
    • withI18n (v9)
    • withNamespaces (v9)
    • NamespacesConsumer (v9)
    • Trans Component (v9)
    • Interpolate (v9)
    • SSR (v9)
  • 🌐localization as a service
  • 🎓i18next crash course
  • 💾GitHub Repository
Powered by GitBook
On this page
  • What is react-i18next?
  • What does my code look like
  • On top: Localization as a service

Introduction

Last updated 1 month ago

What is react-i18next?

react-i18next is a powerful internationalization framework for / which is based on . Check out the and .

You should read the documentation. The and translation functionalities like , , , ... are documented there.

The module provides multiple components eg. to assert that needed translations get loaded or that your content gets rendered when the language changes.

Learn once - translate everywhere.

What does my code look like

Before: Your React code would have looked something like:

...
<div>Just simple content</div>
<div>
  Hello <strong title="this is your name">{name}</strong>, you have {count} unread message(s). <Link to="/msgs">Go to messages</Link>.
</div>
...

After: With the Trans component just change it to:

...
<div>{t('simpleContent')}</div>
<Trans i18nKey="userMessagesUnread" count={count}>
  Hello <strong title={t('nameTitle')}>{{name}}</strong>, you have {{count}} unread message(s). <Link to="/msgs">Go to messages</Link>.
</Trans>
...

react-i18next is optimally suited for server-side rendering. It provides extra extension point to work with next.js, for e.g. .

As react-i18next depends on you can use it in any other UI framework and on the server-side (node.js, .net, ...) too. Like the React philosophy - just:

Check out and the corresponding about "Vite + React + TypeScript" with i18next.

you'll find a simple tutorial on how to best use react-i18next. Some basics of i18next and some cool possibilities on how to optimize your localization workflow.

Using Next.js? you'll find a blog post on how to best use with and SEO optimization.

Using Next.js with the new App Router? Then is what you are looking for!

Using Remix? you'll find a simple example and on how to best use remix-i18next.

Using Gatsby? you can find an example and an appropriate .

If you prefer not using semantic keys but text - .

On top:

i18next supports translation management tools such as .

you can find a step by step guide, which will unleash the full power of i18next in combination with locize. See how your developer experience with this localization workflow . There's also the possibility to have an , with the help of the and the use of the save missing keys functionality, new keys not only gets added to locize automatically, while developing the app, but are also into the target languages using machine translation (like ).

Learn more
i18next
this video
blog post
Here
next-i18next
client side translation download
Here
here a step by step tutorial
Here
blog post
that's also possible
Localization as a service
locize.com
Here
could look like
even more focused developer experience
auto-machinetranslation workflow
automatically translated
Google Translate
Learn more about the enterprise offering
React
React Native
i18next
history of i18next
when react-i18next was introduced
i18next
configuration options
plurals
formatting
interpolation
Here
this article