translate
Baseline 2023Newly 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
グローバル属性 は列挙型属性で、要素の翻訳可能な属性の値や Text
子ノードを、ページをローカライズする際に翻訳するべきか、あるいは変更せずにおくかを指定します。
以下の値を使用することができます。
- 空文字列または
yes
: ページをローカライズする際に翻訳すべきであることを示します。 no
: 要素を翻訳してはならないことを示します。
すべてのブラウザーがこの属性を認識しているわけではありませんが、 Google 翻訳のような自動翻訳システムがこれを尊重しており、人間の翻訳者によって使用されるツールによっても尊重される可能性があります。そのため、ウェブ制作者がこの属性を使用して、翻訳されるべきではないコンテンツをマークすることが重要です。
例
この例では translate
属性を使用して、翻訳ツールにフッターの企業ブランド名を翻訳しないように依頼しています。
html
<footer>
<small>© 2020 <span translate="no">BrandName</span></small>
</footer>
仕様書
Specification |
---|
HTML # attr-translate |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
translate |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
- すべてのグローバル属性。
HTMLElement.translate
プロパティは、この属性を反映します。- Using HTML's translate attribute.
- HTML の
lang
属性