refactor: update UI text and error messages to English for better accessibility

This commit is contained in:
Laisky.Cai
2025-01-19 12:59:58 +00:00
parent 76ba80d406
commit 13b1b165bd
62 changed files with 805 additions and 805 deletions

View File

@@ -23,7 +23,7 @@ type wechatLoginResponse struct {
func getWeChatIdByCode(code string) (string, error) {
if code == "" {
return "", errors.New("无效的参数")
return "", errors.New("Invalid parameter")
}
req, err := http.NewRequest("GET", fmt.Sprintf("%s/api/wechat/user?code=%s", config.WeChatServerAddress, code), nil)
if err != nil {
@@ -47,7 +47,7 @@ func getWeChatIdByCode(code string) (string, error) {
return "", errors.New(res.Message)
}
if res.Data == "" {
return "", errors.New("验证码错误或已过期")
return "", errors.New("Verification code error or expired")
}
return res.Data, nil
}
@@ -55,7 +55,7 @@ func getWeChatIdByCode(code string) (string, error) {
func WeChatAuth(c *gin.Context) {
if !config.WeChatAuthEnabled {
c.JSON(http.StatusOK, gin.H{
"message": "管理员未开启通过微信登录以及注册",
"message": "The administrator has not enabled login and registration via WeChat",
"success": false,
})
return
@@ -98,7 +98,7 @@ func WeChatAuth(c *gin.Context) {
} else {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "管理员关闭了新用户注册",
"message": "The administrator has turned off new user registration",
})
return
}
@@ -106,7 +106,7 @@ func WeChatAuth(c *gin.Context) {
if user.Status != model.UserStatusEnabled {
c.JSON(http.StatusOK, gin.H{
"message": "用户已被封禁",
"message": "User has been banned",
"success": false,
})
return
@@ -117,7 +117,7 @@ func WeChatAuth(c *gin.Context) {
func WeChatBind(c *gin.Context) {
if !config.WeChatAuthEnabled {
c.JSON(http.StatusOK, gin.H{
"message": "管理员未开启通过微信登录以及注册",
"message": "The administrator has not enabled login and registration via WeChat",
"success": false,
})
return
@@ -134,7 +134,7 @@ func WeChatBind(c *gin.Context) {
if model.IsWeChatIdAlreadyTaken(wechatId) {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "该微信账号已被绑定",
"message": "The WeChat account has been bound",
})
return
}