diff --git a/README.md b/README.md index 6d9d60e..748e2b4 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,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 diff --git a/package.json b/package.json index cd7f069..d170dfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gramio/i18n", - "version": "1.1.0", + "version": "1.2.0", "description": "i18n plugin for GramIO with type-safety", "main": "dist/index.cjs", "module": "dist/index.js",