The choice() function of the October\Rain\Translation\Translator class (accessed through the Lang facade) is not working properly for languages with a language-code containing a dash (like en-uk or es-ar).
It calls the Symfony\Component\Translation\MessageSelector::choose() function to choose the correct plural form for a localization string. This function does in turn call the Symfony\Component\Translation\PluralizationRules::get() function, which chooses the correct plural position for the given locale. When it detects a locale code with more than 3 characters like en-uk, it tries to strip it down to just en, but it just searches for underscores, not dashes.
So the Symfony classes expect locales like en_UK instead. The october backend localization system does therefore not work properly with pluralization, when a locale like en-uk is selected. It just prints the singular version every time.
Lang::choice('author.plugin::lang.navigation.foo', 2).navigation.foo string is set to 'Bar|Bars'.This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.
Most helpful comment
Fixed by https://github.com/octobercms/library/commit/64be2b64a235f35332d0062531a7ac34c7f9a1f6.