使用 Azure 翻译器 防止内容翻译

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

防止翻译的方法

  1. 使用 notranslate 标记您的内容。 根据设计,仅当输入 textType 设置为 HTML 时,此功能才有效

    Example:

    <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 时才有效。

    Example:

    <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. 不要将字符串传递给翻译器进行翻译。

后续步骤