Google Translate API outputs HTML entities

前端 未结 4 2054
小蘑菇
小蘑菇 2021-01-18 00:52

ENGLISH: Sale ID prefix is a required field

FRENCH: Vente préfixe d'ID est un champ obligatoire

Is there a way to have goog

4条回答
  •  再見小時候
    2021-01-18 01:13

    For anyone working in java, there is a format method in Translate.TranslateOption

    So right now you might have something translate call like such:

    YourTranslateObject.translate(yourTextToBeTranslated,Translate.TranslateOption.targetLanguage(yourTargetLanguageCode))

    all you need to do is add a third parameter:

    YourTranslateObject.translate(yourTextToBeTranslated,Translate.TranslateOption.targetLanguage(yourTargetLanguageCode), Translate.TranslateOption.format("text"))

    since HTML is default, this will switch it to text.

提交回复
热议问题