michaelbull / aurelia-hacker-news

A recreation of the Hacker News website written in TypeScript and built with Aurelia.
https://michaelbull.github.io/aurelia-hacker-news
ISC License
62 stars 7 forks source link

Pluralise can be improved #21

Closed 3cp closed 6 years ago

3cp commented 6 years ago

I was glancing your html templates, it made me smile when I saw an exactly same value converter pluralise as I had in my project.

I thought you might be using the same underneath library I use but you didn’t.

This 👇 lib can help you to do proper English plural, if you don’t mind inflating your js. https://github.com/blakeembrey/pluralize

michaelbull commented 6 years ago

Hi, thanks for the suggestion.

As it stands, the pluralise value converter is used in two places (1, 2) in the item-preview custom element.

The simple solution I've got pluralises these words i.e. point(s) & comment(s), perfectly fine. If the pluralise value converter was to be used for a wider range of words in the project then I'd look to adopt a more robust solution, but as it stands I can't really justify adopting a third-party library to pluralise these two words.

Thanks for the suggestion.