CLI 2.0 with multi-file support

Jakub Pomykała
Last updated: 3 min read
CLI 2.0 with multi-file support

Hey there! In the latest update, I implemented a frequently requested feature which is multi-file support in a new version of SimpleLocalize CLI, and I wanted to share with you how to use it. See the below updates that should help you in your daily translation and management work with SimpleLocalize. ☺️

How to download translation using command-line tool

Multi-file support

Multi-file support gives you a possibility to upload and download files which have a structure like below.

.
├── ca
│   ├── common.json
│   └── home.json
├── en
│   ├── common.json
│   └── home.json
└── es
    ├── common.json
    └── home.json

The newest version of CLI will automatically detect if you are trying to upload or download files with namespaces and/or languages. Namespaces in the example above are home and common, and languages are ca, en, es.

How to upload translations?

To upload such structure of translations, you can simply run command like below:

simplelocalize upload
  --apiKey <PROJECT_API_KEY>
  --uploadPath /{lang}/{ns}.json
  --uploadFormat single-language-json

In the example above, {ns} is a namespace and {lang} is a language.

See upload command documentation page.

How to download translations?

Once you finish translating your content, you can run a download command to update translation files or/and add new ones!

simplelocalize download
  --apiKey <PROJECT_API_KEY>
  --downloadPath /{lang}/{ns}.json
  --downloadFormat single-language-json

See download command documentation page.

Options flag is now available

You can use CLI to download all available file formats. Some formats offer additional options, for example if you would like to download an Excel file with translations and translation key descriptions, you can run:

simplelocalize download
  --apiKey <PROJECT_API_KEY>
  --downloadPath /locales/translations.xlsx
  --downloadFormat excel
  --downloadOptions INCLUDE_DESCRIPTIONS

You can see currently available options in the 'Data' tab in the project view, when Developer mode is turned on in the top-right corner.

export translations section

Additional options are also supported in the Upload command, and you can apply them respectively with --uploadOptions parameter.

Faster CLI and smaller file size

SimpleLocalize CLI 2.0 brings many small improvements, one of those is much smaller CLI size. The newest version is only 15 megabytes, comparing to the previous 1.1.x version with 50 megabytes. CLI still has zero dependencies, which means you don't need to have Java, Python, node or any other software to run the CLI.

Other improvements:

  • better compatibility between operating systems,
  • new API which responds much faster for CLI requests,
  • better error handling,
  • more meaningful error messages.

How to update or install CLI?

To install CLI version 2.x, you can invoke the command below. It will automatically detect your operating system and download SimpleLocalize CLI. If you would like to download CLI executable manually, without the script, you can find all CLI releases on GitHub.

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

How to check what CLI version I'm running?

You can simply check what is your current CLI version by running CLI with --version parameter.

simplelocalize --version
or
simplelocalize-cli --version
or
./your-downloaded-simplelocalize --version

Troubleshooting

If you have any troubles with CLI, please visit troubleshooting page for solutions. You can also report the problem on GitHub.

What's next?

In the upcoming weeks, I would like to focus on adding more CLI small features based on the given feedback.

Keep an eye on changelog, my Twitter or SimpleLocalize Twitter. Thank you all for your e-mails and all the feedback you provide me with. Have a great day! ☺️

Jakub Pomykała
Founder of SimpleLocalize

Relevant posts

Stay up to date with the latest news

Step-by-step localization workflow for developers

Step-by-step localization workflow for developers

Jakub Pomykała
6 min read

Step-by-step guide to setting up a localization workflow for developers. Learn how to extract text for translation, manage translations, and integrate them into your app.

Namespaces in software localization

Namespaces in software localization

Kinga Pomykała
6 min read

Namespaces are a great way to organize translations in software localization. Learn what namespaces are, why they are important, and how to use them in your localization process.

How to localize React app using i18next

How to localize React app using i18next

Kinga Pomykała
18 min readSeptember 02, 2024

Learn how to localize your React app using i18next and react-i18next. This step-by-step guide will show you each step of React app internationalization from scratch.