CLI: Get started

Last modified: October 17, 2022Author: Jakub Pomykała

Use SimpleLocalize CLI to synchronize your translation files with local files. Manage translation strings in the translation editor.

Installation

# macOs / Linux / Windows (WSL)
curl -s https://get.simplelocalize.io/2.1/install | bash

# Windows (PowerShell)
. { iwr -useb https://get.simplelocalize.io/2.1/install-windows } | iex;

The script above will download the latest version and replace the current version if installed. Troubles with CLI? See troubleshooting section.

Usage

simplelocalize -c config.yml [COMMAND] --apiKey <PROJECT_API_KEY> rest of parameters...

You can omit -c config.yml and provide all parameters inline, or create simplelocalize.yml file which is loaded as default configuration.

Available commands

  • upload - upload translations files,
  • download - download translations files,
  • extract - find translations and translation keys in project sources,
  • sync - combines upload and download commands and command options.

Sample configuration file

By default, CLI will try to load configuration from simplelocalize.yaml file. You can override loaded file using -c parameter before command name.

# Common
apiKey: API_KEY

# Upload command
uploadPath: ./src/translations.json
uploadFormat: multi-language-json
uploadOptions:
  # by default, the 'upload' command only adds new keys and fills empty translations,
  # add this option to overwrite existing translations with values from the uploaded file
  - 'REPLACE_TRANSLATION_IF_FOUND'

# Download command
downloadPath: ./src/translations.json
downloadFormat: multi-language-json
downloadOptions:
  - 'WRITE_NESTED'

# Sync command uses upload and download command options

# Extract command
searchDir: ./src
projectType: yahoo/react-intl
ignoreKeys:
  - 'WELCOME'
  - 'ABOUT-US'

# Business plan options
customerId: ikea

See all available download and upload options

Authorization

Each CLI command needs to be authorized with --apiKey. The API Key can be found in 'Integrations' tab of your project, please see the screenshot below.

SimpleLocalize API Key