What is @lingui/cli?
@lingui/cli is a command-line interface for the LinguiJS framework, which is used for internationalization (i18n) in JavaScript applications. It provides tools for extracting messages, compiling them, and managing translations.
What are @lingui/cli's main functionalities?
Extract Messages
This command scans your source code for messages marked for translation and extracts them into a catalog file. This is useful for identifying all the text that needs to be translated in your application.
lingui extract
Compile Messages
This command compiles the message catalogs into a format that can be used by the application at runtime. This step is necessary to convert the raw translation files into a format that the LinguiJS runtime can understand.
lingui compile
Add Locale
This command adds a new locale to your project. It sets up the necessary files and directories for managing translations in the specified locale.
lingui add-locale [locale]
Extract and Compile
This combined command first extracts messages and then compiles them. It is a convenient way to update your translation catalogs and make them ready for use in your application.
lingui extract && lingui compile
Other packages similar to @lingui/cli
i18next
i18next is a popular internationalization framework for JavaScript. It provides a comprehensive set of tools for managing translations, including a CLI for extracting and compiling messages. Compared to @lingui/cli, i18next offers more flexibility and a larger ecosystem of plugins and extensions.
react-intl
react-intl is a library for internationalizing React applications. It provides components and an API for formatting dates, numbers, and strings, as well as managing translations. While it does not have a dedicated CLI, it integrates well with other tools for extracting and managing translations.
formatjs
formatjs is a set of libraries for internationalizing JavaScript applications. It includes tools for formatting dates, numbers, and strings, as well as managing translations. The formatjs CLI provides similar functionality to @lingui/cli for extracting and compiling messages.
@lingui/cli
lingui command line library for manipulating message catalogues
@lingui/cli
is part of LinguiJS. See the documentation for all information, tutorials and examples.
Installation & Usage
See the reference documentation.
License
This package is licensed under MIT license.