grosser/gettext_i18n_rails — pull request #74 by nubis (2012-07-17 19:58:32+00:00)
Title: Support for po-based translations on the client side too.

Hi Michael,

I'm building an app that does heavy use of javascript, and since the app is a single large javascript file, I need to use my rails managed translations on the client side too.

My approach was to add a rake task that converts po files into json files, which can then be required on the rails application.js

I also added a the Jed library for reading the json-encoded translations, and helper functions for using '_'.

This pull request is more of a 'request for comments', I don't think you should pull this in just yet. Although usable for my purposes, it has some issues:
* It's using the standard gettext extractor to find translations in coffee files, which does not work for finding translations interpolated in multi-line coffee strings.
* It's composed of a rake task and and the asset files, The rake task does not have any specs testing it.
* It assumes people want to look for translations in coffee files, but I think that for people using underscore.js it's going to be giving false positives when parsing coffee files.

I think a good solution to this would be to write a better parser for coffee files and expect a gettext function called 'gettext' instead of '_'.