Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.31k stars 533 forks source link

Conditional localization/pluralization #2749

Open MichalCadecky opened 3 years ago

MichalCadecky commented 3 years ago

Is your feature request related to a problem? Please describe. There are some languages (e.g. Slovak) which have different forms of words based on the context. I believe this is mostly related to numbers and plural forms. Blazorise currently does not support this kind of localization. Good example is pagination.

English 0 big items 1 big item 2..N big items

Slovak 0 veľkých položiek 1 veľká položka 2,3,4 veľké položky 5..N veľkých položiek

Please notice that it is not related just to nouns

Describe the solution you'd like It would be nice if Blazorise could support this. Maybe something like Mozilla is using could be handy - PluralRules

Additional context

Other resources: https://github.com/axuno/SmartFormat http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html https://www.i18next.com/translation-function/plurals

stsrki commented 3 years ago

Croatian has similar pluralization rules so I'm familiar with the concept. For now, I want to leave Blazorise localization as simple as possible so no planning on this feature at the moment.

In any case, I will leave it open for the future as it is a nice feature to have.