From: Tom Hughes Date: Fri, 2 Mar 2012 09:19:12 +0000 (+0000) Subject: Update rails-i18n to 0.5.1 X-Git-Tag: live~6308 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/06934ad37565a1c5d251a5474a778b29b16591d1 Update rails-i18n to 0.5.1 This update allows us to drop our pluralization support, as rails-i18n now takes care of that, and for a far wider range of locales. --- diff --git a/Gemfile b/Gemfile index d05f544b8..74f6009b6 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ gem 'pg' gem 'jquery-rails' # Load rails plugins -gem 'rails-i18n' +gem 'rails-i18n', ">= 0.5.1" gem 'dynamic_form' gem 'rinku', '>= 1.2.2', :require => 'rails_rinku' gem 'oauth-plugin', '>= 0.4.0.pre7' diff --git a/Gemfile.lock b/Gemfile.lock index 6028ebf4c..56efbdc7e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,7 +108,7 @@ GEM activesupport (= 3.2.1) bundler (~> 1.0) railties (= 3.2.1) - rails-i18n (0.4.0) + rails-i18n (0.5.1) i18n (~> 0.5) railties (3.2.1) actionpack (= 3.2.1) @@ -167,7 +167,7 @@ DEPENDENCIES paperclip (~> 2.0) pg rails (= 3.2.1) - rails-i18n + rails-i18n (>= 0.5.1) rinku (>= 1.2.2) sanitize sass-rails (~> 3.2.3) diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index 3c3ba872c..7aafc91eb 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -18,10 +18,7 @@ module I18n end end -I18n::Backend::Simple.include(I18n::Backend::Pluralization) I18n::Backend::Simple.include(I18n::Backend::PluralizationFallback) -I18n.load_path << "#{Rails.root}/config/pluralizers.rb" - I18n::Backend::Simple.include(I18n::Backend::Fallbacks) I18n.fallbacks.map("no" => "nb") diff --git a/config/pluralizers.rb b/config/pluralizers.rb deleted file mode 100644 index 6e0c74116..000000000 --- a/config/pluralizers.rb +++ /dev/null @@ -1,50 +0,0 @@ -{ - :ar => { - :i18n => { - :plural => { - :rule => lambda { |count| - case count - when 1 then :one - when 2 then :two - else case count % 100 - when 3..10 then :few - when 11..99 then :many - else :other - end - end - } - } - } - }, - :ru => { - :i18n => { - :plural => { - :rule => lambda { |count| - case count % 100 - when 11,12,13,14 then :many - else case count % 10 - when 1 then :one - when 2,3,4 then :few - when 5,6,7,8,9,0 then :many - else :other - end - end - } - } - } - }, - :sl => { - :i18n => { - :plural => { - :rule => lambda { |count| - case count % 100 - when 1 then :one - when 2 then :two - when 3,4 then :few - else :other - end - } - } - } - } -}