[ckan-dev] Paster command to merge translations from core + plugins

Samuele Santi samuele.santi at trentorise.eu
Mon Nov 25 17:33:35 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As we were discussing in a past thread, it would be handy to have a
paster command to merge translations from ckan and plugins.

For that purpose, I create this issue:
https://github.com/okfn/ckan/issues/1340 and I'm preparing a PR.

Right now, I created a ``i18n-merge`` command that can be used like this:

paster --plugin=ckan i18n-merge --conf=path/to/ckan.ini

What it does is:

- - locate all languages + translations in i18n directories in the ckan
core directory + root packages of all the enabled plugins
- - merge all the .po files under the LC_MESSAGES directories in a po
file inside ckan.i18n_directory
- - compile the new .po -> .mo


Right now I'm using the msgcat/msgfmt commands via subprocess, wich is
not optimal: I'm looking at the babel tools to figure out how to do
that using a Python-only solution.


If you want to know how to make your extension translatable, have a look
here:
https://github.com/opendatatrentino/ckan-custom-translations#how-to-make-extensions-translatable
(I'm going to add that to the official Ckan documentation in a future PR).


Cheers,

- -- 
Samuele Santi

Trento Rise
http://www.trentorise.eu/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSk4nvAAoJEGgM+6dff2m7NHcP/A7oKUSImuqGv6VAk/zV9818
I2BUtl6sXUby/PjtUPT2MgJZ3hjkXuXMGBkb4QYmQb9jGRpCDl3sYtvm0NFR6e17
FDlUVNo4GYiDYu9/yc18dVcpK9XdVX/OPQlKqj9KzbHUFINgPiNbWZMjAVVW0AJQ
miGczGc3+H6tmbSg+mz3Z5Wgac42CTL3YQyCKaZZC1nG0fSw83bI2y0p9X70nv1Z
dQiHC50a50Z4FJC2KCTAZkQP7qOhx0nIiqaXj7rISSi9NzNIGYltQ6uslpVzFi3Q
SMPe8dG9hHkgqX3e5BZppQN4jl+GDbRiyQ+oF/PqZBIUu8llqtKzi0D1LQvVnNP8
jaxx8f3s0IXsytPRerlrfn9BQp6q1SbbwUVc3QW960qioprpi/ClqW7wi/ATQB0p
PA2RdRSUwtwe2rEu1dtSdA72Zq/81h+baf6M8ljX93WOgxBQBhanUBbeVjqdS/Qt
ErF05iDcudZ9X7uYGscc+oJIYcxRXrWAJhiKz94pjvVGXIdgDdD5N8F/Bl6cjqiN
fA0NeZpa1zOEN7+G48JlSbz9CH7UwwPjOKu07XP+B9xlxXbKiGxlmjhOpeUxTLLC
bfD1L0eC3hLJMp7tqp67/08SvYPOMN4EFJ99zCNvFy+m8J0FUNrJmj4YkavRo2sN
cfbaGawINBIX+9RcUfY5
=ms15
-----END PGP SIGNATURE-----



More information about the ckan-dev mailing list