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@gmail.com> 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@googlegroups.com.
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.
No comments:
Post a Comment