i18n: Translate all Chinese to English across the codebase
Translate Chinese comments, log/error messages, validator labels and Swagger annotations to English throughout the source code, generated Swagger docs, config files and CI workflows. Make the English README primary: README.md now holds the English docs and README_EN.md holds the Chinese version, with cross-language links updated accordingly. Note: the generated docs/ swagger files were translated in place; run `go generate ./...` (swag init) to regenerate them from the now-English annotations when a Go toolchain is available. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-6
@@ -34,30 +34,30 @@ Hj4yO4j5LOWDMTgDcLsZTxbGiTzkNc/HghrNIevDAQdgjJQNl84zDjyyCA4r/MA7
|
||||
bYJTtYj8q6J0EDbRdT9b6hMclyzjNXdx2loJxR0R8WUeL1lDEPq8
|
||||
-----END RSA PRIVATE KEY-----`
|
||||
|
||||
// 测试token生成
|
||||
// test token generation
|
||||
func TestGenerateToken(t *testing.T) {
|
||||
jwtService := NewJwt(pk, time.Second*1000)
|
||||
token := jwtService.GenerateToken(1)
|
||||
if token == "" {
|
||||
t.Fatal("token生成失败")
|
||||
t.Fatal("token generation failed")
|
||||
}
|
||||
fmt.Println(pk, token)
|
||||
}
|
||||
|
||||
// 测试token解析
|
||||
// test token parsing
|
||||
func TestParseToken(t *testing.T) {
|
||||
jwtService := NewJwt(pk, time.Second*1000)
|
||||
token := jwtService.GenerateToken(999)
|
||||
if token == "" {
|
||||
t.Fatal("token生成失败")
|
||||
t.Fatal("token generation failed")
|
||||
}
|
||||
uid, err := jwtService.ParseToken(token)
|
||||
if err != nil {
|
||||
|
||||
t.Fatal("token解析失败", err)
|
||||
t.Fatal("token parsing failed", err)
|
||||
}
|
||||
if uid != 999 {
|
||||
t.Fatal("token解析失败")
|
||||
t.Fatal("token parsing failed")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user