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

Vitor Baptista vitor at vitorbaptista.com
Tue Nov 19 02:09:34 UTC 2013


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?

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

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.

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.

What do you think?

Cheers,


2013/11/12 Samuele Santi <samuele.santi at trentorise.eu>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I just figured out a way of extracting + translating strings in
> plugins too, and building custom translations on top of that.
>
> While the "loading strings from plugins" part needs some care in the
> core code, this method works as well (and it's quite handy too, by
> using some tools to automate work).
>
>
> This is the main repository, containing:
>
> - - A README with instructions on internationalizing extensions
> - - A Makefile to merge together translation templates and
>   translations from a bunch of plugins, along with the core
> - - A i18n directory, containing my custom translations :)
>
> https://github.com/opendatatrentino/ckan-custom-translations
>
>
> The idea is: if you need to create custom translations, just fork that
> repository, make some changes to the configuration part of the Makefile
> and start translating right away.
>
> Or you can just create a fresh project, just copy the Makefile over..
>
>
> I'm adding this to the documentation too and sending a PR, but first I
> wanted to hear some feedback.
> Is it clear how this works? Do you need some extra information? Did
> you have any trouble using this?
>
>
> 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/
>
> iQIcBAEBAgAGBQJSglruAAoJEGgM+6dff2m7wfIP/RQGygj4I6W1rvvAQMafzakq
> FdgRUXeKzt8j0wl4hL282cMDizL4e/TrVGBvn8IGQbPPWw0D0PvoLBQo/NwyEDnN
> 2Hr7yJ3tNQcif/D1QsmJrNpkwxBOYQL4SCbFrcR+Ol9qwW4FGYSHwlTPHx+AEnnk
> XAlHdamazRgv86yIcQga1ubJ+e+KkJgmb3/4J6PvNuGn6ePWFKulRudseCtLMmLy
> n68ioBd8tP1JMMdDHpsmScirhJSUhur+exIUiM8BVZPaQr0o/vJbaTMUdpdMAfbG
> y9CL5WGuAxuWvJC0IFDvwKp7yyNeLLDotbGipXbG9oQqbwObZESnFcNAOwdGqRL9
> Q5LpsBZcPAGAhP9qktwJDkv0NH8JKM+GHoCCa6cwj1MTa3l7bdGCFhjzHyL5kxy0
> vZ5Vr7sOlyF3o1IldBtt64WOIJS+WmPJJtGp+DKYn+TtABThnP3SPvZHXAIMyZYX
> t81qG/oHVUNm2ArGjP+c3N+3+QiMaPcZj7+ZBgTkrD8u7QtrB+pH0U0ll4Rvlumc
> XRz5VV9XtBHPswd9Wh7H7GyJsvB+o47g9t99iJZ+HHhXmi6rcOLl936eyURT7cQu
> 6xyVN3H76z0Qdlva2+9QOvb6n6s+jqIf9udFU3Vwrg/xof2wCYoOJhRJwI+AEAZl
> WCsMyuilMv63gdEJPa2M
> =dKPD
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>



-- 

Vítor Baptista

Developer  |  http://vitorbaptista.com |
LinkedIn<http://www.linkedin.com/in/vitorbaptista>|
@vitorbaptista <http://twitter.com/vitorbaptista>

The Open Knowledge Foundation <http://okfn.org>

*Empowering through Open Knowledge*

http://okfn.org/  |  @okfn <http://twitter.com/okfn>  |  OKF on
Facebook<https://www.facebook.com/OKFNetwork> |
Blog <http://blog.okfn.org/>  |  Newsletter<http://okfn.org/about/newsletter/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20131119/8d178287/attachment-0003.html>


More information about the ckan-dev mailing list