Manual
CLI
API
Log in Get started free

Set up the CLI

Create a project key, add a ct.yml, and push your first strings.

Create a project key
In Continuous Translations open Project settings → CI & CLI and create a project key. Store it as the secret CT_API_KEY in your CI.
Add a ct.yml

Put a ct.yml in the root of the repository. ct init writes one for you:

SH
ct init --project 12 --source locales/en.json --pattern "locales/{lang}.json"
Push on every push
Run ct push in your pipeline. ct snippet github and ct snippet gitlab print a ready-made job.

ct.yml #

ct.yml
project: 12
format: json                       # see File formats
# sourceLanguage: en               # language code of the source file (default en)
source: locales/en.json
translations: locales/{lang}.json  # {lang} is replaced by the language code
defaultBranch: main                # the Git branch that maps to CT's main branch
# prune: true                      # delete keys from CT when they leave the source file
SettingDescription
projectThe project to sync with
formatThe file format, see File formats
sourceLanguageLanguage code of the source file, en by default
sourceThe file with your source strings
translationsWhere translations are written. {lang} is the language code
defaultBranchThe Git branch that maps to the main branch in Continuous Translations
pruneDelete keys from Continuous Translations when they leave the source file

Environment #

VariablePurpose
CT_API_KEYThe project key. Required
CT_API_URLThe API to talk to. Defaults to https://api.continuous-translations.com
CT_BRANCHThe branch to use, see Commands