Hi At first glance Babilu seemed to be exactly what I was looking for: no need to have extra translation logic for Javascript : just use rails.
However it is unclear what exactly it does. I see that it generates a file called locales.js, in theory containing what is in your translation files in rails, however I see a lot of extraneous stuff in that file, like a list of countries apparently from factory_girl. How to stop it doing this? Does babilu load all translations whenever you call generate ? When does it use the default (as in default locale in locales.js)? I see that there is a fork to etagwerker-babilu which purports to optimise the creation of the file. But it doesn't say how. It is early days in the project but will end up with a lot of big translation files in many languages. It would be better to have babilu just load 1 translation file per language for the javascript or only translation files when a new language is selected by the user. Are there any options for such things in babilu? Is there another option for i18n in javascript in combo with rails? Regards dukha On Mar 11, 7:55 pm, Pierre Colle <[email protected]> wrote: > Ingmar, > > That's exactly what i was searching for. > > Thanks > > On 03/03/2011 21:36, Ingmar Stieger wrote: > > > Pierre, > > > until babilu is updated to work with Rails3, this following workaround > > works fine for me. > > > In application.rb, add this inside the Application class: > > > config.after_initialize do > > Babilu.generate > > end > > > This generates locales.js just after Rails has done initializing. > > > Ingmar -- You received this message because you are subscribed to the Google Groups "rails-i18n" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-i18n?hl=en.
