# Localized views fallbacks

**URL:** <https://www.ruby-forum.com/t/localized-views-fallbacks/201984>\
**Category:** Rails I18n\
**Created:** [January 19, 2011, 10:55am UTC](https://www.ruby-forum.com/t/localized-views-fallbacks/201984 "2011-01-19T10:55:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 19, 2011, 10:55am UTC](https://www.ruby-forum.com/t/localized-views-fallbacks/201984/1 "2011-01-19T10:55:21Z")

</div>

I am using Rails 2.3.8 and have setup in config/initializers/i18n.rb

I18n.backend.class.send(:include, I18n::Backend::Fallbacks)  
I18n.fallbacks.map(:tc =\> [:sc, :en])

so that if there is no translation in tc, the sc translation is used.

Text translations works ok.

I was kind of expecting the same thing should apply to views. For  
example, in the index action, if the current locale is ‘tc’ and  
index.tc.html.erb does not exist, the application should use  
index.sc.html.erb if it is present. But currently it falls back to  
index.en.html.erb or index.html.erb because my default\_locale is en.

Does anybody experience the same thing? Or is there something I am  
doing wrong.

---

<div class="post-metadata">

**Author:** ![djhunx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@djhunx](https://www.ruby-forum.com/u/djhunx)\
**Post date:** [March 15, 2011, 8:52pm UTC](https://www.ruby-forum.com/t/localized-views-fallbacks/201984/2 "2011-03-15T20:52:25Z")

</div>

Same thing, here. I want to use I18n not only for translation, but for  
a degree of content management, as well. For example, I have three  
product lines that are sold in the US and Canada, but only one product  
line that is sold in Europe, and two product lines that are sold in  
Asia and the Pacific Rim.

So I need the views to follow a fallback chain as well as the YAML  
files (i.e., [:“es-ES”, :es, :“en-GB”, :en] or [:“fr-BE”, :fr, :“en-  
GB”, :en]–sending all european locales through :“en-GB” before  
defaulting to :en, etc.).

How do I configure a custom fallback chain, and how do I get the views  
to follow that fallback chain?

Using Rails 3.0.4 and I18n 0.5.0.
