Table of Content
How about switching the locale?
Getting locale option from params.
And now, we can access different with the params query:
Automatically appending the locale params to URL.
Rails comes with a
default_url_options that is the default query string and values that will be attached in the URL.
We can override the
default_url_options. Add the following method in the
This only applies to URL which is generated by rails, such as root_path. Manually typing the URL will not get the
And than the UI to switch. Since we want the language available everywhere, put it in the
For more detail, check http://guides.rubyonrails.org/i18n.html. For example, adding locale as part of the URL
What’s next? We’re going to take a look at “Pow local server”.