Docs
Platform
PlatformSynchronise Changes

Synchronise Changes

Learn how to keep your content changes in sync between our platform and your applications.

Translations lifecycle

Localesy keeps an internal copy of your translations. We use this copy to keep track of changes and allow you to conveniently manage your translations.

Content of your translations in Localesy will often differ from the content in your codebase. This is because you may have added new translations, removed old ones, or updated existing ones - all of which is perfectly normal 👍

To keep your translations in sync with your codebase, you can do the following actions:

  1. Pull changes from your codebase to Localesy - if your codebase has changes that are not reflected in Localesy, you can pull them to Localesy.
  2. Push changes from Localesy to your codebase - if you have made changes in Localesy that are not reflected in your codebase, you can push them to your codebase.

You can synchronise changes in two ways: through the Github integration in the Platform, or with the CLI straight from your codebase.

Pulling changes to Localesy

Pulling changes from your codebase to Localesy requires you to have an active Github connection.

To start pulling changes, follow the steps below:

  1. Navigate to your project page.
  2. Click on the "Pull from..." dropdown and select "Github" option.
  3. Localesy will detect the changes and show you a Diff Engine modal.
  4. Select changes that you want to apply in Localesy.
  5. Submit the changes - Localesy will apply selected changes.

Note: Pulling changes through the Platform is only available through the Github integration. If your project is not on Github, use the CLI to sync directly from your codebase.

Pushing changes from Localesy

Pushing changes from Localesy to your codebase requires you to have an active Github connection.

To start pushing changes, follow the steps below:

  1. Navigate to your project page.
  2. Click on the "Push to..." dropdown and select "Github (Create PR)" option.
  3. Localesy will detect the changes and show you a Diff Engine modal.
  4. Select changes that you want to include in your Github Pull Request.
  5. Submit the changes - Localesy will create a Pull Request in your Github repository.

Note: Pushing changes through the Platform is only available through the Github integration. If your project is not on Github, use the CLI to write translations back to your codebase.

Syncing with the CLI

If you prefer to work from your terminal - or want to sync inside a CI/CD pipeline - use the Localesy CLI:

localesy sync

localesy sync pulls remote changes and pushes your local changes in a single command, with key-level conflict resolution and file rename detection. You can also run it one-way with --pull-only or --push-only. Learn more in the sync command.

Export translations

You can also export your translations to a JSON file. This is useful if you want to use Localesy as a single source of truth for your translations.

To export your translations, follow the steps below:

  1. Navigate to your project page.
  2. Click on the "Pull from..." dropdown and select "Export translations" option.
  3. Localesy will prompt you to download a JSON file with your translations.

Future improvements

The current approach works well for projects hosted on Github and via the CLI, however we want to cover more use cases in the future:

  1. Support more Git Providers - introduce support for platforms like Gitlab, Bitbucket and more.
  2. Support more file extensions - export translations to XML, CSV and more.
  3. Sync using Webhooks - allow external integrations using webhooks.
  4. Localesy Cloud - fetch translations directly from Localesy in your applications.

If you want to prioritise any of the above, please let us know by requesting a feature or contacting us directly.

Was this helpful?
Docs
Copyright © Localesy. All rights reserved.