do not add language tags to already good language
This commit is contained in:
7
main.go
7
main.go
@@ -724,11 +724,16 @@ func getMatchChat(w http.ResponseWriter, r *http.Request) {
|
||||
log.Warningf("[GMC] Unable to unmarshal JSON from DeepL: %v", err)
|
||||
goto sendNormalResp
|
||||
}
|
||||
|
||||
if strings.ToLower(dlRespJSON.Translations[0].DetectedSourceLanguage) == lang.String() {
|
||||
goto sendNormalResp
|
||||
}
|
||||
|
||||
resp[steamid] = append(resp[steamid], &utils.ChatResponse{
|
||||
Message: dlRespJSON.Translations[0].Text,
|
||||
AllChat: stat.AllChat,
|
||||
Tick: stat.Tick,
|
||||
TranslatedFrom: dlRespJSON.Translations[0].DetectedSourceLanguage,
|
||||
TranslatedFrom: strings.ToLower(dlRespJSON.Translations[0].DetectedSourceLanguage),
|
||||
TranslatedTo: lang.String(),
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user