Transifex
Translations are managed in Transifex. Each CKAN extensions has its own resource in Transifex and in addition, wordpress has a single resource which covers all of the wordpress translations.
Translations from codebase to Transifex and back are handled via .po files which are uploaded and downloaded with the help of Transifex client.

CKAN

Translations for CKAN consist of translations of extensions and translations of the CKAN itself. If the translation shown on UI does not exist in projects transifex resources, it comes from CKAN core translations. If someone wishes to change the translation, he needs to add translated key to the extension, where it overrides the core translation. If multiple extensions have the same translated key in their .po files, all need to have the same translation.

Generating translation files

Translations in CKAN extensions mostly follow the official documentation. In summary, following commands should cover most of the cases.
1
// Activate virtual environment
2
. /usr/lib/ckan/default/bin/activate
3
​
4
// Run rest of commands for single extension
5
cd /vagrant/ckanext/ckanext-sixodp_ui/
6
​
7
// Extract messages for extension
8
python setup.py extract_messages
Copied!

Translating in Transifex

The newly generated translation files can be uploaded and downloaded to transifex with the following commands:
1
// Upload to transifex
2
tx push -s
3
​
4
// After translated in transifex, download the translated files
5
tx pull
Copied!

Compiling translations

Translation files can be compiled by running following commands:
1
// Activate virtual environment
2
. /usr/lib/ckan/default/bin/activate
3
​
4
// Run rest of commands for single extension
5
cd /vagrant/ckanext/ckanext-sixodp_ui/
6
​
7
// Compile translation files
8
python setup.py compile_catalog -f
Copied!

WordPress

Generating translations for WordPress is done manually with makepot.php. Translation tools in wp-cli cannot be used as the version is use is too old for them and it cannot be updated until automating polylang is replaced with something as polylang-cli was abandoned. makepot.php assumes specific folder structure and following commands should generate translation files.
1
// Run in vagrant home /home/vagrant
2
cp -r /vagrant/sixodp/ sixodp
3
cp -r /opt/wordpress/ src
4
cd sixodp/tools/
5
php makepot.php wp-theme ../ /vagrant/sixodp/i18n/sixodp.pot
Copied!
After being pushed and pulled from Transifex, following commands will compile the translations files:
1
msgfmt /vagrant/sixodp/i18n/en_GB/LC_MESSAGES/sixodp.po -o /vagrant/sixodp/i18n/en_GB/LC_MESSAGES/sixodp-en_GB.mo
2
msgfmt /vagrant/sixodp/i18n/fi/LC_MESSAGES/sixodp.po -o /vagrant/sixodp/i18n/fi/LC_MESSAGES/sixodp-fi.mo
3
msgfmt /vagrant/sixodp/i18n/sv/LC_MESSAGES/sixodp.po -o /vagrant/sixodp/i18n/sv/LC_MESSAGES/sixodp-sv.mo
Copied!

Other notes

There are some tools which may or may not work in https://github.com/6aika/sixodp/tree/master/tools for CKAN and in https://github.com/6aika/sixodp/tree/master/sixodp/tools for WordPress.