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:
@@ -27,7 +27,7 @@ type AddressBookForm struct {
|
||||
}
|
||||
|
||||
func (a AddressBookForm) ToAddressBook() *model.AddressBook {
|
||||
//tags转换
|
||||
//tagsconvert
|
||||
tags, _ := json.Marshal(a.Tags)
|
||||
|
||||
return &model.AddressBook{
|
||||
@@ -52,7 +52,7 @@ func (a AddressBookForm) ToAddressBook() *model.AddressBook {
|
||||
|
||||
}
|
||||
func (a AddressBookForm) ToAddressBooks() []*model.AddressBook {
|
||||
//tags转换
|
||||
//tagsconvert
|
||||
tags, _ := json.Marshal(a.Tags)
|
||||
|
||||
abs := make([]*model.AddressBook, 0, len(a.UserIds))
|
||||
@@ -92,7 +92,7 @@ type AddressBookQuery struct {
|
||||
|
||||
type ShareByWebClientForm struct {
|
||||
Id string `json:"id" validate:"required"`
|
||||
PasswordType string `json:"password_type" validate:"required,oneof=once fixed"` //只能是once,fixed
|
||||
PasswordType string `json:"password_type" validate:"required,oneof=once fixed"` //can only be once,fixed
|
||||
Password string `json:"password" validate:"required"`
|
||||
Expire int64 `json:"expire"`
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package admin
|
||||
|
||||
type Login struct {
|
||||
Username string `json:"username" validate:"required" label:"用户名"`
|
||||
Password string `json:"password,omitempty" validate:"required" label:"密码"`
|
||||
Platform string `json:"platform" label:"平台"`
|
||||
Captcha string `json:"captcha,omitempty" label:"验证码"`
|
||||
Username string `json:"username" validate:"required" label:"username"`
|
||||
Password string `json:"password,omitempty" validate:"required" label:"password"`
|
||||
Platform string `json:"platform" label:"platform"`
|
||||
Captcha string `json:"captcha,omitempty" label:"captcha"`
|
||||
CaptchaId string `json:"captcha_id,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
type UserForm struct {
|
||||
Id uint `json:"id"`
|
||||
Username string `json:"username" validate:"required,gte=2,lte=32"`
|
||||
Email string `json:"email"` //validate:"required,email" email不强制
|
||||
Email string `json:"email"` //validate:"required,email" emailnot enforced
|
||||
//Password string `json:"password" validate:"required,gte=4,lte=20"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package api
|
||||
|
||||
type OidcAuthRequest struct {
|
||||
DeviceInfo DeviceInfoInLogin `json:"deviceInfo" label:"设备信息"`
|
||||
DeviceInfo DeviceInfoInLogin `json:"deviceInfo" label:"device info"`
|
||||
Id string `json:"id" label:"id"`
|
||||
Op string `json:"op" label:"op"`
|
||||
Uuid string `json:"uuid" label:"uuid"`
|
||||
|
||||
@@ -36,7 +36,7 @@ func (pf *PeerForm) ToPeer() *model.Peer {
|
||||
}
|
||||
}
|
||||
|
||||
// PersonalAddressBookForm 个人地址簿表单
|
||||
// PersonalAddressBookForm personal address book form
|
||||
type PersonalAddressBookForm struct {
|
||||
model.AddressBook
|
||||
ForceAlwaysRelay string `json:"forceAlwaysRelay"`
|
||||
|
||||
+10
-10
@@ -29,25 +29,25 @@ type DeviceInfoInLogin struct {
|
||||
}
|
||||
|
||||
type LoginForm struct {
|
||||
AutoLogin bool `json:"autoLogin" label:"自动登录"`
|
||||
DeviceInfo DeviceInfoInLogin `json:"deviceInfo" label:"设备信息"`
|
||||
AutoLogin bool `json:"autoLogin" label:"auto login"`
|
||||
DeviceInfo DeviceInfoInLogin `json:"deviceInfo" label:"device info"`
|
||||
Id string `json:"id" label:"id"`
|
||||
Type string `json:"type" label:"type"`
|
||||
Uuid string `json:"uuid" label:"uuid"`
|
||||
Username string `json:"username" validate:"required,gte=2,lte=32" label:"用户名"`
|
||||
Password string `json:"password,omitempty" validate:"gte=4,lte=32" label:"密码"`
|
||||
Username string `json:"username" validate:"required,gte=2,lte=32" label:"username"`
|
||||
Password string `json:"password,omitempty" validate:"gte=4,lte=32" label:"password"`
|
||||
}
|
||||
|
||||
type UserListQuery struct {
|
||||
Page uint `json:"page" form:"page" validate:"required" label:"页码"`
|
||||
PageSize uint `json:"pageSize" form:"pageSize" validate:"required" label:"每页数量"`
|
||||
Status int `json:"status" form:"status" label:"状态"`
|
||||
Page uint `json:"page" form:"page" validate:"required" label:"page number"`
|
||||
PageSize uint `json:"pageSize" form:"pageSize" validate:"required" label:"items per page"`
|
||||
Status int `json:"status" form:"status" label:"status"`
|
||||
Accessible string `json:"accessible" form:"accessible"`
|
||||
}
|
||||
|
||||
type PeerListQuery struct {
|
||||
Page uint `json:"page" form:"page" validate:"required" label:"页码"`
|
||||
PageSize uint `json:"pageSize" form:"pageSize" validate:"required" label:"每页数量"`
|
||||
Status int `json:"status" form:"status" label:"状态"`
|
||||
Page uint `json:"page" form:"page" validate:"required" label:"page number"`
|
||||
PageSize uint `json:"pageSize" form:"pageSize" validate:"required" label:"items per page"`
|
||||
Status int `json:"status" form:"status" label:"status"`
|
||||
Accessible string `json:"accessible" form:"accessible"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user