explaingit

lingui/js-lingui

5,748TypeScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A JavaScript library for adding multi-language support to React and JavaScript apps, with a CLI for extracting and compiling translation strings and ICU MessageFormat compatibility.

Mindmap

mindmap
  root((Lingui))
    What it does
      Internationalization
      String extraction
      Plural handling
    Tech stack
      TypeScript
      React
      React Native
      Vite plugin
    Translation formats
      PO files
      CSV and JSON
    Community
      MIT license
      Discord
      Docs at lingui.dev
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add multi-language support to a React app with readable JSX syntax instead of messy string-key lookups.

USE CASE 2

Extract all translatable text from your source code automatically with the Lingui CLI.

USE CASE 3

Handle plural forms, gendered nouns, and date formatting rules across many languages without custom code.

USE CASE 4

Generate PO translation files compatible with professional translation tools.

Tech stack

TypeScriptJavaScriptReactReact NativeViteESLint

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a Lingui config file and a CLI extract step before translations can be compiled and used.

MIT, use freely in any project including commercial ones, just keep the copyright notice.

In plain English

Lingui is a JavaScript library for making applications available in multiple languages, a process often called internationalization (or i18n for short). It is designed to keep the translation-related code readable rather than cluttered, while handling the formatting rules that vary across languages, such as plural forms, date formats, and gendered nouns. The library uses a widely adopted message format standard called ICU MessageFormat under the hood. This means translation files produced by Lingui are compatible with many professional translation tools. Messages are stored in PO files by default, though CSV, JSON, and custom formats are also supported. For React projects, Lingui provides components that let you write translatable text directly inside JSX, the syntax React developers use for markup. Links, bold text, and other markup can be included inside translated strings without pulling them apart into awkward fragments. A command-line tool extracts all the text that needs translating from your source code, compiles the resulting translation files, and validates them. Plugins for Vite and ESLint are also provided. The library works outside React too: a core package handles the internationalization logic for any JavaScript environment, and the React Native workflow follows the same extract-and-compile process. Community-supported packages extend it to Astro and Svelte. The total size added to a JavaScript bundle is small, around 2 kilobytes for the core. Version 6 of the library was released in April 2026. The project is open source under the MIT license and has an active community on Discord. Documentation is at lingui.dev.

Copy-paste prompts

Prompt 1
How do I add Lingui to a React app built with Vite? Walk me through installing it and translating my first string.
Prompt 2
Using js-lingui, show me how to handle plural forms in English and Polish inside a React component.
Prompt 3
How do I run the Lingui CLI to extract all strings from my TypeScript React project and produce PO files for translators?
Prompt 4
Show me how to switch the active language at runtime in a Lingui-powered React app without reloading the page.
Prompt 5
How do I use Lingui in a React Native project? Show the workflow from extraction to displaying translated text.
Open on GitHub → Explain another repo

← lingui on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.