Skip to content

Commit

Permalink
Fix i18n for pluralized model names
Browse files Browse the repository at this point in the history
On Rails 4.0, translating a model with count: 1.1 was returning the
singular version.
  • Loading branch information
pcreux committed Dec 14, 2013
1 parent 1b2f5af commit 5e919fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions features/i18n.feature
Expand Up @@ -7,14 +7,19 @@ Feature: Internationalization
And a store named "Hello words" exists
When I go to the dashboard
Then I should see "Bookstores"

When I follow "Bookstores"
Then I should see the page title "Bookstores"
Then I should see "Hello words"

When I follow "View"
Then I should see "Bookstore Details"
And I should see "Hello words"
And I should see a link to "Delete Bookstore"

When I follow "Edit Bookstore"
Then I should see "Edit Bookstore"

When I press "Update Bookstore"
Then I should see a flash with "Bookstore was successfully updated."

Expand Down
2 changes: 1 addition & 1 deletion lib/active_admin/resource/naming.rb
Expand Up @@ -22,7 +22,7 @@ def resource_label

# Returns the plural version of this resource such as "Bank Accounts"
def plural_resource_label(options = {})
resource_name.translate ({:count => 1.1, :default => resource_label.pluralize.titleize}).merge(options)
resource_name.translate ({:count => 3, :default => resource_label.pluralize.titleize}).merge(options)
end
end

Expand Down

0 comments on commit 5e919fb

Please sign in to comment.