aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/i18n.textile
diff options
context:
space:
mode:
authorDavid Celis <david@davidcelis.com>2012-07-31 09:17:16 -0700
committerDavid Celis <david@davidcelis.com>2012-07-31 09:17:20 -0700
commitcf21657f6e55346fa2f5555926f3f6a1e199de65 (patch)
treec42c33951f3f955187bac785ef7c19081003d86c /guides/source/i18n.textile
parentdb25ca7ec446e4142097d6cc4d80c21ea426398d (diff)
downloadrails-cf21657f6e55346fa2f5555926f3f6a1e199de65.tar.gz
rails-cf21657f6e55346fa2f5555926f3f6a1e199de65.tar.bz2
rails-cf21657f6e55346fa2f5555926f3f6a1e199de65.zip
Update I18n guide with details on multilingual Inflector [ci skip]
Sorry; I forgot about the guides when I submitted this patch. Signed-off-by: David Celis <david@davidcelis.com>
Diffstat (limited to 'guides/source/i18n.textile')
-rw-r--r--guides/source/i18n.textile4
1 files changed, 4 insertions, 0 deletions
diff --git a/guides/source/i18n.textile b/guides/source/i18n.textile
index 8ad6ee4b73..f67d487eee 100644
--- a/guides/source/i18n.textile
+++ b/guides/source/i18n.textile
@@ -405,6 +405,10 @@ So that would give you:
TIP: Right now you might need to add some more date/time formats in order to make the I18n backend work as expected (at least for the 'pirate' locale). Of course, there's a great chance that somebody already did all the work by *translating Rails' defaults for your locale*. See the "rails-i18n repository at Github":https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale for an archive of various locale files. When you put such file(s) in +config/locales/+ directory, they will automatically be ready for use.
+h4. Inflection Rules For Other Locales
+
+Rails 4.0 allows you to define inflection rules (such as rules for singularization and pluralization) for locales other than English. In +config/initializers/inflections.rb+, you can define these rules for multiple locales. The initializer contains a default example for specifying rules for Spanish; follow that format for other locales as you see fit.
+
h4. Localized Views
Rails 2.3 introduces another convenient localization feature: localized views (templates). Let's say you have a _BooksController_ in your application. Your _index_ action renders content in +app/views/books/index.html.erb+ template. When you put a _localized variant_ of this template: *+index.es.html.erb+* in the same directory, Rails will render content in this template, when the locale is set to +:es+. When the locale is set to the default locale, the generic +index.html.erb+ view will be used. (Future Rails versions may well bring this _automagic_ localization to assets in +public+, etc.)