ember-inflector
ember-inflector copied to clipboard
"Child"/"Children" words are lowercased on singularize/pluralize.
pluralize('car') // => cars
pluralize('Car') // => Cars
singularize('cars') // => car
singularize('Cars') // => Car
// So far, so good...
pluralize('child') // => children
pluralize('Child') // => children # why lowercased?
singularize('children') // => child
singularize('Children') // => child # why lowercased?
Using version 2.0.1.
Why is it lowercased here: https://github.com/emberjs/ember-inflector/blob/master/addon/lib/system/inflector.js#L183?
@arnaudbesnier the thing with child
is that it's an irregular and it's registered lowercase. The regular rules aren't registered but use regex to replace or add the singular/plural form.
@fsmanuel thanks for your response, that's what I discovered about child
.
Do we agree that this is a bug? I probably don't know all the constraints.
Not sure to understand how to bypass this issue. Can you share an example of code I should add to have the expected behaviour?
@arnaudbesnier personally I think it is a bug but I'm not sure how we deal with it. I'll open a PR with failing tests.