channdara / flutter_localization

BSD 3-Clause "New" or "Revised" License
11 stars 20 forks source link

How to implement pluralization? #23

Closed AlexeyShevchenko closed 1 month ago

AlexeyShevchenko commented 2 months ago

I'm working with a format string to display the number of available places. Depending on the number passed, the output should correctly handle pluralization. For example:

How can I implement this logic to ensure proper pluralization?

channdara commented 2 months ago

Hello @AlexeyShevchenko

Currently the package does not have build-in pluralization functionality, but I think you can try with the intl package. Can check more with this plural method from intl package

AlexeyShevchenko commented 2 months ago

Hello @channdara thanks for quick response Are you going to have such functionality in your package in future?

channdara commented 2 months ago

I'm looking forward to adding this functionality to the package since you have mentioned this. Thank you.

AlexeyShevchenko commented 2 months ago

Cool! @channdara I would like to be involved in implementation of this functionality. If you have some advice from where I can start please let me know.

channdara commented 2 months ago

I'm trying to understand the logic flow of the plural function from the intl package and integration since I don't want to add intl to this package to avoid conflict at a later time. But if things are hard to handle, I will add intl and integrate it with the current package.

AlexeyShevchenko commented 2 months ago

@channdara got it