Localizely logo
  • Home
  • Getting started
  • How it works
  • Pricing
  • FAQ
Sign up

I18n questions

Common questions about React internationalization


  • How do I change the language in react-i18next?

    Call `i18n.changeLanguage('de')` on the `i18n` object that `useTranslation` returns. It returns a promise and every component using the hook re-renders. Persist the choice with i18next-browser-languagedetector or your own storage.

  • How do I pass variables into an i18next translation?

    Write the variable as `{{name}}` in the string and pass its value in the options object, `t('welcome', { name })`. In React set `interpolation.escapeValue` to `false`, use `count` for plurals, and `$t(key)` to nest another key.

  • How do I use a translated string in an input placeholder with react-intl?

    Use the imperative API. `FormattedMessage` renders a React element, but `placeholder`, `title`, `alt` and `aria-label` need plain strings, so call `useIntl()` and pass `intl.formatMessage({ id, defaultMessage })` to the attribute.

  • How to access current locale in React app using react-intl?

    Learn how to access the current locale in your React app using the useIntl hook from react-intl, and where the IntlProvider that supplies that locale is configured.

  • How to add a language switcher in a React app?

    Learn how to add a language switcher to your React app using the react-intl library for easy localization. Enhance user experience and make your app more accessible to a wider audience by allowing users to select their preferred language.

  • How to add a newline to a localization message in React?

    Learn how to add newlines to localization messages in React with this easy guide.

  • How to add HTML tags to a localization message in React?

    Learn how to add HTML tags to your localization messages in React to create more dynamic and engaging user experiences.

  • How to configure React app architecture to support localization?

    Learn how to configure your React app architecture to support localization with our easy-to-follow guide. Organize translations by language, separate code from translations, and check documentation from localization libraries for best practices.

  • How to do lazy loading of translations in React?

    Learn how to implement lazy loading of translations in your React application to improve performance and reduce initial loading time.

  • How to extract localization messages in React?

    Learn how to extract localization messages from your React app. Discover how popular libraries like react-intl and react-i18next can help streamline the process, and find out how to ensure your translatable messages are properly extracted for translation.

  • How to fix react-intl missing message error in React?

    Learn how to fix missing message errors in your React application that uses react-intl for localization. Understand why these errors occur and how they can help you identify missing messages. Discover how to use the onError prop on the IntlProvider component to change the way missing messages are handled.

  • How do I fix "You will need to pass in an i18next instance by using initReactI18next"?

    The warning means a component called `useTranslation` before `i18n.use(initReactI18next).init()` ran. Import your i18n setup module once at the app entry, before any component renders, or pass the instance with `I18nextProvider`.

  • How to format dates in React app?

    Learn how to properly format dates in React with the built-in JavaScript Intl object or third-party libraries like react-intl. Avoid confusion and improve the user experience with consistent date formatting across different languages and locales.

  • How to format numbers in React app?

    Learn how to properly format numbers in your React application for different languages and locales using the built-in JavaScript Intl object. Ensure your app is user-friendly and accessible for all with accurate number formatting.

  • How to implement localization in React?

    It all depends on what you need and which localization library you want to use. Currently, many libraries solve the localization problem in React very well. If you are not sure which one to choose, maybe npm trends, activities, and maintenance on GitHub repositories could be a good place to start.

  • How to localize React app that uses third party UI libraries like MS Fluent UI and Material UI?

    Learn how to localize your React app that uses third-party UI libraries like MS Fluent UI and Material UI. Discover why localization should not be tightly coupled with UI component libraries and how to use a localization library to manage your content separately.

  • How to programmatically set the language in a React app?

    Learn how to programmatically set the language in your React app using a localization library. Improve your user experience by reflecting the user's preferred language in your app's language settings.

  • How to set proper text direction in a localized React app?

    Learn how to set the proper text direction in your localized React app with our step-by-step guide. Ensure your app is accessible and usable for users who read right-to-left languages like Arabic and Hebrew.

  • How to use dynamic strings in a localization message in React?

    Learn how to use dynamic strings and placeholders in localized messages in React.

  • How to use localization messages in non-component code in React?

    Learn how to use localization messages in non-component code in React with popular libraries like react-intl.

  • How to use React context for internationalization?

    Learn how to use React Context for internationalization (i18n) in your React applications! Say goodbye to props drilling and easily access localization messages throughout your component tree.

  • React-intl vs React-i18next?

    Looking to internationalize your React application but not sure whether to use React-intl or React-i18next? Check out our recommendations for checking trends on NPM and activity on Github to help you choose the right library for your needs.

  • What is the best practice for storing multi-language text in a React app?

    Learn about the best practice for storing multi-language text in a React app. Keep localization messages independent of the code in separate files, such as en.json for English and de.json for German, to enable easy and efficient translation updates.

  • What should the workflow look like between developers and translators when localizing a React app?

    Learn how developers and translators can work together effectively to localize a React app. Find out about the workflow between the two teams, the importance of using a localization management tool, and how collaboration can ensure accurate and consistent translations.

  • Where to save preferred language in React app?

    Learn where to save the preferred language in your React app to avoid requiring users to set it each time they access the app. Discover how storing this information on the client or server side can impact accessibility across devices and browsers.

Localizely logo
About
Free tools
Boring stuff
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
Newsletter
Copyrights 2026 © Localizely