deepak kannan
2012-Mar-27 14:03 UTC
Re: [Bangalore RUG] Rails Internationalization problem while submitting the form.
Take a look at http://guides.rubyonrails.org/i18n.html#setting-the-locale-from-the-client-supplied-information On changing the language, store in session-store and set the locale from the session store thereafter Also store the locale in the users table. use this in case the session is refreshed http is stateless and the locale will be set on every request On Tue, Mar 27, 2012 at 6:42 PM, Santosh T <bt.santosh01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am facing an issue of Internationalization, where in while > submitting a form, it calls for a POST method. Suppose there is a user > registration form (/users/new) and when it is submitted it goes to > create method. > In my case if there are any activerecord validation errors, and > user changes his language, then I need to reload the form once again. > But since form has been submitted,we need to call new method > again.Also we might be having so many forms like this, and need to > handle it commonly throughout the website. > > Currently I am referring to the current url and changing the > locales according to the user''s language(through comparison with > regular expressions). But this approach does''nt work while form > submission. There might be easier solutions, which you an suggest. > Please help me in handling this situation. > > -- > Regards, > Santosh T.-- best, @deepak_kannan -- 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.