Is it possible to switch off I18n/Globalize3 fallbacks per Rails model basis? I.e. some models use fallback, some don't.
Asked
Active
Viewed 277 times
1 Answers
1
Yes, it is possible by overriding the globalize_fallbacks
method in your model. Take for example a post model with translated title and content:
class Post < ActiveRecord::Base
translates :title, :content
# Disable fallbacks for this model
def globalize_fallbacks(locale)
[locale]
end
end
You simply specify that the requested locale can only fallback to itself, no matter what is defined in your global configuration.

lawitschka
- 745
- 3
- 9