Sha256: 84427dc2be28d32931d85c75f29efeea1310ac3917949d7b20191134bda15787

Contents?: true

Size: 766 Bytes

Versions: 18

Compression:

Stored size: 766 Bytes

Contents

filename = "#{File.dirname(__FILE__)}/../active_model/locale.rb"
translations = eval(IO.read(filename), binding, filename)
translations[:en][:activerecord] = translations[:en].delete(:activemodel)

# Only ActiveRecord 2.3.5+ can pull i18n >= 0.1.3 from system-wide gems (and
# therefore possibly have I18n::VERSION available)
begin
  require 'i18n/version'
rescue Exception => ex
end unless ::ActiveRecord::VERSION::MAJOR == 2 && (::ActiveRecord::VERSION::MINOR < 3 || ::ActiveRecord::VERSION::TINY < 5)

# Only i18n 0.4.0+ has the new %{key} syntax
if !defined?(I18n::VERSION) || I18n::VERSION < '0.4.0'
  translations[:en][:activerecord][:errors][:messages].each do |key, message|
    message.gsub!('%{', '{{')
    message.gsub!('}', '}}')
  end
end

translations

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
state_machine-1.1.2 lib/state_machine/integrations/active_record/locale.rb
state_machine-1.1.1 lib/state_machine/integrations/active_record/locale.rb
state_machine-1.1.0 lib/state_machine/integrations/active_record/locale.rb
state_machine-1.0.3 lib/state_machine/integrations/active_record/locale.rb
hsume2-state_machine-1.0.5 lib/state_machine/integrations/active_record/locale.rb
state_machine-1.0.2 lib/state_machine/integrations/active_record/locale.rb
hsume2-state_machine-1.0.4 lib/state_machine/integrations/active_record/locale.rb
hsume2-state_machine-1.0.3 lib/state_machine/integrations/active_record/locale.rb
hsume2-state_machine-1.0.2 lib/state_machine/integrations/active_record/locale.rb
hsume2-state_machine-1.0.1 lib/state_machine/integrations/active_record/locale.rb
state_machine-1.0.1 lib/state_machine/integrations/active_record/locale.rb
state_machine-1.0.0 lib/state_machine/integrations/active_record/locale.rb
state_machine-0.10.4 lib/state_machine/integrations/active_record/locale.rb
verborghs-state_machine-0.9.6 lib/state_machine/integrations/active_record/locale.rb
verborghs-state_machine-0.9.5 lib/state_machine/integrations/active_record/locale.rb
verborghs-state_machine-0.9.4 lib/state_machine/integrations/active_record/locale.rb
state_machine-0.9.4 lib/state_machine/integrations/active_record/locale.rb
state_machine-0.9.3 lib/state_machine/integrations/active_record/locale.rb