Skip to content

Commit

Permalink
chore: add docs and bump
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Dec 4, 2024
1 parent 633ca83 commit 22af72e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 22af72e

Please sign in to comment.