[ckan-dev] How to activate and compile CKAN internationalization files within an extension

Ralf user66 at arcor.de
Mon Nov 4 09:43:59 UTC 2013


Hi John,

great tip.

Advantage against overwriting the originals with msgcat/msgfmt: You  
don't touch files within "src/ckan" git working directory.

The problem with this approach is that users can only use the  
languages which have been put into your extension - or you need to  
copy all missing languages from the original dir to the new place.  
Well, of course this is also manageable by just limiting the languages  
in the ini file.

Cheers
Ralf


Zitat von John Glover <john.glover at okfn.org>:

> Hi,
>
>
>  1) How to I initialize my customized translations to be used instead of
>>> the standard ones?
>>>
>>
>> In my setup I just copy the compiles files in the CKAN directory
>> (pyenv/lib/python2.7/site-packages/ckan/i18n). Afaik there is no way to
>> include them from your extension directly (unlike e.g. templates).
>>
>
> Actually this should be possible. You cannot currently have translations in
> multiple locations (so you cannot just override a few core translations
> like you can do with the templates). You can however create an i18n
> directory in your extension, then give the path to it using the
> ckan.i18n_directory config option, and CKAN will load all translations from
> this directory.
>
> We do this in the EU Open Data Portal extension which is based on CKAN
> 1.8.x, but as far as I know this should still work in 2.x.
>
> Cheers,
> John






More information about the ckan-dev mailing list