翻译预防机制不起作用

Translation prevention mechanism does not work

例如,我想将 "Overview of Azure Machines" 翻译成 "de",其中 "Azure Machines" 不应该被翻译,但它有几个问题。

这是the documentation我相关的。

通过 @# 可以转义单个单词。

不翻译句子或句子的一部分不会:

Input (plain): Overview of <span class="notranslate">Azure Machines</span>
Output       : Übersicht über die Option "span class="notranslate">Azure Machines</span>
Issue        : Opening angle bracket removed

Input (HTML) : Overview of <span class="notranslate">Azure Machines</span>
Output       : --- This is the only combination that works but not documented. ---
Issue        : --- This is the only combination that works but not documented. ---

Input (plain): Overview of <div class="notranslate">Azure Machines</div>
Output       : Übersicht über die Datei »div class="notranslate">Azure Machines</div>
Issue        : Opening angle bracket replaced

Input (HTML) : Overview of <div class="notranslate">Azure Machines</div>
Output       : Übersicht über<div class="notranslate">Azure Machines</div>
Issue        : Space before opening angle bracket removed

注意: 文档是 updated,现在说 class="notranslate" 场景仅适用于 HTML(所以 Input (plain) 示例现在超出了此处的范围)。

不过我还有以下问题:

对于那些 "no-translate" 场景,我不想使用字典语法,因为它会导致字符数急剧增加,从而增加成本。

还有一个与问题无关的旁注:将它命名为 "Twitter tag" 真的很奇怪。它与推特无关。这些只是两个可能的转义前缀字符。

文档明确指出这仅适用于 html 模式。您需要使用 no-translate 标签才能不翻译部分句子。

只支持div和span,不支持所有html标签。此外,您不应该在 no-translate 标签之外重复您不想翻译的内容。 对于您的示例,span 保留 space.

Overview of <span class="notranslate">Azure Machines</span>

Übersicht über <span class=\"notranslate\">Azure Machines</span>

It's by design that this works only when the input textType is set as HTML