Skip to content

Commit

Permalink
Sync i18n example from #126
Browse files Browse the repository at this point in the history
  • Loading branch information
WingLim committed Dec 5, 2021
1 parent dea7ae0 commit 40789c9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions site/docs/zh/plugins/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ bot.start();
为了完全支持 TypeScript,你还需要调整你的 [上下文调味剂](/zh/guide/context.md#上下文调味剂)。检查链接以了解它们如何工作的更多细节。这里是一个简短的例子:

```ts
import { I18nContext } from "../source";
import { Context as BaseContext, SessionFlavor } from "grammy";
import { I18nContextFlavor } from "@grammyjs/i18n";

interface Session {
apples?: number;
}

interface MySessionFlavor {
readonly i18n: I18nContext;
session: Session;
}
export type MyContext =
& BaseContext
& SessionFlavor<Session>
& I18nContextFlavor;
```

更多详情和完整的运行示例请查看 [i18n 仓库 README](https://github.com/grammyjs/i18n#readme)
Expand Down

0 comments on commit 40789c9

Please sign in to comment.