Class: I18nPluralizationBackendTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/vendor/i18n/test/backend/pluralization/pluralization_test.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



7
8
9
10
11
12
13
# File 'lib/vendor/i18n/test/backend/pluralization/pluralization_test.rb', line 7

def setup
  I18n.backend = I18n::Backend::Simple.new
  I18n.backend.meta_class.send(:include, I18n::Backend::Pluralization)
  @pluralizer = lambda { |n| n == 1 ? :one : n == 0 || (2..10).include?(n % 100) ? :few : (11..19).include?(n % 100) ? :many : :other }
  backend_store_translations(:foo, :i18n => { :pluralize => @pluralizer })
  @entry = { :zero => 'zero', :one => 'one', :few => 'few', :many => 'many', :other => 'other' }
end