diff options
author | Karel Minarik <karmi@karmi.cz> | 2009-01-22 12:31:20 +0100 |
---|---|---|
committer | Karel Minarik <karmi@karmi.cz> | 2009-01-22 12:31:20 +0100 |
commit | 97d9585efa5c2ddff688fca22ef0db1fcfbe9fe9 (patch) | |
tree | 0ba737df07fab09b551ab83a5f7e011fe74fef8a /railties/doc/guides/source | |
parent | 0eccdd9fb6a0e4df2904b28906fd5e7598266aa9 (diff) | |
download | rails-97d9585efa5c2ddff688fca22ef0db1fcfbe9fe9.tar.gz rails-97d9585efa5c2ddff688fca22ef0db1fcfbe9fe9.tar.bz2 rails-97d9585efa5c2ddff688fca22ef0db1fcfbe9fe9.zip |
Complete "Setting locale from the domain name" in i18n guide
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/i18n.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/doc/guides/source/i18n.txt b/railties/doc/guides/source/i18n.txt index 415de9bdec..e44acea504 100644 --- a/railties/doc/guides/source/i18n.txt +++ b/railties/doc/guides/source/i18n.txt @@ -220,6 +220,17 @@ def extract_locale_from_subdomain end ------------------------------------------------------- +If your application includes a locale switching menu, you would then have something like this in it: + +[source, ruby] +------------------------------------------------------- +link_to("Deutsch", "#{APP_CONFIG[:deutsch_website_url]}#{request.env['REQUEST_URI']}") +------------------------------------------------------- + +assuming you would set +APP_CONFIG[:deutsch_website_url]+ to some value like +http://www.application.de+. + +This solution has aforementioned advantages, however, you may not be able or may not want to provide different localizations ("language versions") on different domains. The most obvious solution would be to include locale code in the URL params (or request path). + === Setting locale from the URL params * TODO : Based on *+default_url options+*, http://github.com/karmi/test_default_url_options/blob/master/app/controllers/application.rb#L22-26 |