Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.84k stars 2.31k forks source link

[i18n] Languages with multiple plurals aren't properly supported #3271

Open Jackenmen opened 4 years ago

Jackenmen commented 4 years ago

As an example, I saw this code: https://github.com/Cog-Creators/Red-DiscordBot/blob/f7e2617911e9a5d0f075e042b72bedc77a35616b/redbot/core/utils/chat_formatting.py#L438-L445

For example, in Polish we have 2 plural forms beside the singular: 1 month -> 1 miesiąc (1) 2 months -> 2 miesiące (2-4, 22-24, 32-34, ...) 5 months -> 5 miesięcy (5-21, 25-31, 35-39, ...)

We might need some sort of i18n library eventually, but I think an equivalent of ngettext would be enough for now.

Jackenmen commented 4 years ago

Made an update, cause I totally screwed up the example 😄