Pluralize Facet Values

What’s the best approach to pluralizing facet values? For example, I have a category, for which we are faceting on. That value is “Hotel”. When using InstantSearch.js Refinement List, the display shows, “500 Hotel”.

I know I can override the objects within the transformData callback, but is there a more preferred method?

Hi @tswientek, transformData is one solution that will work, you could also be using refinementList templates: https://community.algolia.com/instantsearch.js/v2/widgets/refinementList.html#struct-RefinementListTemplates

This would also work for you.

Thanks for using Algolia,
Happy Coding!

Thanks @vvo! I ended up implementing a callback on the transformData to translate the label based on individual facet counts. Works great!