Internationalization with ReactJS and i18n

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • next-i18next

    The easiest way to translate your NextJs apps.

  • Choose the correct package or library for React/next i18n, in this case as recommendation use i18next https://www.i18next.com/ and https://github.com/isaachinman/next-i18next for nextJS

  • i18next-browser-languageDetector

    language detector used in browser environment for i18next

  • import i18n from "i18next"; import { initReactI18next } from "react-i18next"; import LanguageDetector from "i18next-browser-languagedetector"; i18n // detect user language // learn more: https://github.com/i18next/i18next-browser-languageDetector .use(LanguageDetector) // pass the i18n instance to react-i18next. .use(initReactI18next) // init i18next // for all options read: https://www.i18next.com/overview/configuration-options .init({ debug: true, fallbackLng: "en", interpolation: { escapeValue: false, // not needed for react as it escapes by default }, resources: { en: { translation: { title: "i18n React project", english: "English", spanish: "Spanish", }, }, es: { translation: { title: "Proyecto i18n en React", english: "Ingles", spanish: "Español", }, }, }, }); export default i18n;

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • i18next

    i18next: learn once - translate everywhere

  • import i18n from "i18next"; import { initReactI18next } from "react-i18next"; import LanguageDetector from "i18next-browser-languagedetector"; i18n // detect user language // learn more: https://github.com/i18next/i18next-browser-languageDetector .use(LanguageDetector) // pass the i18n instance to react-i18next. .use(initReactI18next) // init i18next // for all options read: https://www.i18next.com/overview/configuration-options .init({ debug: true, fallbackLng: "en", interpolation: { escapeValue: false, // not needed for react as it escapes by default }, resources: { en: { translation: { title: "i18n React project", english: "English", spanish: "Spanish", }, }, es: { translation: { title: "Proyecto i18n en React", english: "Ingles", spanish: "Español", }, }, }, }); export default i18n;

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts