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 ActiveSupport::Inflector.pluralize behavior for words that consist of non-ASCII characters #12509

Merged

Conversation

eitoball
Copy link
Contributor

This PR fixes behavior of ActiveSupport::Inflector.pluralize.

The code below returns "猫" in 3.2, but "猫s" in 4.0.

ActiveSupport::Inflector.inflections do |inflect|
  inflect.uncountable "猫"
end
"猫".pluralize

@rafaelfranca
Copy link
Member

cc @fxn

@ghost ghost assigned fxn Oct 13, 2013
@clst
Copy link
Contributor

clst commented Jul 1, 2015

Is this the reason why for example:

inflect.uncountable 'stück'  
inflect.uncountable 'equipment'
["stück".pluralize, "equipment".pluralize]
 => ["stücks", "equipment"]

has this been fixed in rails master?

The code below returns "猫" in 3.2, but "猫s" in 4.0.
```ruby
ActiveSupport::Inflector.inflections do |inflect|
  inflect.uncountable "猫"
end
"猫".pluralize
```
@eitoball eitoball force-pushed the pluralize_for_non_ascii_character_words branch from ace7d78 to c7fc843 Compare July 2, 2015 00:56
@eitoball
Copy link
Contributor Author

eitoball commented Jul 2, 2015

@clst

Is this the reason why for example:

Yes.

has this been fixed in rails master?

I think not yet. I just rebased on master without conflicts.

@matthewd matthewd merged commit c7fc843 into rails:master Dec 31, 2016
matthewd added a commit that referenced this pull request Dec 31, 2016
…cter_words

Fix ActiveSupport::Inflector.pluralize behavior for words that consist of non-ASCII characters

(test only; the original bug was fixed by 1bf50ba)
@matthewd
Copy link
Member

This got fixed (accidentally, it would seem) by 1bf50ba. I've merged this for the new test, to ensure it stays fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants