Volver al ranking

lingui/js-lingui

TypeScriptlingui.dev

🌍 📖 A readable, automated, and optimized (2 kb) internationalization for JavaScript

translationinternationalizationjavascripti18nlocalizationicureactreact-componentsmessageformatintlreact-nativehacktoberfest
Crecimiento de estrellas
Estrellas
5.8k
Forks
447
Crecimiento semanal
Issues
46
2k4k
ene 2023mar 2024may 2025jul 2026
Artefactosnpmnpm install js-lingui
README

Linguijs

🌍📖 A readable, automated, and optimized (2 kb) internationalization for JavaScript

🎉 Lingui v6 is now available! Read the release announcement →


Main Suite Release Workflow Testing Code Coverage PRs Welcome Join the community on Discord

Documentation · Example · Support · Contribute · License

Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language.

--- W3C Web Internationalization FAQ

Lingui is an easy yet powerful internationalization (i18n) framework for global projects.

Key Features

  • Clean and readable - Keep your code clean and readable, while the library uses battle-tested and powerful ICU MessageFormat under the hood.

  • Universal - Use it everywhere. @lingui/core provides the essential intl functionality which works in any JavaScript project, while @lingui/react offers components to leverage React rendering, including React Server Components (RSC) support, and @lingui/solid brings native SolidJS bindings. The same extract-and-compile workflow applies to React Native. Astro and Svelte work through community-supported packages.

  • Full rich-text support - Use React components inside localized messages without any limitation. Writing rich-text messages is as easy as writing JSX. That helps keep message catalogs in sync with your source code.

  • Powerful tooling - Manage your intl workflow with the Lingui CLI, Vite Plugin, and ESLint Plugin. The CLI extracts, compiles and validates messages, while the Vite plugin compiles catalogs on the fly, and the ESLint plugin helps catch common usage errors.

  • Unopinionated - Integrate Lingui into your existing workflow. It supports explicit message keys as well as auto-generated ones. Translations are stored in a standard PO file, which is supported in almost all translation tools. You can also use CSV or JSON, or add a custom formatter of your own.

  • Lightweight and optimized - Core library @lingui/core, React components @lingui/react.

  • Built for AI-assisted workflows - Good translations need context, especially for short UI strings. Lingui's localization formats let you describe where and how keys are used. Install lingui/skills to help your AI assistant apply Lingui patterns consistently, and see i18n with AI for MCP setup and more.

  • Active community - Join the growing community of developers who are using Lingui to build global products.

  • Compatible with react-intl - Low-level React API is very similar to react-intl and the message format is the same. It's easy to migrate an existing project.

Example

Short example how i18n looks with JSX:

import { Trans } from "@lingui/react/macro"

function App() {
  return (
    <Trans
      id="msg.docs" // Optional message id
      comment="Docs link on the website" // Comment for translators, optional
    >
      Read the <a href="https://lingui.dev">documentation</a>
      for more info.
    </Trans>
  )
}

Message from this component will be extracted in following format:

msgid "msg.docs"
msgstr "Read the <0>documentation</0> for more info."

For more example see the Examples directory.

Support

If you are having issues, please let us know.

  • Join us on Discord to chat with the community.
  • Ask questions on StackOverflow and mark it with the linguijs tag.
  • If something doesn't work as documented, documentation is missing or if you just want to suggest a new feature, create an issue.
  • You can also Ask Lingui JS Guru, it is a Lingui JS focused AI to answer your questions.

Contribute

Contribution to open-source project is everything from spreading the word, writing documentation to implement features and fixing bugs.

  • Do you use Lingui in production site? Let us know!
  • Have you seen any interesting talk or article about i18n? Share it!
  • Have you found a bug or do you want to suggest a new feature? Create an issue!
  • Do you want to improve the docs and write some code? Read the contributors guide and send a PR!

Contributors

This project exists thanks to all the people who contribute. [Contribute].

License

The project is licensed under the MIT license.

Repositorios relacionados
TeamNewPipe/NewPipe

A libre lightweight streaming front-end for Android.

JavaMavenGNU General Public License v3.0youtube-videovideo
newpipe.net
39.1k3.7k
PDFMathTranslate/PDFMathTranslate

[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

PythonPyPIGNU Affero General Public License v3.0chineselatex
pdf2zh.com
35.7k3.2k
ryanhanwu/How-To-Ask-Questions-The-Smart-Way

本文原文由知名 Hacker Eric S. Raymond 所撰寫,教你如何正確的提出技術問題並獲得你滿意的答案。

JavaScriptnpmMIT Licensertfmtranslation
35.4k5.8k
unknwon/the-way-to-go_ZH_CN

《The Way to Go》中文译本,中文正式名《Go 入门指南》

GoGo Modulesgotutorial
35.1k8.5k
xitu/gold-miner

🥇掘金翻译计划,可能是世界最大最好的英译中技术社区,最懂读者和译者的翻译平台:

androidtranslation
juejin.cn/tag/%E6%8E%98%E9%87%91%E7%BF%BB%E8%AF%91%E8%AE%A1%E5%88%92
34.3k5k
nextai-translator/nextai-translator

基于 ChatGPT API 的划词翻译浏览器插件和跨平台桌面端应用 - Browser extension and cross-platform desktop application for translation based on ChatGPT API.

TypeScriptnpmGNU Affero General Public License v3.0chatgptchrome-extension
24.9k1.8k
openai-translator/openai-translator

基于 ChatGPT API 的划词翻译浏览器插件和跨平台桌面端应用 - Browser extension and cross-platform desktop application for translation based on ChatGPT API.

TypeScriptnpmGNU Affero General Public License v3.0chatgptchrome-extension
24.2k1.8k
izackwu/TeachYourselfCS-CN

TeachYourselfCS 的中文翻译 | A Chinese translation of TeachYourselfCS

Creative Commons Attribution Share Alike 4.0 Internationaltranslationchinese-translation
teachyourselfcs.com
22.1k3.3k
go-playground/validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving

GoGo ModulesMIT Licensevalidationtranslation
20.1k1.4k
pot-app/pot-desktop

🌈一个跨平台的划词翻译和OCR软件 | A cross-platform software for text translation and recognition.

JavaScriptnpmGNU General Public License v3.0translationpot
pot-app.com
19.1k954
Byaidu/PDFMathTranslate

PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/Docker/Zotero

PythonPyPIGNU Affero General Public License v3.0chineselatex
pdf2zh.com
18.3k1.5k
immersive-translate/immersive-translate

沉浸式双语网页翻译扩展 , 支持输入框翻译, 鼠标悬停翻译, PDF, Epub, 字幕文件, TXT 文件翻译 - Immersive Dual Web Page Translation Extension

chrome-extensionsafari-extension
immersivetranslate.com
18.2k1.1k