Google Translate API outputs HTML entities

前端 未结 4 2078
小蘑菇
小蘑菇 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:04

    If you specify format Text, content inside HTML tags will be translated as well. Assume your input is:

    This is a link

    then example and path will be translated as well, which breaks the link.

    To avoid this and fix your problem, stick with format HTML and unescape the text you received back from google translate. In php you might use html_entity_decode.

提交回复
热议问题