Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LY1806620741 committed Jan 2, 2024
1 parent 588b0ae commit d5d907e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions i18ntools/i18nTools.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func execute() error {
i18nText.` + k + ` = localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "` + k + `",
Other: ` + v + `,
Other: ` + "`" + v + "`" + `,
},
})
`
Expand Down Expand Up @@ -166,7 +166,7 @@ func initMessageMap() map[string]string {

vs, ok1 := v.(string)
if ok1 {
mapres[k] = "`" + vs + "`"
mapres[k] = vs
}
}

Expand Down Expand Up @@ -283,14 +283,16 @@ func extractMessage(cl *ast.CallExpr) {
}

func PutIfExistMessage(maps map[string]string, value string) string {

unquoteValue, _ := strconv.Unquote(value)
for k, v := range maps {
if v == value {
if v == unquoteValue {
log.Println("重复")
return k
}
}
key := fmt.Sprintf("scan%d", len(maps))
maps[key] = value
maps[key] = unquoteValue
return key
}

Expand Down

0 comments on commit d5d907e

Please sign in to comment.