Erwin
2010-Feb-23 18:31 UTC
how a js script can get the current locale from my rails app ?
I am not very fluent in JS, so I don''t see how to transfer the rails
app current locale ..
I have a JS script able to detect the default browser language ..
running fine
I can also modify the JS language, passing a global var ..
// Create a JSON Object
var myJSON = {
"lang": "fr"
};
// Pass it to the script immediately...
datePickerController.setGlobalVars(myJSON);
and it runs ... but I would like this script to use the language
selected by the rails app user :
the I18n.default_locale being modified in the rails app
any clue ?
thanks a lot ..
erwin
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Paul E. G. Lynch
2010-Feb-23 20:55 UTC
Re: how a js script can get the current locale from my rails app ?
Couldn''t you pass that back in your page''s view template? On Feb 23, 1:31 pm, Erwin <yves_duf...-ee4meeAH724@public.gmane.org> wrote:> I am not very fluent in JS, so I don''t see how to transfer the rails > app current locale .. > > I have a JS script able to detect the default browser language .. > running fine > > I can also modify the JS language, passing a global var .. > > // Create a JSON Object > var myJSON = { > "lang": "fr" > }; > // Pass it to the script immediately... > datePickerController.setGlobalVars(myJSON); > > and it runs ... but I would like this script to use the language > selected by the rails app user : > the I18n.default_locale being modified in the rails app > > any clue ? > > thanks a lot .. > > erwin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.