Prerequisities

  • Your RoR app must be prepared for localization (see RoR documentation)
  • 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


Uploading to Lokalise

Once your app is prepared for localization, it should contain source language (we assume it's English) locale directory. e.g. myapp/config/locales/en.yml . Upload this file to Lokalise using CLI tool:

$ lokalise2 \
 --token <token> \
 --project-id <project_id> \
 file upload \
 --file "myapp/config/locales/en.yml" \
 --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 yaml \
 --original-filenames=false \
 --bundle-structure "%LANG_ISO%.yml" \
 --unzip-to "myapp/config/locales/"

Did this answer your question?