CLI
The locize-cli and i18next-cli are open source command-line tools for managing translations in your projects and integrating with locize.
Note:
- If you use i18next in your project, the i18next-cli offers a modern toolchain for extraction, linting, type generation, and direct locize integration.
- If you do not use i18next, you can use locize-cli directly. The locize-cli supports a wide range of translation file formats (such as JSON, YAML, XLIFF, CSV, PO, RESX, Fluent, Properties, and more), configurable via command line arguments. This makes it suitable for many frameworks and localization setups beyond i18next.
Main Features
locize-cli
- Synchronize local translation files with locize
- Download translations from locize
- Migrate existing translation files to locize
- Add, remove, and get individual translation keys
- Manage branches, versions, and namespaces
- Supports many translation file formats (configurable via CLI)
i18next-cli (for i18next users)
- Extract translation keys from your codebase
- Generate TypeScript types for translation keys
- Lint for hardcoded strings and i18n issues
- Sync and check translation status
- Plugin system for custom extraction (e.g., Svelte, Vue)
- Direct integration with locize (requires locize-cli installed)
Typical Usage
Install locize-cli globally:
npm install -g locize-cliSync translations:
locize sync --api-key <your-api-key> --project-id <your-project-id>Download translations:
locize download --project-id <your-project-id> --language en --namespace common --path ./localesMigrate existing files:
locize migrate --api-key <your-api-key> --project-id <your-project-id> --path ./en --language enExtract keys with i18next-cli:
npx i18next-cli extractSync with locize via i18next-cli:
npx i18next-cli locize-syncLearn More
For full details, advanced configuration, and all available commands, see the locize-cli README and i18next-cli README.
Video Demo
CLI migrate command example:
smart_display
YouTube Video
This video is hosted on YouTube. Accept YouTube cookies to watch it here.