method
translate
Register or
log in
to add new notes.
Vidmantas -
January 11, 2010 - (>= v2.2.1)
2 thanks
Default fallback
You can specifly :default option which is useful when the translation is not found. For example:
t(:this_translation_doesnt_exist, :default => 'Ooops!') # => Ooops!
Or even any number of “fallbacks” - the first not nil is returned:
t(:missing, :default => [:missing_too, :existing, 'Sad panda']) # => :existing translation
Good introduction to Rails I18n is http://guides.rubyonrails.org/i18n.html