Skip to content

Commit

Permalink
fix: rephrase example
Browse files Browse the repository at this point in the history
  • Loading branch information
strbit committed Sep 16, 2024
1 parent 698588e commit 08b431f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { I18n, I18nFlavor } from "https://deno.land/x/grammy_i18n/mod.ts";

## Example

An example project structure, you can also seperate your translations into different files to make it easier to maintain large projects.
Nested translations don't change how you use translation keys, so nothing should break if you decide to use them.
Below is an example featuring both nested (`locales/en/...`) and standard (`locales/it.ftl`) file structure variants. Nested translations allow you to seperate your keys into different files (making it easier to maintain larger projects) while also letting you use the standard variant at the same time. Using a nested file structure alongside the standard variant won't break any existing translations.

```
.
Expand All @@ -35,7 +34,7 @@ Nested translations don't change how you use translation keys, so nothing should
└── bot.ts
```

By splitting translations you don't change how you retrieve the keys contained within them, so for example, a key called `greeting` which is located in either `locales/it.ftl` or `locales/en/dialogues/greeting.ftl` can be retrieved by simply using `ctx.t("greeting")`.
By splitting translations you don't change how you retrieve the keys contained within them, so for example, a key called `greeting` which is located in either `locales/en.ftl` or `locales/en/dialogues/greeting.ftl` can be retrieved by simply using `ctx.t("greeting")`.

Example bot
[not using sessions](https://grammy.dev/plugins/i18n.html#without-sessions):
Expand Down

0 comments on commit 08b431f

Please sign in to comment.