method
translate

v2.2.1 -
Show latest stable
-
1 note -
Class: ActionView::Helpers::TranslationHelper
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1 (0)
- 2.3.2 (38)
- 2.3.8 (0)
- 3.0.0 (28)
- 3.0.9 (22)
- 3.1.0 (1)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (-3)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (18)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (20)
- What's this?
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