[ckan-discuss] Translation of custom templates?

Toby Dacre toby.okfn at gmail.com
Sat Jan 12 05:16:39 GMT 2013

On 10 January 2013 16:20, Sean Hammond <sean.hammond at okfn.org> wrote:

> > A example on how I plan to translate pages is:
> >
> https://github.com/openumea/openumea-theme/commit/788143f67b4df95d31ab2b0f4439f4da121dd11c
> I wouldn't recommend using a Genshi <py:choose> for every string that
> gets translated. Just pass translatable strings in your Genshi templates
> to the translation function _ in the usual way, IIRC it looks something
> like this in Genshi: ${_("Hello World)}.
> Then make the translations available to CKAN following the process I
> outlined in my previous email.
> > The other way I thought about was to hook in another translator in the
> > template chain to be able to translate our added strings. I don't have a
> > working prototype but the plan would be to add a extra_translations
> > config and in ckan/config/environment.py:~200 add a extra Translator()
> > that uses the extra translations as a second translation step.
> But can't you just add a "message extractor" in your setup.py file as I
> explained in my previous email? Maybe CKAN should support specifying
> extra message extractors in the ini file so you don't have to modify the
> setup.py file, but modifying the setup.py file isn't hard anyway.

Maybe we should allow extensions to specify extractors so for instance just
plugins = ... would be enough I haven't thought this through very much but
seems like it would be easy enough

> _______________________________________________
> ckan-discuss mailing list
> ckan-discuss at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-discuss
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-discuss/attachments/20130112/efaae45e/attachment.htm>

More information about the ckan-discuss mailing list