aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/i18n.textile
diff options
context:
space:
mode:
authorBrandon Tilley <binarymuse@binarymuse.net>2011-02-19 14:49:42 -0800
committerMani Tadayon <bowsersenior@gmail.com>2011-02-21 13:44:19 -0800
commit1e2ecc4d6f2bc528100d994a48118c560b87445c (patch)
tree9beab58ae15c28709de8cf2db9f537601154e76f /railties/guides/source/i18n.textile
parent9345e9cca241c201443ae1feec08de967851b231 (diff)
downloadrails-1e2ecc4d6f2bc528100d994a48118c560b87445c.tar.gz
rails-1e2ecc4d6f2bc528100d994a48118c560b87445c.tar.bz2
rails-1e2ecc4d6f2bc528100d994a48118c560b87445c.zip
Add info about I18n::Backend::Chain to I18n guide
Diffstat (limited to 'railties/guides/source/i18n.textile')
-rw-r--r--railties/guides/source/i18n.textile6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile
index 337ef52d3b..8b37543342 100644
--- a/railties/guides/source/i18n.textile
+++ b/railties/guides/source/i18n.textile
@@ -809,6 +809,12 @@ That does not mean you're stuck with these limitations, though. The Ruby I18n ge
I18n.backend = Globalize::Backend::Static.new
</ruby>
+You can also use the Chain backend to chain multiple backends together. This is useful when you want to use standard translations with a Simple backend but store custom application translations in a database or other backends. For example, you could use the ActiveRecord backend and fall back to the (default) Simple backend:
+
+<ruby>
+I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
+</ruby>
+
h4. Using Different Exception Handlers
The I18n API defines the following exceptions that will be raised by backends when the corresponding unexpected conditions occur: