Linguito is a CLI tool designed to enhance the capabilities of Lingui. It provides advanced utilities to ensure smooth internationalization (i18n) workflows, making it a great companion for managing translations in your project.
Install Linguito globally to start using it:
npm install -g linguito
Or run with npx to avoid a global installation.
npx linguito
If you want to use Linguito AI capabilities, you will need to configure it to connect the app to connect to your preferred LLM service.
To use Linguito with a local LLM, ensure you have a running and accessible LLM service. Currently, Linguito supports the following local LLMs:
Choose your preferred provider, install a model and connect it with Linguito by running linguito config
. You will need to configure the specific provider you chose (like lmstudio
or ollama
) and its address.
Verifies your project's translation files to ensure all translations are complete. It scans the catalog files defined in lingui.config.js
and reports any missing translations in the format <file>:"<missing_key>"
.
# By default, linguito check looks for a lingui config file in the current directory
linguito check
# Or you can specify your project's directory
linguito check ~/Development/my-app
Manage Linguito's configuration settings for advanced customization. The config
command allows you to view and update the CLI's configuration in both interactive and programmatic ways.
# If no other subcommand is used, this will start an interactive session to change config values
linguito config
# You can also read a specific config value
linguito config get llmSettings.provider
# Or set config values
linguito config set llmSettings.provider=ollama llmSettings.url=http://127.0.0.1:1234/v1
Helps you identify and resolve missing translations in your project's .po
catalog files. It scans the translation files defined in your Lingui configuration (lingui.config.js
) and either prompts you to fill in missing translations interactively or utilizes a configured LLM (Large Language Model) to automatically translate them for you. You can also combine these approaches by reviewing AI-suggested translations interactively.
# Start an interactive session to fill the missing translations found in the project
linguito translate ~/Development/my-app --interactive
# You can also let the configured LLM fill the translations for you
linguito translate ~/Development/my-app --llm
# Or you can start an interactive session with translations suggested by the LLM
linguito translate ~/Development/my-app --llm --interactive
Reads and cleans the project's catalog files to ensure consistency and readability. It removes empty translations and normalizes the format of the catalog files, making them easier to maintain. This command is particularly useful before committing translation changes to version control or when preparing files for translation work.
# Format catalog files in the current directory project
linguito format
# Or specify a custom project directory
linguito format ~/Development/my-app
This project is built with oclif and Typescript.
Here is a list of useful commands to use and develop this tool locally:
npm run start -- {command}
- Runs linguito locallynpm run lint
- Validate lint rulesnpm run test
- Runs all testsnpm run test:watch
- Runs all tests and watches for changes to rerun them when they happen