powo-cli is a powerful Node.js module designed to seamlessly import Powo translations into your web projects. Streamline your internationalization workflow with support for multiple platforms and flexible translation management.
- Multi-language support with automatic file generation
- Flexible configuration options for different project types
- Cross-platform support (Android, iOS, Web, Robot)
- Support for global, feature-based, and module-based translation loading
- Version management (latest approved or draft translations)
- Module merging capabilities for complex multi-project architectures
- Proxy support for enterprise environments
yarn add powo-clinpm install powo-cliAdd the powo script to your package.json:
{
"scripts": {
"powo": "load-locales --project=MyPowoProject --country=XX --platform=web --version=last --languages=fr,en --location=src/locales/"
}
}Then run:
npm run powo
# or
yarn powoLoad all translations into consolidated language files:
{
"scripts": {
"powo:global": "load-locales --project=MyPowoProject --country=XX --platform=web --version=last --languages=fr,en --location=src/locales/"
}
}This command generates en.json and fr.json files with all approved translations in your specified location.
| Option | Description | Required | Default |
|---|---|---|---|
project |
Powo Project's name | β | - |
country |
Country code | β | XX |
platform |
Target platform (Android, iOS, web, robot) |
β | - |
version |
Translation version (last or draft) |
β | - |
languages |
Comma-separated list of languages to generate | β | - |
location |
Destination folder path | β | - |
proxy |
Proxy URL (format: http://proxy.fr:8080) |
β | - |
Load translations organized by features for better modularity:
{
"scripts": {
"powo:features": "load-by-features --project=MyPowoProject --country=XX --platform=web --version=last --location=src/locales/"
}
}This command generates separate JSON files for each feature, enabling more granular translation management.
| Option | Description | Required | Default |
|---|---|---|---|
project |
Powo Project's name | β | - |
country |
Country code | β | XX |
platform |
Target platform (Android, iOS, web, robot) |
β | - |
version |
Translation version (last or draft) |
β | - |
location |
Destination folder path | β | - |
proxy |
Proxy URL (format: http://proxy.fr:8080) |
β | - |
Combine translations from multiple modules into unified language files:
{
"scripts": {
"powo:modules": "load-by-modules --delivery=MyDelivery --modules=ModuleA,ModuleB,ModuleC --platform=web --versions=last --languages=fr,en --location=src/locales/"
}
}This command downloads translations from multiple modules and merges them into consolidated language files, perfect for micro-service architectures or multi-team projects.
| Option | Description | Required | Default |
|---|---|---|---|
delivery |
Delivery identifier for module grouping | β | - |
modules |
Comma-separated list of module names to merge | β | - |
country |
Country code | β | XX |
platform |
Target platform (Android, iOS, web, robot) |
β | - |
versions |
Version for each module (single value or comma-separated) | β | - |
languages |
Comma-separated list of languages to generate | β | - |
location |
Destination folder path | β | - |
proxy |
Proxy URL (format: http://proxy.fr:8080) |
β | - |
# Load French and English translations for a web project
load-locales --project=MyWebApp --platform=web --version=last --languages=fr,en --location=src/i18n/# Load translations for iOS app through corporate proxy
load-locales --project=MyMobileApp --platform=iOS --version=draft --languages=en,es,de --location=assets/translations/ --proxy=http://corporate-proxy:8080# Generate feature-specific translation files
load-by-features --project=MyLargeApp --platform=web --version=last --location=src/locales/features/# Merge translations from multiple modules into unified files
load-by-modules --delivery=MainApp --modules=AuthModule,PaymentModule,UserModule --platform=web --versions=last --languages=fr,en --location=src/i18n/To test the CLI locally:
npm linkThis creates a global symlink to your local development version.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please file an issue on the GitHub repository.
