指定用于Google页面翻译的HTML DOM节点(与class=notranslate相反)

Specify HTML DOM nodes for Google page translation (opposite of class=notranslate)

本文关键字:节点 class 相反 notranslate DOM HTML Google 用于 翻译      更新时间:2023-09-26

我知道你可以通过使用class="notranslate"告诉谷歌翻译不翻译某些部分,但是你能告诉谷歌只翻译特定部分而不翻译其他部分吗?

如果没有,还有其他选择吗?

使用属性translate="",并在body上指定。然后在内部指定要翻译的节点。例如:

<body translate="no">
    <p translate="yes">Will be translated</p>
    <p>Will not be translated</p>
</body>
<body class="notranslate">
    <p class="translate">Will be translated</p>
    <p>Will not be translated</p>
</body>

for me