@parlats/cli
v1.0.2
Published
CLI for syncing translations with Parlats
Downloads
271
Maintainers
Readme
@parlats/cli
CLI for syncing translations between your project and Parlats.
Install
npm i -g @parlats/cliQuick Start
- Create an API key in your Parlats project settings
- Set your key:
export PARLATS_API_KEY=trad_... - Initialize your project:
parlats init - Pull translations:
parlats pull
Commands
parlats init
Set up .parlats.yml in your project. Walks you through selecting a preset, project, and file pattern.
parlats init
parlats init --preset next-intl --host https://parlats.comPresets: next-intl, i18next, next-i18next, react-intl, vue-i18n
parlats pull
Download translations from Parlats and write them to your local files.
parlats pull
parlats pull --locale es,fr
parlats pull --namespace common
parlats pull --dry-runparlats push
Upload local translation files to Parlats.
parlats push
parlats push --locale en
parlats push --add-only # only push new keys, don't overwrite
parlats push --force # skip confirmation for changed values
parlats push --dry-runparlats status
Show translation progress per locale.
parlats status
parlats status --json # machine-readable outputConfiguration
parlats init creates a .parlats.yml file:
host: "https://parlats.com"
project_id: "your-project-uuid"
api_key_env: "PARLATS_API_KEY"
source_locale: "en"
files:
path: "messages/{locale}.json"
format: "json-nested"The API key is read from the environment variable specified in api_key_env (default: PARLATS_API_KEY). Add it to your .env file or set it in your shell.
File Patterns
Use {locale} and {namespace} placeholders in files.path:
| Pattern | Example |
|---------|---------|
| messages/{locale}.json | messages/en.json |
| public/locales/{locale}/{namespace}.json | public/locales/en/common.json |
| lang/{locale}.json | lang/en.json |
| src/locales/{locale}.json | src/locales/en.json |
License
MIT
