feat: add i18n support

This commit is contained in:
uubulb
2024-11-01 05:07:04 +08:00
parent 482d787a56
commit 5114fc2854
30 changed files with 930 additions and 91 deletions

View File

@@ -1,7 +1,6 @@
package controller
import (
"fmt"
"strconv"
"github.com/gin-gonic/gin"
@@ -57,7 +56,7 @@ func updateServer(c *gin.Context) (any, error) {
var s model.Server
if err := singleton.DB.First(&s, id).Error; err != nil {
return nil, fmt.Errorf("server id %d does not exist", id)
return nil, singleton.Localizer.ErrorT("server id %d does not exist", id)
}
s.Name = sf.Name