Skip to content
CAI
Software that uses CAICheck a score

i18next/react-i18next

63.6

Adequate · 15 November 2026

2.2k

lines of production code

JavaScript

with Swift

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add IcuTrans component and TypeScript definitions for ICU MessageFormat support

The library now exports \IcuTrans\ and \IcuTransWithoutContext\ components, providing a dedicated way to render ICU MessageFormat translations with full TypeScript support. These components accept an \i18nKey\, a \defaultTranslation\ string, and a \content\ declaration tree describing the React components to be rendered in place of numbered tags (e.g., \\<0\>\). This complements the existing \Trans\ component and the \icu.macro\ by offering a programmatic API for ICU formatting that integrates with the library's type system and context providers.

(repo-wide) · high confidence

Add Jest testing example for React i18next

The test-jest example now includes a complete set of source files and Jest tests demonstrating how to test React components using react-i18next. It covers various translation patterns including the useTranslation hook, withTranslation HOC, Translation component, and Trans component, along with examples of mocking the i18next backend for isolated unit tests.

example/test-jest/src · high confidence

Add Jest testing example for react-i18next with Vite

A new example application (\example/test-jest\) is introduced to demonstrate how to set up Jest testing for apps using react-i18next and Vite. This example includes configuration files for Jest (using jsdom environment and babel-jest) and Vite, along with a setup for mocking react-i18next via \src/\_\mocks\\_\ and registering testing-library matchers. It provides sample tests using @testing-library/react and includes localization files for English, German, and Swedish to illustrate language switching and pluralization in a test context.

example/test-jest · high confidence

Add Razzle SSR example with i18n support

The example/razzle-ssr/src directory now contains a complete React application demonstrating server-side rendering with i18next. This includes the main App and Home components using react-i18next hooks, client and server entry points for hydration and rendering, and an i18n configuration file that sets up the http-backend and language detection.

example/razzle-ssr/src · high confidence

Add Storybook example with locale switching

A new Storybook example has been added to the \example/storybook\ directory, demonstrating how to integrate \react-i18next\ with Storybook. This example includes a Storybook toolbar that allows users to switch the application locale between English, German, and Arabic, and provides stories for components using hooks, Higher-Order Components, and the \Trans\ component.

example/storybook · high confidence

Add locize integration example using Vite

A new example application has been added to demonstrate integration with locize. The project is built with Vite and React, featuring a configuration that loads translations via i18next-locize-backend, tracks key usage with locize-lastused, and enables in-context editing via the locize editor plugin. The example includes a UI with language switching and links to a step-by-step tutorial and video guides.

example/locize · high confidence

Added React TypeScript example application

A new example application has been added to the repository, demonstrating a React setup using TypeScript and Vite. The example includes the main application component (\App.tsx\) which utilizes \react-i18next\ for internationalization, including pluralization support via the \Trans\ component, along with standard entry point (\main.tsx\), styling (\index.css\), and Vite environment type definitions (\vite-env.d.ts\).

example/react-typescript/simple/src · high confidence

Added React TypeScript example for multi-namespace i18n

A new example application has been added at example/react-typescript/simple-multi-namespaces/src, demonstrating how to use the library with React and TypeScript. The entry point (main.tsx) renders the App component within React.StrictMode, which in turn displays three distinct components (Comp1, Comp2, Comp3) to illustrate multi-namespace usage. The example includes standard Vite configuration files (vite-env.d.ts) and basic styling (index.css).

example/react-typescript/simple-multi-namespaces/src · high confidence

Added TypeScript React components for multi-namespace translation examples

The example project now includes three new React components (Comp1, Comp2, Comp3) demonstrating how to use react-i18next with TypeScript. Comp1 uses the default namespace, Comp2 switches to a specific namespace ('ns2'), and Comp3 demonstrates accessing multiple namespaces ('ns1', 'ns2') simultaneously within a single component.

example/react-typescript/simple-multi-namespaces/src/components · high confidence

Added TypeScript i18n configuration and English translations to the React example

The React TypeScript example now includes a dedicated i18n setup using i18next and react-i18next. A new configuration file initializes the library with English resources, and a corresponding translation JSON file provides sample content, including interpolated strings and pluralization rules for user messages.

example/react-typescript/simple/src/i18n · high confidence

Added TypeScript i18n configuration and resource files for the multi-namespace example

The example application now includes a dedicated i18n configuration file (\config.ts\) that initializes \i18next\ with \react-i18next\, defining \ns1\ as the default namespace and loading resources for both \ns1\ and \ns2\. Corresponding JSON resource files (\ns1.json\ and \ns2.json\) have been added to the \en\ directory, providing the translation strings used in this TypeScript-specific demonstration of multi-namespace handling.

example/react-typescript/simple-multi-namespaces/src/i18n · high confidence

Adds TypeScript type definitions for i18next resources

This change introduces TypeScript declaration files to the example project to enable type-safe translations. A new \resources.ts\ file exports the imported translation namespaces (\ns1\ and \ns2\) as a const object, and \i18next.d.ts\ augments the i18next module to use these resources and the default namespace, ensuring that translation keys are validated against the available JSON files.

example/react-typescript/simple-multi-namespaces/src/@types, example/react-typescript/simple/src/@types · high confidence

Introduce IcuTrans component for ICU MessageFormat translations

The library now includes an \IcuTrans\ component (and its context-free counterpart \IcuTransWithoutContext\) that renders translations using ICU MessageFormat syntax with numbered tags (e.g., \\<0\>Click here\</0\>\). This new capability allows developers to define React component declarations via a \content\ prop, which are automatically mapped to the numbered placeholders in the translation string. The implementation includes a dedicated utility suite (\IcuTransUtils\) for tokenizing the translation strings, decoding HTML entities, and reconstructing the React element tree, while also exporting dummy functions (\date\, \time\, \number\, etc.) to support the \icu.macro\ preprocessor. Also in this area: Fix HTML entity decoding to handle nested entities correctly; Fix HTML entity decoding for characters above U+FFFF.

src, src/IcuTransUtils · high confidence

New Razzle SSR example with Vite and i18next

Added a new server-side rendering (SSR) example application located in the \example/razzle-ssr\ directory. This example demonstrates an SSR setup using Vite and Express, featuring internationalization (i18n) via \i18next\ and \i18next-http-middleware\. It includes server-side language detection, passes initial translation stores to the client to prevent flickering, and supports the \saveMissing\ feature for dynamic translation management. The entry point files include \server.js\, \vite.config.js\, \index.html\, and associated source files.

example/razzle-ssr · high confidence

New React example application using Vite and modern i18next backends

A new React example has been added to the \example/react\ directory, providing a complete starter project for integrating react-i18next. The application is built with Vite (replacing older toolchains like Create React App) and demonstrates key i18next features, including the use of the \i18next-http-backend\ for loading translations, \i18next-browser-languagedetector\ for automatic language detection, and React patterns such as the \useTranslation\ hook, \withTranslation\ HOC, and \Suspense\ for loading states. It includes configuration files for Vite, a \.gitignore\, and source files (\App.jsx\, \i18n.js\, \main.jsx\) that showcase these integrations.

example/react · high confidence

New TypeScript examples for simple and multi-namespace i18n setups

Added two new starter projects to the React TypeScript example directory: a 'simple' example demonstrating fully type-safe translation calls using generated resource types, and a 'simple-multi-namespaces' example. Both are built with Vite and include Swedish (sv) locale support, providing users with ready-to-run templates for integrating react-i18next with TypeScript.

example/react-typescript · high confidence

New example app demonstrating dev-server missing translation saving

Added a new example application in \example/devserver-save-missing\ that showcases how to automatically capture and save missing i18next translation keys during development. The app configures the browser-side i18next with \saveMissing: true\ to POST missing keys to the Vite dev server, which uses a custom plugin and \i18next-http-middleware\ to write these keys into \.missing.json\ files in the \public/locales\ directory.

example/devserver-save-missing · high confidence

Behavioural changes

9 commits (2 fixes) modifying example/react-component-lib

A change to existing behaviour in example/react-component-lib — 9 commits (2 fixs), 11 files: “Modernize locize.com URLs and refresh UTM tags”; “chore(examples): upgrade all example apps off unmaintained toolchains”; “fix img url”; and 6 more (refs \#1777, \#1768).

example/react-component-lib · medium confidence · unverified

Migrate react-fluent example to Vite

The react-fluent example application has been updated to use Vite as its build tool, replacing the previous Create React App setup. This change introduces a new project structure including a Vite configuration file and an HTML entry point, while preserving the existing internationalization features powered by react-i18next and i18next-fluent.

example/react-fluent · high confidence

Pre-commit linting hook added

A pre-commit hook has been added to the .husky directory that runs \npm exec lint-staged\ before each commit, ensuring that staged files are linted automatically.

.husky · high confidence

React ICU example upgraded to Vite with ICU macro support and Russian localization

The react-icu example application has been migrated from the legacy Create React App toolchain to Vite, enabling faster development and builds. This update introduces support for ICU message formatting via the react-i18next babel macro plugin, allowing developers to use advanced pluralization, select, and formatting syntax directly in JSX components. Additionally, a new Russian (ru) translation locale has been added to the application's internationalization resources.

example/react-icu · high confidence

React Native example app updated to modern toolchain

The React Native Locize example project has been regenerated to use the current React Native CLI and build system. This upgrade replaces the legacy Gradle wrapper with version 9.3.1, migrates the JavaScript configuration to the modern \@react-native\ presets (Babel, Metro, ESLint, Jest, and TypeScript), and updates the iOS native project to use the new \RCTReactNativeFactory\ architecture in \AppDelegate.swift\. The app now includes a \PrivacyInfo.xcprivacy\ manifest for iOS App Store compliance and demonstrates the latest \react-i18next\ integration patterns.

example/ReactNativeLocizeProject · high confidence

React Native example app upgraded to modern toolchain and New Architecture

The React Native example project has been updated to use the current React Native CLI toolchain, replacing legacy build systems with modern standards. This includes migrating the Android implementation to Kotlin and enabling the New Architecture (Fabric) by default via \DefaultReactActivityDelegate\. The iOS side now uses the new \RCTReactNativeFactory\-based AppDelegate, and the JavaScript layer has been upgraded to TypeScript with a new \App.tsx\ entry point. Additionally, the example now integrates \react-i18next\ for internationalization, allowing users to switch between English and German, and enforces code quality via standardized ESLint and Prettier configurations.

example/ReactNativeProject · high confidence

React-localstorage example migrated to Vite

The react-localstorage example has been rebuilt using Vite instead of the previous toolchain. Users can now start the development server with \npm run dev\ (serving at localhost:5173), build the production bundle, or preview the output. The application demonstrates i18next with a chained backend (LocalStorage and Http) and includes language switching between English and German via buttons, supporting both React hooks and higher-order components.

example/react-localstorage · high confidence

Updated Android example app scaffolding for React Native New Architecture

The Android example project has been updated to use the modern React Native toolchain, including the New Architecture (Fabric). This involves adding missing core configuration files such as the AndroidManifest, MainActivity (Kotlin), and resource definitions (styles, strings, drawables). The app now utilizes DefaultReactActivityDelegate to enable Fabric and applies a specific edit-text drawable fix to prevent NullPointerExceptions, ensuring the example runs correctly on current React Native versions.

example/ReactNativeLocizeProject/android · medium confidence

Updated Jest mock for react-i18next to handle missing children in Trans component

The Jest mock for react-i18next in the test-jest example has been updated to correctly render the Trans component when it receives no children by falling back to the i18nKey prop. This ensures that tests using the Trans component without explicit child elements will now render the key string instead of potentially failing or rendering incorrectly, aligning the mock's behavior more closely with the library's runtime logic.

example/test-jest/src/\\mocks\\_ · high confidence_

Test coverage

1 commit adding/updating tests in test; Added TypeScript tests for ICU and MF2 interpolation argument types; Added TypeScript tests for strict selector mode; Added TypeScript tests for useTranslation selector types with defaultNS: false; Added TypeScript type tests for core components and hooks; Added TypeScript type tests for custom types configuration; Added TypeScript type tests for i18next components and hooks; Added TypeScript type tests for selector-based custom types; Added TypeScript type-checking tests for custom resource declarations; Added tests for IcuTrans component and translation utilities; Comprehensive test suite for Trans, useTranslation, and I18nextProvider.

Dependencies

Updated example projects to React 19 and React Native 0.86

The React Native and Locize example projects have been upgraded to use React 19.2.3 and React Native 0.86.2, along with corresponding updates to the React Native CLI, Babel presets, and TypeScript configurations. The React Native examples also now require Node.js 22.11.0 or higher and include specific Ruby gem constraints (activesupport \>= 7.2.3.1) to resolve build failures and security advisories in the iOS/Android toolchains.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 58 → 64 (+5.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 57 → 71 (+13.5)
  • Architecture 100 → 100 (+0.0)
  • Maturity 52 → 54 (+2.1)
  • Readiness 56 → 62 (+5.9)
  • Security 76 → 79 (+3.0)
  • Performance 100 (new)

Resolved (24)

  • Duplicated block (21 lines × 2) (example/ReactNativeLocizeProject/ios/ReactNativeLocizeProject/AppDelegate.swift)
  • Duplicated block (7 lines × 2) (example/ReactNativeLocizeProject/ios/ReactNativeLocizeProject/AppDelegate.swift)
  • Further sole-owners (lower concentration)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High secret: WD-SECRET-0004 (example/ReactNativeLocizeProject/android/app/debug.keystore)
  • High secret: WD-SECRET-0004 (example/ReactNativeProject/android/app/debug.keystore)
  • Leaked secret: private-key-store (example/ReactNativeLocizeProject/android/app/debug.keystore)
  • Leaked secret: private-key-store (example/ReactNativeProject/android/app/debug.keystore)
  • Low CVE: [GHSA redacted] (package-lock.json)
  • Medium CVE: [GHSA redacted] (package-lock.json)
  • Off-boarding risk: anonymized user #1
  • Orphaned knowledge (icu.macro.js)
  • Test suite cannot be installed from its own lockfile: the repository root
  • Trans (cognitive 38) (src/TransWithoutContext.js)
  • Trans (cyclomatic 42) (src/TransWithoutContext.js)
  • …and 4 more

New (24)

  • Duplicated block (30 lines × 2) (example/ReactNativeLocizeProject/ios/ReactNativeLocizeProject/SceneDelegate.swift)
  • Duplicated block (7 lines × 2) (example/ReactNativeLocizeProject/ios/ReactNativeLocizeProject/SceneDelegate.swift)
  • FunctionTooLong: TransWithoutContext.Trans (src/TransWithoutContext.js)
  • Hotspot: src/IcuTransWithoutContext.js (src/IcuTransWithoutContext.js)
  • IcuTransWithoutContext.IcuTransWithoutContext (cyclomatic 16) (src/IcuTransWithoutContext.js)
  • Low CVE: [GHSA redacted] (example/ReactNativeLocizeProject/package-lock.json)
  • Low CVE: [GHSA redacted] (example/ReactNativeProject/package-lock.json)
  • No assertions: ReactOptions is filled in by react-i18next, importable from both packages (test/typescript/misc/ReactOptions.test.ts)
  • No assertions: accepts bindI18nStore in the useTranslation options (test/typescript/misc/ReactOptions.test.ts)
  • No assertions: checks the react options in init() (test/typescript/misc/ReactOptions.test.ts)
  • No assertions: joins a key prefix with "." when keySeparator is false, as getFixedT does (test/typescript/key-separator-false/keyPrefix.test.tsx)
  • No assertions: keeps values optional on IcuTrans (test/typescript/strict-interpolation/strict.test.tsx)
  • No assertions: keeps values optional on Trans (test/typescript/strict-interpolation/strict.test.tsx)
  • No assertions: leaves HTMLAttributes children alone unless augment-react is imported (test/typescript/augment-react-not-imported/augment.test.tsx)
  • No assertions: requires the variables in t() (test/typescript/strict-interpolation/strict.test.tsx)
  • No assertions: should reject variables of another key (test/typescript/custom-types/issue1913-jsx.test.tsx)
  • Off-boarding risk: anonymized user #1
  • Trans (cognitive 55) (src/TransWithoutContext.js)
  • Trans (cyclomatic 64) (src/TransWithoutContext.js)
  • redundant comment (src/IcuTransUtils/renderTranslation.js)
  • …and 4 more

Changes since last survey

  • 23 commits — 18 feature/other, 5 fixes

By area

  • (root) — 20 commits
  • example/ReactNativeLocizeProject — 1 commit
  • src/TransWithoutContext.js — 1 commit
  • test/typescript — 1 commit

Notable commits

  • fix: fix(Trans): no missing-variable debug warning from i18next 26.7 for the variables of object children
  • fix: fix(Trans, IcuTrans): don't parse markup that comes from interpolated values
  • fix: fix(types): compute the Trans values type inside the prop again (#1947)
  • fix: fix(types): declare @types/react as an optional peer dependency, require i18next 27.0.1
  • fix: fix(types): the react init options keep their types with i18next 27
  • change: 17.1.10
  • change: 17.1.11
  • change: 17.1.12
  • change: 17.1.13
  • change: 18.0.0
  • change: 18.0.1
  • change: README: drop the Locize ad image; the sponsor banner and the text saying who builds Locize stay
  • change: build
  • change: build
  • change: build
  • change: changelog for 17.1.11
  • change: changelog for 17.1.12
  • change: changelog for 17.1.13
  • change: changelog for 18.0.0
  • change: changelog for 18.0.1
  • …and 3 more

Architecture

  • Containers 0 added · 0 removed · contexts 2 added · 2 removed · edges 0 added · 0 removed

Added bounded contexts (2)

  • example/ReactNativeLocizeProject/android/app
  • example/ReactNativeProject/android/app

Removed bounded contexts (2)

  • example/ReactNativeLocizeProject/android/app
  • example/ReactNativeProject/android/app

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

i18next/react-i18next was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit f97f5f82605c0ddd3ae3af6c0112c33cf7c0ab70 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.