@tomhughes commented on this pull request.


>  
   // '-' are replaced with '_' in 
https://github.com/eemeli/make-plural/tree/main/packages/plurals
   const pluralizer = plurals[locale.replace(/\W+/g, "_")] || 
plurals[locale.split("-")[0]];
   if (pluralizer) {
-    I18n.pluralization[locale] = (count) => [pluralizer(count), "other"];
+    OSM.i18n.pluralization.register(locale, I18n.useMakePlural({ pluralizer: 
locale }));

The actual example upstream is:

```js
register("ru", useMakePlural({ pluralizer: ru })
```

which I misread as I didn't notice the difference between the constant string 
`ru` and the variable `ru` so I'll fix that now.

I had been struggling to understand your fallback simply because upstream 
doesn't seem to document the return value of the pluralizer so while I thought 
it was some sort of fallback but I've found the code in the source now and 
understand it so I'll fix that as well.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5811#discussion_r1999266630
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5811/review/2691425...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to