Skip to content

Commit

Permalink
chore: update plurals at i18n plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed Dec 4, 2024
1 parent ad5bbb5 commit 9817752
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/plugins/official/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9817752

Please sign in to comment.