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

Samuele Santi samuele.santi at trentorise.eu
Tue Nov 19 13:47:31 UTC 2013


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

On 11/19/2013 03:09 AM, Vitor Baptista wrote:
> Hi Samuele,
> 
> That looks like the best approach, while we don't figure out a way
> to fix it on core. My Makefile skills are a bit rusty, but it feels
> like your plan was to create a way to compile many plugins'
> translations from a single Makefile, right?


In my specific use-case, I'm not only merging translations from core +
plugins, but also allowing to customize the merged translations, so
the Makefile came in handy to handle "recompilation" only of the
changed parts, etc.


> I wonder that, with some conventions, we can't figure out a way to 
> develop a single executable file to do it. My ideal would be
something like:
> 
> $ setup-ckan-i18n --ckan-dir=ckan --ckanext-dir=ckan/ckanext


Of course, it would be possible to create a paster command that does
something like this:

- - aggregate translations from core + plugins (this part needs some
care, as the correct procedure is to merge POTs first, and then merge
translations in the newly created POT)

- - install new translation PO files in ckan.i81n_directory (and compile
them to MO)

> And it'll go over ckanext-dir, looking for everything that looks
> like a .po file, compile it, and overwrite CKAN's translations. If
> we agree on following the structure
> "i18n/<lang-code>/LC_MESSAGES/ckan.po", that should work.


It should be possible to do all the paths discovery automatically, by
just passing the path to ckan configuration file.



> We'll have some problems for, for example, asking for a plugin to
> be parsed before another, but I think there are many advantages for
> this approach. Mainly that we don't replicate these Makefiles in
> every plugin that needs new translation files.

I'd use the order in which plugins are listed in configuration file,
for that.



If we all agree on the creation of a new paster command for merging
translations, I'm going to write that and send a 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/

iQIcBAEBAgAGBQJSi2vzAAoJEGgM+6dff2m7A3YQAImPKewmO0VGdPzX6tbBDXav
9JnHYGeJsafspljpHvT9mD9cKAB+YE0RWacp+kkWqBNnS5lUvranVwVtHa0k7QSn
cdF4Sl0K8uqiYRWz78IY59JVdZUIyRXCi4/ixRk4TtZqyluWighd30gRpdrpbRZi
JAqgrGeoDpOD8ZAcOFBFJE/FoNSd32pLR4ZyBlUElWI9WEv7H49Qeo2R5sSg+ueU
BpLZD+MrgxA2iKL6ITAWyEk1wzYrdaAAl1crQBlAimryYYT4ZQYY88qE7h2BBxzU
6T2/ALfliH6llzrcsz8pWgMs6LRgL2vgVobxmt66XBui4ClmURSPqAgIImmpNWOO
Y7P8vwq/UcmgOV/8ZEFnXzhwM6WJd95pqQpYb8M5fUfoigutP1jtY+h8VrgAJCGw
/k5dLtlZIbc5ocWFJh58O8yKy3SxXjqHL5rcrU3jtBbhK16pwZAGGy+31zUtQTUL
9q/sNnW//TCkU4XGdye6o9YaY7T9Ys11Pqnci44mSUyhMaqowLsLONvQ7PtOHVB/
jucdkeciM7Cj0b0Df7AEW8bJyTPFrpvXhb2aBb4Dxg/z26mCzSNWlT9l6A9B2DUl
VHnI0cH8PMo9J8bq985BJXEUqv/LBYl0rqA7swRR5ibB/eugpS0HTVTBr3bH/dHM
RpTZ5Dk+QfYpIkJvxa6c
=D8R3
-----END PGP SIGNATURE-----



More information about the ckan-dev mailing list