# gt: General Translation CLI tool: gt save-local
URL: https://generaltranslation.com/en-GB/docs/cli/reference/commands/save-local.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Sync local translation edits back to the General Translation platform. API reference for the gt save-local command.

Sends any local edits you&#39;ve made to translation files back to the General Translation platform by submitting diffs. It does not queue any new translations — it only syncs your local changes. See [Manage translations](/docs/cli/guides/managing-translations#save-local).

Use it when you or a translator edits downloaded translation files by hand and you want those changes reflected on the platform.

*Note: Requires a project ID and a [saved login or explicit tooling key](/docs/cli/guides/configuring#credentials), with permissions for the requested operations.*

```bash
npx gt save-local
```

## How it works [#how-it-works]

1. Reads your configured files from `gt.config.json`. When `files.gt.output` is configured and `gt-lock.json` records a downloaded GTJSON version, it also includes those generated translation files.
2. Resolves the current git branch.
3. Identifies files that have changed since the last download by comparing content hashes.
4. Fetches the original server content and computes a diff for each changed file.
5. Submits the diffs to the platform. Only changed files are processed.
6. When it has saved at least one diff and publishing is configured or `--publish` is set, applies the configured CDN publish and unpublish rules. With no local changes, it skips publishing.

## Flags [#flags]

| Parameter             | Description                                        | Type      | Optional | Default                       |
| --------------------- | -------------------------------------------------- | --------- | -------- | ----------------------------- |
| `--api-key <key>`     | Explicit tooling key override.                     | `string`  | Yes      | `GT_API_KEY`, otherwise login |
| `--project-id <id>`   | project ID.                                        | `string`  | Yes      | `GT_PROJECT_ID`               |
| `-c, --config <path>` | Path to the config file.                           | `string`  | Yes      | `gt.config.json`              |
| `--publish`           | Use CDN publishing rules after saving local diffs. | `boolean` | Yes      | `false`                       |

## Example [#example]

```bash
# Send local edits to translation files back to the platform
npx gt save-local

# Sync edits and publish the updated translations to the CDN
npx gt save-local --publish
```

## Other notes [#notes]

* The CLI tracks downloaded translations in a lock file and only processes files that have changed since the last download.
* Generated GTJSON output follows `files.gt.publish` when set and otherwise falls back to top-level `publish`; per-file patterns do not apply.
* [`gt translate`](/docs/cli/reference/commands/translate) and [`gt stage`](/docs/cli/reference/commands/stage) do not save local edits by default. Enable the step for one run with `--save-local`, or for every run with [`options.saveLocal`](/docs/cli/reference/config#save-local). Use `gt save-local` when you want to sync edits without starting new translation work.
* Apple `.strings` and `.stringsdict` files, Android `strings.xml` files, and .NET `.resx` and `.resw` files are validated and saved as complete raw documents. For `.xcstrings`, the CLI tracks and submits each locale&#39;s slice separately even though every locale shares one file.
* Never store your API key in `gt.config.json`. The CLI reads `GT_API_KEY` from the environment automatically.

### Version history

| Version  | Changes                                                                              |
| -------- | ------------------------------------------------------------------------------------ |
| `2.25.0` | Added local-edit syncing and configured CDN publishing for downloaded GTJSON output. |

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
