翻訳可能

translate 属性 (HTML)

[7] HTMLtranslate 属性は、その要素属性内容を翻訳できるかどうかを表します。

仕様書

翻訳可能属性

[8] 属性は、その種類によって翻訳するべきものとしないべきものがあります。例えば title 属性は翻訳するべきですが、 class 属性は翻訳するべきではありません。 翻訳するべき属性のことを翻訳可能属性 (translatable attribute) といいます。

[9] ある属性が翻訳可能かどうかは、当該属性の仕様 (HTML の場合は >>6) で規定されています。

[11] 翻訳可能属性の中には、条件付きのものもあります。例えば input 要素value 属性は、 type 属性buttonreset の時のみ翻訳可能です。また、 iframe 要素srcdoc 属性の値は HTML文書なので、再帰的に構文解析して翻訳可能な部分を探す必要があります。

[10] 翻訳可能属性機械可読な一覧データは https://raw.github.com/manakai/data-web-defs/master/data/elements.json にあります。

歴史

90年代

[16] 90年代中期の日本では、 Netscape NavigatorInternet Explorer と連動して翻訳を行う製品が存在していました。当時は有料や別売りだった NNIE を同梱したパッケージ製品もありました。

[17] それらは、 Webブラウザーと連動する独自のアプリケーションを使って翻訳結果を表示したり、 プロキシとして動作して Webブラウザー内部に (結果のみ、ページ内併記、あるいはフレームによる併記などの方法で) 翻訳結果を表示するものでした。

[18] この時代には数製品発売されていましたが、 日本語 Webサイトの充実で需要が減少したのか、 数年でブームは去ったようです。

HTML Standard

[19] 10年代になって Chrome が標準で翻訳機能を実装しました。 これは表示中の Webページ翻訳して (DOM 上のテキストを置き換えて) 表示するものです。

[20] 著者翻訳の有無を制御する必要が生じたことから、 HTMLtranslate 属性が追加されました。

[1] Web Applications 1.0 r6971 Introduce a new global attribute for localisers to tell whether or not content should be translated. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=6970&to=6971

[2] [whatwg] Machine translation and related proposals ( ( 版)) http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-June/036354.html

[3] Web Applications 1.0 r7745 Clean up some translation-related things. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=7744&to=7745

[4] Web Applications 1.0 r8276 Mention that other specs may also list translatable attributes. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8275&to=8276

[5] Web Applications 1.0 r8311 Allow <input type=button value> to be translated, since that value isn't submitted ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8310&to=8311

[12] Web Applications 1.0 r8322 Reset buttons also don't get submitted, so it's probably safe to translate them too. ( ( 版)) http://html5.org/tools/web-apps-tracker?from=8321&to=8322

[13] Internationalization Tag Set (ITS) Version 2.0 ( ( 版)) http://www.w3.org/TR/its20/#translatability-implementation

[14] Doc: Using translate directive ( 版) http://angular-translate.github.io/docs/#/guide/05_using-translate-directive

[15] angular-gettext - Super-simple translation support for Angular ( 版) https://angular-gettext.rocketeer.be/

<a href="/" translate>Home</a>

[21] 17954 – Attribute to indicate that the grammar should be translated (e.g. apply declensions), but that the base of the words should remain in the original language ( 版) https://www.w3.org/Bugs/Public/show_bug.cgi?id=17954

[22] Editorial: synchronize with the DOM Standard · whatwg/html@21c6ec7 ( 版) https://github.com/whatwg/html/commit/21c6ec77594eb89b836d4872222f5916910967fd

[23] Editorial: always state invalid value default (GloverDonovan著, ) https://github.com/whatwg/html/commit/7e941ae96b264d4743ea0afac00c3b3209ab0cde

[24] Google Chrome翻訳機能はテキストを翻訳するだけで bidi の調整はしないようです。 アラビア語英語に翻訳すると、 右横書きモードのままで、 句読点が変な位置に表示されます。