Skip to main content
Grunt

Localizing with the CLI tool.

Nick Ustinov avatar
Written by Nick Ustinov
Updated over a week ago

Lokalise can be used with Grunt.

Prerequisites

  • Your app must be prepared for localization.

  • You'll need an existing Lokalise project. Specifically, you'll require the project ID that can be found in the project settings.

  • A read/write Lokalise API token is required. Learn how to work with the API tokens in the corresponding article.

  • The Lokalise CLI tool must be installed.

  • In order to run the Lokalise CLI tool from grunt, you will need to set up the grunt-exec package.

Uploading to Lokalise

$ lokalise2 \
 --token <token> \
 --project-id <project_id> \
 file upload \
 --file "myapp/locale/en/\*.json" \
 --lang-iso en


Downloading from Lokalise

When the translations are done, you'll need to download the language files from Lokalise:

$ lokalise2 \
 --token <token> \
 --project-id <project_id> \
 file download \
 --format json \
 --original-filenames=true \
 --unzip-to "myapp/locale/"

Run a similar command for all other project languages.

Did this answer your question?