Method: StringExtension#localize
- Defined in:
- lib/message_train/localization.rb
#localize(*args) ⇒ Object Also known as: l
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/message_train/localization.rb', line 2 def localize(*args) if args.first.is_a? Symbol sym = args.shift else sym = underscore.tr(' ', '_').gsub(/[^a-z0-9_]+/i, '').to_sym end args << {:default => self} I18n.t(sym, *args).html_safe end |