CLI: Upload translations

Last modified: March 31, 2022Author:Β Jakub PomykaΕ‚a

Upload existing translations or translation keys from your local project files. The uploaded translations and translations keys you can find in the translation editor.

upload translations

πŸ’Ώ Installation

Install SimpleLocalize CLI

curl -s https://get.simplelocalize.io/2.0/install | bash

Do you have troubles with CLI? See troubleshooting section.

πŸ‘¨β€πŸ’» Usage

simplelocalize -c config.yml upload --apiKey <PROJECT_API_KEY> ...

Upload translations with CLI

Example: Upload translations from one file

.
└── locales
    └── all-translations.json
simplelocalize upload \
 --apiKey PROJECT_API_KEY \
 --uploadPath ./locales/all-translations.json \
 --uploadFormat multi-language-json

Learn more about multi-language-json.

Example: Upload translations from multiple directories

.
β”œβ”€β”€ ca
β”‚   └── translations.json
β”œβ”€β”€ en
β”‚   └── translations.json
└── es
    └── translations.json
simplelocalize upload \
 --apiKey PROJECT_API_KEY \
 --uploadPath ./{lang}/translations.json \
 --uploadFormat single-language-json

Example: Upload translations from multiple directories and files

.
β”œβ”€β”€ ca
β”‚   β”œβ”€β”€ common.json
β”‚   └── home.json
β”œβ”€β”€ en
β”‚   β”œβ”€β”€ common.json
β”‚   └── home.json
└── es
    β”œβ”€β”€ common.json
    └── home.json
simplelocalize upload \
 --apiKey PROJECT_API_KEY \
 --uploadPath ./{lang}/{ns}.json \
 --uploadFormat single-language-json

See all available upload formats

Upload options

Many upload formats offers additional options. You can activate them using --uploadOptions parameter.

simplelocalize upload \
 --apiKey PROJECT_API_KEY \
 --uploadPath ./translations.json \
 --uploadFormat multi-language-json \
 --uploadOptions UNESCAPE_NEW_LINES,PUBLISH_AFTER_IMPORT

See all available upload options