Skip to content

Commit

Permalink
feat: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lastares committed Aug 23, 2024
1 parent d2efc3b commit 37507a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ i18n: i18n,
```

4. 调用翻译函数,具体根据实际业务逻辑进行处理

```go
func (u *UserService) Store(ctx context.Context, media *model.user) (*service.User, error) {
// 其他逻辑,伪代码
// 翻译
// 翻译
msg := u.i18n.Tran(ctx, "user not found")
// 带变量模板的翻译
msg = u.i18n.TranWithTemplate(ctx, "user not found", map[string]any{"name": "ares"})
Expand Down

0 comments on commit 37507a8

Please sign in to comment.