Skip to content

locize/sync

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Locize sync action

Synchronize translation files between your repository and Locize. It uses the Locize CLI behind the scene. For detailed documentation of the Locize CLI, please visit the documentation.

Inputs

api-key

Required The api-key that should be used.

project-id

Required The project-id that should be used.

path

Optional Specify the path that should be used (default: current working directory).

version

Optional The version that should be targeted (default: latest).

format

Optional File format of namespaces (default: json; [nested, flat, xliff2, xliff12, xlf2, xlf12, android, yaml, yaml-rails, yaml-rails-ns, yaml-nested, yml, yml-rails, yml-nested, csv, xlsx, po, strings, resx, fluent, tmx, laravel, properties, xcstrings]).

clean

Optional Removes all local files by removing the whole folder before downloading (default: false).

clean-local-files

Optional Removes all local files without removing any folder (default: false).

update-values

Optional Update values of existing translations on locize (default: false).

auto-translate

Optional Trigger automatic AI/MT translation of updated translations (default: false). When enabled, any new or updated keys synced to the reference language will be automatically translated into all target languages using the project's configured AI or MT provider.

skip-delete

Optional Skip the removal of keys on locize that were deleted locally (default: false).

delete-remote-namespace

Optional Delete a complete namespace on locize if the local file in the reference language was deleted (default: false).

skip-empty

Optional Skips to download empty files (default: false).

reference-language-only

Optional Check for changes in reference language only (default: true).

compare-modification-time

Optional Take file modification time into account when comparing local and remote (default: false).

language

Optional The language that should be targeted.

languages

Optional Comma-separated list of languages that should be targeted.

namespace

Optional The namespace that should be targeted (comma-separated list supported).

language-folder-prefix

Optional This will be added as a local folder name prefix in front of the language.

path-mask

Optional This will define the folder and file structure; do not add a file extension (default: {{language}}/{{namespace}}).

unpublished

Optional Downloads the current (unpublished) translations. This will generate private download costs (default: false).

overridden-only

Optional Downloads only the current overridden (unpublished) translations of a tenant or branch project (default: false).

branch

Optional The branch name (or id) that should be targeted.

dry

Optional Dry run — show what would change without actually syncing (default: false).

cdn-type

Optional Specify the cdn endpoint that should be used (standard or pro, default: standard).

backup-deleted-path

Optional Saves the segments that will be deleted in this path.

Example usage

Basic sync

- uses: locize/sync@v1
  with:
    api-key: ${{ secrets.LOCIZE_API_KEY }}
    project-id: ${{ secrets.LOCIZE_PROJECT_ID }}
    path: locales

Sync with automatic AI translation

- uses: locize/sync@v1
  with:
    api-key: ${{ secrets.LOCIZE_API_KEY }}
    project-id: ${{ secrets.LOCIZE_PROJECT_ID }}
    path: locales
    auto-translate: true

Sync then publish (complete CI/CD workflow)

steps:
  - uses: actions/checkout@v4

  - uses: locize/sync@v1
    with:
      api-key: ${{ secrets.LOCIZE_API_KEY }}
      project-id: ${{ secrets.LOCIZE_PROJECT_ID }}
      path: locales
      auto-translate: true

  - run: npx locize-cli publish-version
    env:
      LOCIZE_API_KEY: ${{ secrets.LOCIZE_API_KEY }}
      LOCIZE_PROJECTID: ${{ secrets.LOCIZE_PROJECT_ID }}

Sync a specific branch

- uses: locize/sync@v1
  with:
    api-key: ${{ secrets.LOCIZE_API_KEY }}
    project-id: ${{ secrets.LOCIZE_PROJECT_ID }}
    path: locales
    branch: feature-v2

About

Sync translation files from Locize.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages