
Security News
Python Tools Are Quickly Adopting the New pylock.toml Standard
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
@lingui/cli
Advanced tools
@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.
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
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 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 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 command line library for manipulating message catalogues
@lingui/cli
is part of LinguiJS. See the documentation for all information, tutorials and examples.
The library can be installed globally or locally using yarn
or npm
. The recommended way is installing the package locally. This ensures that everyone who uses the project has the same version and does not need to install additional packages.
npm install --save-dev @lingui/cli
# or using yarn
yarn add --dev @lingui/cli
To run the library locally there are three options, with the first one been recommended one.
Add these scripts to your package.json
.
{
"scripts": {
"extract": "lingui extract",
"compile": "lingui compile"
}
}
Then you can use:
npm run extract
npm run compile
You can run the scripts directly using a tool for executing Node packages NPX
. NPX
is included in NPM
version 5.2 and higher.
npx lingui extract
npx lingui compile
You can run commands directly from node_modules
folder.
node_modules/.bin/lingui extract
node_modules/.bin/lingui compile
See the reference documentation.
This package is licensed under MIT license.
FAQs
CLI for working wit message catalogs
The npm package @lingui/cli receives a total of 174,884 weekly downloads. As such, @lingui/cli popularity was classified as popular.
We found that @lingui/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
Security News
vlt adds real-time security selectors powered by Socket, enabling developers to query and analyze package risks directly in their dependency graph.