Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

andrii-bodnar/js-lingui

 
 

Repository files navigation

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


Main SuiteRelease Workflow TestingCode CoveragePRs WelcomeJoin the community on Discord

Documentation ·Quickstart ·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.

  • Clean and readable - Keep your code clean and readable, while the library uses battle-tested and powerfulICU 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.

  • Full rich-text support - Use React components inside localized messages without any limitation. Writing rich-text messages is as easy as writing JSX.

  • Powerful tooling - Manage your intl workflow with the LinguiCLI,Vite Plugin, andESLint 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 message keys as well as auto-generated messages. Translations are stored either in JSON or standard PO files, which are supported in almost all translation tools.

  • Lightweight and optimized - Core library is less than3 kB gzipped, React components are additional1.4 kB gzipped.

  • Active community - Join the growingcommunity 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.

Quickstart

  1. Introduction
  2. Installation and Setup

Tutorials

Example

Short example how i18n looks with JSX:

import{Trans}from"@lingui/react/macro"functionApp(){return(<Transid="msg.docs"// Optional message idcomment="Docs link on the website"// Comment for translators, optional>      Read the<ahref="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 theExamples directory.

Support

If you are having issues, please let us know.

  • Join us onDiscord to chat with the community.
  • Ask questions onStackOverflow and mark it with thelinguijs 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 alsoAsk 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 useLingui in production site? Let us know!
  • Have you seen any interesting talk or article abouti18n?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 thecontributors guide and send a PR!

Contributors

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

License

The project is licensed under theMIT license.

About

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript90.1%
  • MDX6.2%
  • JavaScript2.0%
  • SCSS1.5%
  • Other0.2%

[8]ページ先頭

©2009-2025 Movatter.jp