i18n翻译
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"epic/internal/consts"
|
||||
"epic/internal/dao"
|
||||
"epic/internal/logic/i18n"
|
||||
"epic/internal/model/dto"
|
||||
"epic/internal/model/entity"
|
||||
"epic/internal/util"
|
||||
@@ -224,9 +225,14 @@ func (t *ThirdPartyDataSync) saveHeroData(ctx context.Context, hero *dto.ThirdPa
|
||||
status60 := hero.CalculatedStatus["Lv60SixStarFullyAwakened"]
|
||||
status60json, _ := gjson.EncodeString(status60)
|
||||
heroJson, _ := gjson.EncodeString(hero)
|
||||
// 使用i18n服务转换字段
|
||||
zhHeroName := i18n.GetZh(ctx, hero.Name)
|
||||
zhRole := i18n.GetZh(ctx, hero.Role)
|
||||
zhAttribute := i18n.GetZh(ctx, hero.Attribute)
|
||||
|
||||
newHero := &entity.EpicHeroInfo{
|
||||
Id: 0,
|
||||
HeroName: "",
|
||||
HeroName: zhHeroName,
|
||||
HeroCode: hero.Code,
|
||||
HeroAttrLv60: status60json,
|
||||
Creator: "",
|
||||
@@ -236,10 +242,10 @@ func (t *ThirdPartyDataSync) saveHeroData(ctx context.Context, hero *dto.ThirdPa
|
||||
Deleted: false,
|
||||
NickName: "",
|
||||
Rarity: strconv.Itoa(hero.Rarity),
|
||||
Role: hero.Role,
|
||||
Role: zhRole,
|
||||
Zodiac: "",
|
||||
HeadImgUrl: "",
|
||||
Attribute: "",
|
||||
Attribute: zhAttribute,
|
||||
Remark: "",
|
||||
RawJson: heroJson,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user