Module: I18n
- Extended by:
- GetText
- Defined in:
- lib/gettext_activerecord/i18n.rb
Overview
lib/gettext_activerecord/i18n.rb - GetText for ActiveRecord’s I18n.
Copyright (C) 2009 Masao Mutoh
You may redistribute it and/or modify it under the same
license terms as Ruby or LGPL.
Class Method Summary collapse
-
.translate_with_gettext_activerecord(key, options = {}) ⇒ Object
(also: t_with_gettext_activerecord)
gettext_activerecord doesn’t define backend.
Methods included from GetText
update_pofiles, update_pofiles_org
Class Method Details
.translate_with_gettext_activerecord(key, options = {}) ⇒ Object Also known as: t_with_gettext_activerecord
gettext_activerecord doesn’t define backend. So it can be used with another backend.
14 15 16 17 18 19 20 21 |
# File 'lib/gettext_activerecord/i18n.rb', line 14 def translate_with_gettext_activerecord(key, = {}) #:nodoc: if [:scope] == [:activerecord, :errors] [:attribute] = key.to_s.split(".")[3] # This value will be used in ActiveRecord::Base::Errors.localize_error_messages else translate_without_gettext_activerecord(key, ) end end |