Skip to content

Commit

Permalink
fix: translator test
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 committed Dec 29, 2022
1 parent 2d73f0f commit 1581cc8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/i18n/translator_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package i18n

import (
"fmt"
"testing"

"github.com/stretchr/testify/assert"
)

func TestTranslator(t *testing.T) {
l := &Translator{}
l.NewBundle(LocaleFS)
l.NewTranslator()
res := l.Trans("zh", "login.userNotExist")
fmt.Println(res)
assert.Equal(t, "用户不存在", res)
}

0 comments on commit 1581cc8

Please sign in to comment.