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

Merged
merged 1 commit into from Dec 31, 2016

Conversation

Projects
None yet
5 participants
Contributor

eitoball commented Oct 12, 2013

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
Owner

rafaelfranca commented Oct 13, 2013

cc @fxn

fxn was assigned Oct 13, 2013

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?

@eitoball eitoball fix pluralize behavior for words that consist of non-ascii characters
The code below returns "猫" in 3.2, but "猫s" in 4.0.
```ruby
ActiveSupport::Inflector.inflections do |inflect|
  inflect.uncountable "猫"
end
"猫".pluralize
```
c7fc843
Contributor

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 matthewd added a commit that referenced this pull request Dec 31, 2016

@matthewd matthewd Merge pull request #12509 from eitoball/pluralize_for_non_ascii_chara…
…cter_words

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

(test only; the original bug was fixed by 1bf50ba)
c3ff368
Owner

matthewd commented Dec 31, 2016

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