You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The translator and language detector APIs gives web pages the ability to translate text between languages, and detect the language of such text.</p>
769
769
</div>
770
-
<h2class="no-num no-toc no-ref heading settled" id="sotd"><spanclass="content">Status of this document</span></h2>
770
+
<h2class="heading no-num no-ref no-toc settled" id="sotd"><spanclass="content">Status of this document</span></h2>
771
771
<divdata-fill-with="status">
772
772
<p>
773
773
This specification was published by the <ahref="https://www.w3.org/community/webmachinelearning/">Web Machine Learning Community Group</a>.
<p>As with the rest of the web platform, human languages are identified in these APIs by BCP 47 language tags, such as "<code>ja</code>", "<code>en-US</code>", "<code>sr-Cyrl</code>", or "<code>de-CH-1901-x-phonebk-extended</code>". The specific algorithms used for validation, canonicalization, and language tag matching are those from the <cite>ECMAScript Internationalization API Specification</cite>, which in turn defers some of its processing to <cite>Unicode Locale Data Markup Language (LDML)</cite>. <adata-link-type="biblio" href="#biblio-bcp47" title="Tags for Identifying Languages">[BCP47]</a><adata-link-type="biblio" href="#biblio-ecma-402" title="ECMAScript Internationalization API Specification">[ECMA-402]</a><adata-link-type="biblio" href="#biblio-uts35" title="Unicode Locale Data Markup Language (LDML)">[UTS35]</a>.</p>
845
845
<p>These APIs are part of a family of APIs expected to be powered by machine learning models, which share common API surface idioms and specification patterns. Currently, the specification text for these shared parts lives in <ahref="https://webmachinelearning.github.io/writing-assistance-apis/#supporting"><cite>Writing Assistance APIs</cite> § 5 Shared infrastructure</a>, and the common privacy and security considerations are discussed in <ahref="https://webmachinelearning.github.io/writing-assistance-apis/#privacy"><cite>Writing Assistance APIs</cite> § 6 Privacy considerations</a> and <ahref="https://webmachinelearning.github.io/writing-assistance-apis/#security"><cite>Writing Assistance APIs</cite> § 7 Security considerations</a>. Implementing these APIs requires implementing that shared infrastructure, and conforming to those privacy and security considerations. But it does not require implementing or exposing the actual writing assistance APIs. <adata-link-type="biblio" href="#biblio-writing-assistance-apis" title="Writing Assistance APIs">[WRITING-ASSISTANCE-APIS]</a></p>
<p>The use of <adata-link-type="abstract-op" href="https://tc39.es/ecma402/#sec-lookupmatchinglocalebybestfit" id="ref-for-sec-lookupmatchinglocalebybestfit②">LookupMatchingLocaleByBestFit</a> means that <codeclass="idl"><adata-link-type="idl" href="#dom-translator-availability" id="ref-for-dom-translator-availability①">availability()</a></code> will probably give the following answers:</p>
<p>Access to the translator API is gated behind the <adata-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature">policy-controlled feature</a> "<dfnclass="dfn-paneled idl-code" data-dfn-type="permission" data-exportid="permissiondef-translator"><code>translator</code></dfn>", which has a <adata-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature-default-allowlist" id="ref-for-policy-controlled-feature-default-allowlist">default allowlist</a> of <code><adata-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#default-allowlist-self" id="ref-for-default-allowlist-self">'self'</a></code>.</p>
1341
1341
<h2class="heading settled" data-level="4" id="language-detector-api"><spanclass="secno">4. </span><spanclass="content">The language detector API</span><aclass="self-link" href="#language-detector-api"></a></h2>
<p>Please see <ahref="https://webmachinelearning.github.io/writing-assistance-apis/#security"><cite>Writing Assistance APIs</cite> § 7 Security considerations</a> for a discussion of security considerations for the translator and language detector APIs. That text was written to apply to all APIs sharing the same infrastructure, as noted in <ahref="#dependencies">§ 2 Dependencies</a>.</p>
<h3class="no-num no-ref heading settled" id="index-defined-here"><spanclass="content">Terms defined by this specification</span><aclass="self-link" href="#index-defined-here"></a></h3>
<h3class="heading no-num no-ref settled" id="index-defined-here"><spanclass="content">Terms defined by this specification</span><aclass="self-link" href="#index-defined-here"></a></h3>
1719
1719
<ulclass="index">
1720
1720
<li><ahref="#dom-languagedetector-availability">availability()</a><span>, in § 4.2</span>
<li><ahref="#validate-and-canonicalize-language-detector-options">validate and canonicalize language detector options</a><span>, in § 4.1</span>
1839
1839
<li><ahref="#validate-and-canonicalize-translator-options">validate and canonicalize translator options</a><span>, in § 3.1</span>
1840
1840
</ul>
1841
-
<h3class="no-num no-ref heading settled" id="index-defined-elsewhere"><spanclass="content">Terms defined by reference</span><aclass="self-link" href="#index-defined-elsewhere"></a></h3>
1841
+
<h3class="heading no-num no-ref settled" id="index-defined-elsewhere"><spanclass="content">Terms defined by reference</span><aclass="self-link" href="#index-defined-elsewhere"></a></h3>
1842
1842
<ulclass="index">
1843
1843
<li>
1844
1844
<adata-link-type="biblio">[DOM]</a> defines the following terms:
<dd>Anne van Kesteren. <ahref="https://dom.spec.whatwg.org/"><cite>DOM Standard</cite></a>. Living Standard. URL: <ahref="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
<dd><ahref="https://webmachinelearning.github.io/writing-assistance-apis/"><cite>Writing Assistance APIs</cite></a>. Draft Community Group Report. URL: <ahref="https://webmachinelearning.github.io/writing-assistance-apis/">https://webmachinelearning.github.io/writing-assistance-apis/</a>
<dd>A. Phillips, Ed.; M. Davis, Ed.. <ahref="https://www.rfc-editor.org/rfc/rfc5646"><cite>Tags for Identifying Languages</cite></a>. September 2009. Best Current Practice. URL: <ahref="https://www.rfc-editor.org/rfc/rfc5646">https://www.rfc-editor.org/rfc/rfc5646</a>
2001
2001
<dtid="biblio-uts35">[UTS35]
2002
2002
<dd>Mark Davis; et al. <ahref="https://www.unicode.org/reports/tr35/tr35-61/tr35.html"><cite>Unicode Locale Data Markup Language (LDML)</cite></a>. 23 October 2020. Unicode Technical Standard #35. URL: <ahref="https://www.unicode.org/reports/tr35/tr35-61/tr35.html">https://www.unicode.org/reports/tr35/tr35-61/tr35.html</a>
0 commit comments