[ckan-dev] CKAN extension translations
Samuele Santi
samuele.santi at trentorise.eu
Wed Nov 13 14:01:50 UTC 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/13/2013 01:16 PM, Roope Setä wrote:
> Hi!
>
> I need to do translations for CKAN extension. I tried to find
> relevant information from documentation and looked into extensions
> that use i18n.
>
> Documentation I found was not related to extensions and none of the
> projects that I found did not seem to use the i18n files they have
> (packaging did not include files or the files were not used from
> source as far as I could see).
>
> So my question; is there documentation how to do this or is there
> any project that I could use as example?
>
> I do not want append those translations into ckan.mo.
>
> Thanks, Elias
Hi, I just had & solved the same issue a couple days ago (see my email
from yesterday, in this list).
In short, I did this:
First, to translate the plugin, I added babel configuration to extract
messages and merge strings.
See the documentation here:
https://github.com/opendatatrentino/ckan-custom-translations#how-to-make-extensions-translatable
and the project I was working on here:
https://github.com/opendatatrentino/ckanext-datitrentinoit
Then, I ran commands to extract strings & translated them.
Then, I created this Makefile:
https://github.com/opendatatrentino/ckan-custom-translations/blob/master/Makefile
that automatically aggregates all the translation templates from the
ckan core + a configurable bunch of plugins, and merges translations
along with them, thus creating .po/.mo files with all the strings,
aggregated from all the sources.
In order to use them in Ckan, I added a configuration option to point
to a folder containing an ``i18n`` folder containing the output
generated by that Makefile:
[app:main]
ckan.i18n_directory = /path/to/translations/root
Hope this helps.
I'd like to hear some feedback about this, from other people too, then
I'm going to add this to the official documentation, as the current
method of translating plugins / customizing translations.
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/
iQIcBAEBAgAGBQJSg4ZNAAoJEGgM+6dff2m7apwQAIIkcJfz7dZQrcx/i+KCOrju
Ttz2mebooLCopjSPD0mSHRXeOymTvcmCR88hq1uzpg4jBe4Tf/UIrZcLxRTkEQZ9
A6/UeWYqkIobuHMIi6fwQ6JST8dD4S4rtBhB1cTlHPgbfWdB5g8QOcX5+ZLbkLgM
0RcgzwPkoSrXdRIdrZlZ+kbib7FA8bY/rvMY5jJxlsMYW3P4fkGDrK2VVCv+iUPX
mf+vxDx1nIKbYkwzXXlbyw1VYvffpTshSuqPAnLESEg5BxLC8degb0Ipc7lQk3GE
NRjazJBvyLtWZkHPkWqlEt6+9saBm7szF4yqXIfYiuY3UTKkHoyAJlcCOzeu53sW
loCA3M1y+gDI4B/jU9+SmY10qWibJOKpaiHqySp3xA2+WgieENfzRWgADKLfQVPw
Gg8NeEwQF8sLx+pi/j6gDpagwAIvmSEwP/LXBe5v2vMSRGgwNUfnVWPrpqbOvs2V
Tb6Y3AeHi8yP50/3wdYDfv98EEsInq7sZ6NeSPGJh8WMUs20lj5W+C52U711kUZn
Ztbuot8ZsnsbmbjdLa0rRP//hxrky/LCRoJZuxeRF518H4ghB7HazRY+cn9RwfCW
7lG68U+I1SWJYDwV8qdNcQ/CeufMrHSYagwYjStjTBNNIKHXS/Fa2pcRphfqJYWF
rFN5ChmJ511nnMnipSPQ
=ZSX4
-----END PGP SIGNATURE-----
More information about the ckan-dev
mailing list