Save Local Edits
How to save edits made to local translation files
Usage
npx gtx-cli save-localThis command requires an API key. Get one on the platform.
Overview
The gtx-cli save-local command saves any local edits you've made to translation files back to the General Translation platform. It does this by:
- Reading your configured files from
gt.config.json - Resolving the current git branch information
- Comparing your local translation files against the latest downloaded server versions
- Computing diffs for any changes you've made
- Submitting those diffs to the General Translation platform
This command does not enqueue any new translations. It only syncs your local edits back to the platform.
This is useful when you or your team has manually edited translation files locally and you want those changes reflected on the platform. For example, if a translator has made corrections directly in JSON files.
How it works
The CLI tracks which translations have been downloaded in a lock file. When you run save-local, it:
- Identifies files that have changed since the last download by comparing content hashes
- Fetches the original server content for those files
- Generates unified diffs between the server version and your local version
- Submits the diffs to the platform
Only files that have actually changed will be processed.
Flags
| Parameter | Description | Type | Optional | Default |
|---|---|---|---|---|
--api-key | API key for General Translation | string | true | |
--project-id | General Translation project ID | string | true | |
-c, --config | Path to the GT config file | string | true | "gt.config.json" |
All of these parameters are optional if you have them configured via environment variables or in your gt.config.json.
Do not add your API key to the gt.config.json file! You should set it as an
environment variable instead. The CLI will automatically read GT_API_KEY if
it is set.
Related commands
gtx-cli translate- Translate your project and download translationsgtx-cli translate --save-local- Save local edits before translating (combines both operations)
How is this guide?