Skip to content

Add example of client side po, maybe abide it ? #15

Open
xaiki opened this Issue Nov 19, 2012 · 1 comment

2 participants

@xaiki
xaiki commented Nov 19, 2012

I had to look around quite a bit to find a way to integrate i18n-abide into my project,
and I'm thinking maybe we can automate somehow ?

so, I'm serving precompiled jade templates to my backbone views, the problem is, that I can't find an elegant way to add translation before compiling my jade, or hook into jade so that it does call gettext on the server.

so I resolved to gettext on the client side, for that I'm using Jed, and sending my po data as json via po2json

do you think it might be reasonable to add something like this to the docs ?
https://github.com/inaes-tic/mbc-playout/blob/master/routes/index.js#L18
https://github.com/inaes-tic/mbc-playout/blob/master/public/js/main.js#L66
https://github.com/inaes-tic/mbc-playout/blob/master/views/templates/medialist.jade#L11

cheers,

@ozten
Mozilla member
ozten commented Jan 31, 2013

This is very cool! We should evaluate moving to mikeedwards' po2json.

This repo actually has a po2json already, which might cause some confusion. I didn't document how to use it yet, but am porting browserid, which is causing me to re-work this. browserid does mostly client side translations.

Current toolchain is gettext to create PO files, po2json.js to create .json files. Then those can be loaded server side or client side.

Thanks for your examples of how you solved this outside of i18n-abide.

@ozten ozten added a commit that referenced this issue Feb 6, 2013
@ozten ozten Removing use of eval. Fixes Issue #19
A more robust fix needs to be coordinated in mozilla/browserid
as well as Issue #15.
648dec4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.