translate
Baseline 2023
Newly available
Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
translate
全局属性 是一个 enumerated 属性,用于指定在本地化页面时是否应翻译元素的可翻译属性值及其 Text
子节点,或者是否保持它们不变。
¥The translate
global attribute is an enumerated attribute that is used to specify whether an element's translatable attribute values and its Text
node children should be translated when the page is localized, or whether to leave them unchanged.
它可以具有以下值:
¥It can have the following values:
- 空字符串或
yes
,表示页面本地化时应翻译该元素。 no
,表示该元素不能被翻译。
尽管并非所有浏览器都识别此属性,但它受到 Google Translate 等自动翻译系统的尊重,并且也可能受到人工翻译人员使用的工具的尊重。因此,网络作者使用此属性来标记不应翻译的内容非常重要。
¥Although not all browsers recognize this attribute, it is respected by automatic translation systems such as Google Translate, and may also be respected by tools used by human translators. As such it's important that web authors use this attribute to mark content that should not be translated.
示例
规范
Specification |
---|
HTML Standard # attr-translate |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also
- 全部 全局属性。
- 反映此属性的
HTMLElement.translate
属性。 - 使用 HTML 的翻译属性。
- HTML
lang
属性