Save Local Edits

How to save edits made to local translation files

Usage

npx gtx-cli save-local

This 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:

  1. Reading your configured files from gt.config.json
  2. Resolving the current git branch information
  3. Comparing your local translation files against the latest downloaded server versions
  4. Computing diffs for any changes you've made
  5. 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:

  1. Identifies files that have changed since the last download by comparing content hashes
  2. Fetches the original server content for those files
  3. Generates unified diffs between the server version and your local version
  4. Submits the diffs to the platform

Only files that have actually changed will be processed.


Flags

ParameterDescriptionTypeOptionalDefault
--api-keyAPI key for General Translationstringtrue
--project-idGeneral Translation project IDstringtrue
-c, --configPath to the GT config filestringtrue"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.

How is this guide?