diff --git a/docs/plugins/official/i18n.md b/docs/plugins/official/i18n.md index ca7df2e..79c701f 100644 --- a/docs/plugins/official/i18n.md +++ b/docs/plugins/official/i18n.md @@ -94,6 +94,20 @@ const bot = new Bot(process.env.BOT_TOKEN as string) }); ``` +### Plurals + +```ts +import { pluralizeEnglish, pluralizeRussian } from "@gramio/i18n"; + +const count = 5; + +console.log(`You have ${count} ${pluralizeEnglish(count, "apple", "apples")}.`); // You have 5 apples. + +console.log( + `У вас ${count} ${pluralizeRussian(count, "яблоко", "яблока", "яблок")}.` +); // У вас 5 яблок. +``` + `ExtractLanguages` helps you extract languages types from i18n instance. ```ts