[ckan-dev] i18n in JS stuff

Friedrich Lindenberg friedrich at pudo.org
Tue Dec 7 22:18:08 UTC 2010


On Dec 7, 2010, at 10:36 PM, Richard Pope wrote:

> On Tue, Dec 7, 2010 at 9:24 PM, Friedrich Lindenberg <friedrich at pudo.org> wrote:
>> Hi all,
>> 
>> I'm currently adding a few more pieces of i18n to CKAN - many of the form options and html templates are not actually internationalized on closer inspection. While this doesn't kill us with community catalogues, with Helsinki and the Netherlands its a real showstopper.
>> 
>> Most of these are fixable, but some of them are in JS that doesn't currently go through any i18n filters (e.g. "Add a new resource" js link, "More >" links). Does anyone here have an idea as to how those can be externalized?
> 
> I think the one time I've been involved with something like this
> (using php & smarty) we ended up serving a language.js file as a
> php/smarty file. i.e. using the same system as the html. Would look
> like:
> 
> language.js:
> 
> var WELCOME_MESSAGE = {__($welcome_message)}
> 
> main.js file:
> 
> alert(WELCOME_MESSAGE);
> 

As far as I can tell, thats also pretty much what the jquery folks do. Would anyone consider it terrible abuse to channel this through HomeController? 

Friedrich 

>> 
>> Cheers,
>> 
>> Friedrich
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>> 
> 
> 
> 
> -- 
> /*
> richard at memespring.co.uk
> memespring.co.uk
> ++44 7976730458
> memespring (flickr/skype/etc)
> memspr (aim)
> */
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev





More information about the ckan-dev mailing list