[ckan-dev] Translating plugins & custom translations how-to

Samuele Santi samuele.santi at trentorise.eu
Tue Nov 19 15:50:45 UTC 2013


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

On 11/19/2013 04:39 PM, Ian Ward wrote:
> This sounds good, but does it handle changes to the upstream 
> translations well? Do you copy all the translations into your 
> extension, overriding later changes made upstream?

In my specific case, I'm overriding upstream translations with my own,
as there are some quite bad translations we wanted to improve.

But the correct path would be to contribute them directly to the
translations in core, with PRs, as you do with the code (but this
makes up to another discussion about the whole translations management).


> How do you handle translations for different sets of plugins? Are 
> there any problems with sharing translations with this scheme?

My idea of how the paster command should act:

* First, merge string templates from core + plugins in a single POT
* Then, use ``msgcat --use-first ckan.po ext1/.../ext1.po
ext2/.../ext2.po`` to create a PO with all the current translations
for the core + plugins. In this case, strings in the core override
strings in plugins (which I think is OK, as the translations in the
core are the "official" onese)
* Then, use msgmerge to create a .po file by filling translations in
the POT with translations from the PO created in step 2.

(of course, steps 2 and 3 should be done for each language)


Translatable plugins should:

- - Add this configuration in order for babel to successfully operate:
https://github.com/opendatatrentino/ckan-custom-translations#how-to-make-extensions-translatable

- - Create custom POs by merging ckan core translations first, then
adding custom translations for the untranslated strings. Strings
should be kept up to date with the core (although this is not strictly
necessary, as translations in the core would take precedence anyways..
it serves mostly as an indication of what is already translated).

- -- 
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/

iQIcBAEBAgAGBQJSi4jVAAoJEGgM+6dff2m7x3sQAKpDi/G7cYIYKHbmy3rzy/4I
+BjvmzYGt+F73yPZiK6damiVO0bDUwTcZ2UojDbvYaeKpqt26KnM7hW6aCfIQB7/
rCAsgipTrXUlUd0ZFYYZaKTbDLbvW9GktvUu97cb7ORwwvGhDAgEVliqvG8TKo0H
AXHQbjQHI6BUSSkjfG370EPTFcEIhbMuUI7BCpvw0hP1kgxj/Sd1HFNq/RD2DbvN
X3E6wu48b+1dvkseAzUvOWPtRfC8d2QCnzDjzSfimOi9qOp/63VslMjjXu6TAU4w
V3bqKzMgP5Adi9uPnlpT1pF5IImG3oxsMx1/hQNNjtLcEN0jfyVSCplNfCf/7RAB
4JL+6WIhPyUANJ8klp+JtJ8rkdKG+TFpnVGBwfoj4AlA/2bG0p4tw2mvCs6rI1Tg
Qsio1eKvzJRroAJZNFYtG7VESa68P3Bg/OuYNuZdKdmb+xZE7J0ZmlyacxLMTObK
0PZjD6fShE0proFgryWiFAjscOpAy1HhcMGVFAy65hMVqmdUi5d4P2Gvtjg1up7O
bYruo99ZIVJIpYHImjviWhrVxBr9G17bAextba9SKqDo4h7BHYRhD/2MghlEg+0t
vsd96Gidr2OpeFtswT0dd7ghnRR+8qXcYWyzR4HdrVHD6dTN5zlRK3dny8HSlnMD
WQ0L5XcYCwWWTDOQ+QYZ
=RrJH
-----END PGP SIGNATURE-----



More information about the ckan-dev mailing list