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:
+4
-4
@@ -23,7 +23,7 @@ func CopyStructByJson(src, dst interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// CopyStructToMap 结构体转map
|
||||
// CopyStructToMap converts a struct to a map
|
||||
func CopyStructToMap(src interface{}) map[string]interface{} {
|
||||
var res = map[string]interface{}{}
|
||||
str, _ := json.Marshal(src)
|
||||
@@ -64,7 +64,7 @@ func SafeGo(f interface{}, params ...interface{}) {
|
||||
}()
|
||||
}
|
||||
|
||||
// RandomString 生成随机字符串
|
||||
// RandomString generates a random string
|
||||
func RandomString(n int) string {
|
||||
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
length := len(letterBytes)
|
||||
@@ -79,7 +79,7 @@ func RandomString(n int) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// Keys 泛型函数,K 是键类型,V 是值类型
|
||||
// Keys generic function; K is the key type, V is the value type
|
||||
func Keys[K comparable, V any](m map[K]V) []K {
|
||||
keys := make([]K, 0, len(m))
|
||||
for k := range m {
|
||||
@@ -88,7 +88,7 @@ func Keys[K comparable, V any](m map[K]V) []K {
|
||||
return keys
|
||||
}
|
||||
|
||||
// Values 泛型函数,K 是键类型,V 是值类型
|
||||
// Values generic function; K is the key type, V is the value type
|
||||
func Values[K comparable, V any](m map[K]V) []V {
|
||||
values := make([]V, 0, len(m))
|
||||
for _, v := range m {
|
||||
|
||||
Reference in New Issue
Block a user