Hi everyone.
I use rails 3.0.4, and Babilu a plugin to use rails-i18n in javascript
code (see
http://tore.darell.no/posts/introducing_babilu_rails_i18n_for_your_javascript)
Babilu generates a javascript file that contains all the translations
i can just call
Babilu.generate
to generate this file from i18n rails translations
The thing is, it works very well on developpement mode, because Babilu
generate the locales.js file at each request.
On production mode, babilu just generate his locales.js file at the
initialisation of the plugin.
But, since rails3, it seems to be broken : now the Babilu script can
just mirror the native translations, but not the translations i added
myself.
In rails 2.3.8 it was working with a I18n.reload! to force
translations loading, but it doesn’t seems to work now. (see
https://github.com/lou/babilu/commit/71aef7470cdabf7888affc538ea806caddce7c1f
)
I can figure out when does my “custom” translations (that i put in
config/locales/en.yml) are loaded in i18n, and where can i put an
initializer script, at the start of the production server, to have
working i18n translations.
I tried to put code in config/initializer, in application.rb, it
doesn’t work. I found nothing on rails guides.
I’ve got no error to show you, because it’s just translation missing:
en.controller.blabla in my locales.js file
If anyone can help me it would be very nice (it will help me to not
rebuild static files at each request)
you can find my babilu fork at GitHub - piercus/babilu: JavaScript Rails internationalization
Thanks a lot
Pierre