<p></p>
<p><b>@tomhughes</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5811#discussion_r1999266630">app/assets/javascripts/application.js</a>:</p>
<pre style='color:#555'>>
// '-' 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 }));
</pre>
<p dir="auto">The actual example upstream is:</p>
<div class="highlight highlight-source-js" dir="auto"><pre class="notranslate"><span class="pl-s1">register</span><span class="pl-kos">(</span><span class="pl-s">"ru"</span><span class="pl-kos">,</span> <span class="pl-en">useMakePlural</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">pluralizer</span>: <span class="pl-s1">ru</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">which I misread as I didn't notice the difference between the constant string <code class="notranslate">ru</code> and the variable <code class="notranslate">ru</code> so I'll fix that now.</p>
<p dir="auto">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.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5811#discussion_r1999266630">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOWKRJOYUX32AP3BGL2U3673AVCNFSM6AAAAABZDZR6OWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMOJRGQZDKMZZGA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMTH2YPB7SC7QG6EA32U3673A5CNFSM6AAAAABZDZR6OWWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVANPSG4.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5811/review/2691425390</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5811#discussion_r1999266630",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5811#discussion_r1999266630",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>