Module: Wallaby::Locale
- Defined in:
- lib/utils/wallaby/locale.rb
Overview
Locale related
Class Method Summary collapse
-
.t(key, options = {}) ⇒ String
Extend translation just for Wallaby so that translation can be prefixed with ‘wallaby.`.
Class Method Details
.t(key, options = {}) ⇒ String
Extend translation just for Wallaby so that translation can be prefixed with ‘wallaby.`
12 13 14 15 16 17 18 19 |
# File 'lib/utils/wallaby/locale.rb', line 12 def t(key, = {}) translator = .delete(:translator) || I18n.method(:t) return translator.call(key, ) unless key.is_a?(String) || key.is_a?(Symbol) new_key, new_defaults = normalize key, .delete(:default) translator.call(new_key, default: new_defaults, **) end |