Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Model plural label fix: Count must be 'other' to apply :other key with every locale.  #1517

Merged
merged 1 commit into from

3 participants

@estum

Two for count doesn't apply right plural key (:other) for some languages.
For example, in russian locale it calls :few key and applies wrong translation.

 >> I18n.locale = :ru
 >> I18n.t 'activerecord.models.user', count: 2
 => "Пользователя"  #wrong
 >> I18n.t 'activerecord.models.user', count: 'other'
 => "Пользователи"  #right
 >> I18n.t.locale = :en 
 => I18n.t 'activerecord.models.user', count: 'other'
 => "Users"
@estum estum Model plural label fix
Count must be 'other' to apply :other key with every locale. 
c01c87b
@a-vakulenko

I agree, this is very important.

@bbenezech bbenezech merged commit 026a145 into from
@estum estum deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 12, 2013
  1. @estum

    Model plural label fix

    estum authored
    Count must be 'other' to apply :other key with every locale. 
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/rails_admin/config/model.rb
View
2  lib/rails_admin/config/model.rb
@@ -60,7 +60,7 @@ def object_label
end
register_instance_option :label_plural do
- (@label_plural ||= {})[::I18n.locale] ||= abstract_model.model.model_name.human(:count => 2, :default => label.pluralize)
+ (@label_plural ||= {})[::I18n.locale] ||= abstract_model.model.model_name.human(:count => 'other', :default => label.pluralize)
end
def pluralize(count)
Something went wrong with that request. Please try again.