Prerequisities

  • Your CakePHP app must be prepared for localization (see CakePHP 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/locale/en/LC_MESSAGES/default.po . Upload this file to Lokalise using CLI tool:

$ cd myapp
$ ./manage.py makemessages -l en
$ lokalise --token <token> import <project_id> --lang_iso en --file locale/en/LC_MESSAGES/default.po


Downloading from Lokalise

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

$ lokalise --token <token> export <project_id> --langs en --type po --no_language_folders 1 --use_original 1 --unzip_to locale/en/LC_MESSAGES/

You need to repeat the download for all project languages.

Did this answer your question?