Module: Formtastic::I18n
- Defined in:
- lib/formtastic/i18n.rb
Constant Summary collapse
- DEFAULT_SCOPE =
[:formtastic].freeze
- DEFAULT_VALUES =
YAML.load_file(File.("../../locale/en.yml", __FILE__))["en"]["formtastic"].freeze
- SCOPES =
[ '%{model}.%{nested_model}.%{action}.%{attribute}', '%{model}.%{action}.%{attribute}', '%{model}.%{nested_model}.%{attribute}', '%{model}.%{attribute}', '%{nested_model}.%{attribute}', '%{attribute}' ]
Class Method Summary collapse
- .translate(*args) ⇒ Object (also: t)
Class Method Details
.translate(*args) ⇒ Object Also known as: t
20 21 22 23 24 25 26 |
# File 'lib/formtastic/i18n.rb', line 20 def translate(*args) key = args.shift.to_sym = args. .reverse_merge!(:default => DEFAULT_VALUES[key]) [:scope] = [DEFAULT_SCOPE, [:scope]].flatten.compact ::I18n.translate(key, *(args << )) end |