如何通过 Azure AI 翻译阻止内容被翻译

使用 Azure AI 翻译,你可以标记内容,使之不被翻译。 例如,你可能想要标记本地化后没有意义的代码、品牌名称或单词/短语。

阻止翻译的方法

  1. 使用 notranslate 标记内容。 根据设计,仅当输入 textType 设置为 HTML 时,这才起作用

    示例:

    <span class="notranslate">This will not be translated.</span>
    <span>This will be translated. </span>
    
    <div class="notranslate">This will not be translated.</div>
    <div>This will be translated. </div>
    
  2. 使用 translate="no" 标记内容。 此标记仅在将输入的 textType 设置为 HTML 时才有效。

    示例:

    <span translate="no">This will not be translated.</span>
    <span>This will be translated. </span>
    
    <div translate="no">This will not be translated.</div>
    <div>This will be translated. </div>
    
  3. 使用动态词典给出特定翻译。

  4. 不要将字符串传递到翻译器进行翻译。

后续步骤