diff options
author | Karel Minarik <karmi@karmi.cz> | 2009-01-26 16:18:28 +0100 |
---|---|---|
committer | Karel Minarik <karmi@karmi.cz> | 2009-01-26 16:18:28 +0100 |
commit | 1b8131bb94c16e8b7945e5819949fe2ecffb2082 (patch) | |
tree | 742eb7b8299961f3fcf2dd1725965e32a515a3a1 /railties/doc/guides/source | |
parent | 6e32e369a9484ce57a46e3e5b780d5a6effd33a3 (diff) | |
download | rails-1b8131bb94c16e8b7945e5819949fe2ecffb2082.tar.gz rails-1b8131bb94c16e8b7945e5819949fe2ecffb2082.tar.bz2 rails-1b8131bb94c16e8b7945e5819949fe2ecffb2082.zip |
Finished section about "Setting the locale from the client's information": 'Using Accept-Language' and 'Using GeoIP (or similar) database' {i18n guide}
Diffstat (limited to 'railties/doc/guides/source')
-rw-r--r-- | railties/doc/guides/source/i18n.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/doc/guides/source/i18n.txt b/railties/doc/guides/source/i18n.txt index f5cdefd180..87a5f24a16 100644 --- a/railties/doc/guides/source/i18n.txt +++ b/railties/doc/guides/source/i18n.txt @@ -319,11 +319,11 @@ Of course, in production environment you would need much robust code, and could ==== Using GeoIP (or similar) database -#TODO http://www.maxmind.com/app/geolitecountry +Another way of choosing the locale from client's information would be to use a database for mapping client IP to region, such as http://www.maxmind.com/app/geolitecountry[GeoIP Lite Country]. The mechanics of the code would be very similar to the code above -- you would need to query database for user's IP, and lookup your preffered locale for the country/region/city returned. ==== User profile -#TODO +You can also provide users of your application with means to set (and possibly over-ride) locale in your application interface, as well. Again, mechanics for this approach would be very similar to the code above -- you'd probably let users choose a locale from a dropdown list and save it to their profile in database. Then you'd set the locale to this value. == Internationalizing your application |