do not add language tags to already good language

This commit is contained in:
2022-02-12 01:27:21 +01:00
parent f2a859d084
commit 5d299dfa17

View File

@@ -724,11 +724,16 @@ func getMatchChat(w http.ResponseWriter, r *http.Request) {
log.Warningf("[GMC] Unable to unmarshal JSON from DeepL: %v", err) log.Warningf("[GMC] Unable to unmarshal JSON from DeepL: %v", err)
goto sendNormalResp goto sendNormalResp
} }
if strings.ToLower(dlRespJSON.Translations[0].DetectedSourceLanguage) == lang.String() {
goto sendNormalResp
}
resp[steamid] = append(resp[steamid], &utils.ChatResponse{ resp[steamid] = append(resp[steamid], &utils.ChatResponse{
Message: dlRespJSON.Translations[0].Text, Message: dlRespJSON.Translations[0].Text,
AllChat: stat.AllChat, AllChat: stat.AllChat,
Tick: stat.Tick, Tick: stat.Tick,
TranslatedFrom: dlRespJSON.Translations[0].DetectedSourceLanguage, TranslatedFrom: strings.ToLower(dlRespJSON.Translations[0].DetectedSourceLanguage),
TranslatedTo: lang.String(), TranslatedTo: lang.String(),
}) })
} }