Prerequisities

  • Your app must be prepared for localization.
  • Project in Lokalise (you will need Project ID from project settings)
  • Read/write API token (generate one under your Personal profile)
  • Installed Lokalise CLI tool

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

As the translators are done you need to download the language files from Lokalise:

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

You need to repeat the download for all project languages.

Did this answer your question?