Awesome Open Source
Awesome Open Source

Linguijs

馃實馃摉 A readable, automated, and optimized (5 kb) internationalization for JavaScript


Main Suite Release Workflow Testing Code Coverage PRs Welcome Backers on Open Collective Sponsors on Open Collective Join the community on Spectrum

DocumentationDocumentation 2.xQuickstartExampleSupportContributeLicence

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 framework for global projects.

  • 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.

  • 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 the whole intl workflow using Lingui CLI. It extracts messages from source code, validates messages coming from translators and checks that all messages are translated before shipping to production.

  • 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 file, which is supported in almost all translation tools.

  • Lightweight and optimized - Core library is only 1.9 kB gzipped, React components are additional 3.1 kBs gzipped. That's less than Redux for a full-featured intl library.

  • Active community - Join us on Spectrum to discuss the latest development. At the moment, Lingui is the most active intl project on GitHub.

  • 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

Install

Tutorials

If you're a react-intl user, checkout comparison of react-intl and Lingui.

Example

Short example how i18n looks with JSX:

import { Trans } from "@lingui/macro"

function App() {
  return (
   <Trans id="msg.docs" /* id is optional */>
     Read the <a href="https://lingui.js.org">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 React tutorial.

Support

If you are having issues, please let us know.

  • Join us at Gitter to get almost instant feedback.
  • Ask question on StackOverflow and mark it with Lingui tag.
  • If something doesn't work as documented, documentation is missing or if you just want to suggest a new feature, create an issue.

Contribute

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

  • Do you use Lingui in production site? Let us know!
  • Have you seen 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].

Contributors

Backers

Thank you to all our backers! 馃檹 [Become a backer]

Backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

The project is licensed under the MIT license.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (68,032)聽
typescript (10,364)聽
react (5,155)聽
react-native (1,470)聽
translation (288)聽
i18n (214)聽
react-components (199)聽
localization (166)聽
internationalization (95)聽
intl (22)聽
icu (16)聽

Find Open Source By Browsing 7,000 Topics Across 59 Categories

Advertising 馃摝聽10
All Projects
Application Programming Interfaces 馃摝聽124
Applications 馃摝聽192
Artificial Intelligence 馃摝聽78
Blockchain 馃摝聽73
Build Tools 馃摝聽113
Cloud Computing 馃摝聽80
Code Quality 馃摝聽28
Collaboration 馃摝聽32
Command Line Interface 馃摝聽49
Community 馃摝聽83
Companies 馃摝聽60
Compilers 馃摝聽63
Computer Science 馃摝聽80
Configuration Management 馃摝聽42
Content Management 馃摝聽175
Control Flow 馃摝聽213
Data Formats 馃摝聽78
Data Processing 馃摝聽276
Data Storage 馃摝聽135
Economics 馃摝聽64
Frameworks 馃摝聽215
Games 馃摝聽129
Graphics 馃摝聽110
Hardware 馃摝聽152
Integrated Development Environments 馃摝聽49
Learning Resources 馃摝聽166
Legal 馃摝聽29
Libraries 馃摝聽129
Lists Of Projects 馃摝聽22
Machine Learning 馃摝聽347
Mapping 馃摝聽64
Marketing 馃摝聽15
Mathematics 馃摝聽55
Media 馃摝聽239
Messaging 馃摝聽98
Networking 馃摝聽315
Operating Systems 馃摝聽89
Operations 馃摝聽121
Package Managers 馃摝聽55
Programming Languages 馃摝聽245
Runtime Environments 馃摝聽100
Science 馃摝聽42
Security 馃摝聽396
Social Media 馃摝聽27
Software Architecture 馃摝聽72
Software Development 馃摝聽72
Software Performance 馃摝聽58
Software Quality 馃摝聽133
Text Editors 馃摝聽49
Text Processing 馃摝聽136
User Interface 馃摝聽330
User Interface Components 馃摝聽514
Version Control 馃摝聽30
Virtualization 馃摝聽71
Web Browsers 馃摝聽42
Web Servers 馃摝聽26
Web User Interface 馃摝聽210