Sha256: f4be631b1ae15c9e0a94508de6e8661a61f0e16bd378806bc05a399b765e793d
Contents?: true
Size: 982 Bytes
Versions: 1
Compression:
Stored size: 982 Bytes
Contents
=begin 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. =end module I18n #:nodoc: class << self include GetText # gettext_activerecord doesn't define backend. So it can be used with another backend. def translate_with_gettext_activerecord(key, options = {}) #:nodoc: if options[:scope] == [:activerecord, :errors] options[:attribute] = key.to_s.split(".")[3] options # This value will be used in ActiveRecord::Base::Errors.localize_error_messages else translate_without_gettext_activerecord(key, options) end end alias_method_chain :translate, :gettext_activerecord #:nodoc: alias_method :t_with_gettext_activerecord, :translate_with_gettext_activerecord #:nodoc: alias_method_chain :t, :gettext_activerecord #:nodoc: end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gettext_activerecord-2.1.0 | lib/gettext_activerecord/i18n.rb |