Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inflector to respect default locale. #10158

Merged
merged 1 commit into from Apr 10, 2013

Conversation

steveklabnik
Copy link
Member

The inflector was made aware of locales in 7db0b07,
but it defaulted to :en. That should actually be our default
locale instead.

Fixes #10125

I wanted to get some feedback about the tests. Is this the right place, or should I bet testing singularize/pluralize more directly?

/cc @thenickcox

The inflector was made aware of locales in 7db0b07,
but it defaulted to :en. That should actually be our default
locale instead.

Fixes rails#10125
@jeremy
Copy link
Member

jeremy commented Apr 10, 2013

👍

steveklabnik added a commit that referenced this pull request Apr 10, 2013
Fix inflector to respect default locale.
@steveklabnik steveklabnik merged commit fa3ef8e into rails:master Apr 10, 2013
@steveklabnik
Copy link
Member Author

Word, thanks.

assert_equal('region', 'regionen'.singularize)
ensure
I18n.locale = old_locale
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might wanna use I18n.with_locale(:de) do ... end for that purpose. (https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L243-L251)

@josevalim
Copy link
Contributor

This issues is not only with Active Record but also routes, rails rendering stack, anywhere that may call pluralize. This definitely needs to be reverted.

rafaelfranca added a commit that referenced this pull request Apr 10, 2013
This reverts commit fa3ef8e, reversing
changes made to e0af93d.

Reason: Routes, Active Record and the rendering stack should not depend
on the default locale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pluralization with default_locale not working in Rails4 Beta1
9 participants