Skip to content

Commit 0c0a6b7

Browse files
Bump actions/checkout from 5 to 6 in the actions-org group
SHA: 02777c6 Reason: push, by dependabot[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6042354 commit 0c0a6b7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

index.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<title>Translator and Language Detector APIs</title>
66
<meta content="CG-DRAFT" name="w3c-status">
77
<link href="https://www.w3.org/StyleSheets/TR/2021/cg-draft" rel="stylesheet">
8-
<meta content="Bikeshed version 3f621ba99, updated Mon Jul 28 15:38:36 2025 -0700" name="generator">
8+
<meta content="Bikeshed version 86e3be07a, updated Tue Nov 18 16:58:08 2025 +0000" name="generator">
99
<link href="https://webmachinelearning.github.io/translation-api" rel="canonical">
1010
<link href="https://www.w3.org/2008/site/images/favicon.ico" rel="icon">
11-
<meta content="a653ed8abb3e1c6249054b5d574368c3e1993cf6" name="revision">
11+
<meta content="02777c6dfb4936617c237443187d0b03286af2af" name="revision">
1212
<meta content="dark light" name="color-scheme">
1313
<link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css">
1414
<style>/* Boilerplate: style-autolinks */
@@ -321,7 +321,7 @@
321321
}
322322
.invalid.example:not(.no-marker)::before,
323323
.illegal.example:not(.no-marker)::before {
324-
content: "Invalid Example" counter(example);
324+
content: "Invalid Example " counter(example);
325325
}
326326

327327
figcaption {
@@ -741,9 +741,9 @@
741741
<img alt="Logo" height="100" src="https://webmachinelearning.github.io/webmachinelearning-logo.png" width="100">
742742
</a>
743743
</p>
744-
<h1 class="p-name no-ref" id="title">Translator and Language Detector APIs</h1>
744+
<h1 class="no-ref p-name" id="title">Translator and Language Detector APIs</h1>
745745
<p id="w3c-state"><a href="https://www.w3.org/standards/types/#CG-DRAFT">Draft Community Group Report</a>,
746-
<time class="dt-updated" datetime="2025-08-19">19 August 2025</time></p>
746+
<time class="dt-updated" datetime="2025-11-25">25 November 2025</time></p>
747747
<details open>
748748
<summary>More details about this document</summary>
749749
<div data-fill-with="spec-metadata">
@@ -753,7 +753,7 @@ <h1 class="p-name no-ref" id="title">Translator and Language Detector APIs</h1>
753753
<dt>Issue Tracking:
754754
<dd><a href="https://github.com/webmachinelearning/translation-api/issues/">GitHub</a>
755755
<dt class="editor">Editor:
756-
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="https://domenic.me/">Domenic Denicola</a> (<a class="p-org org" href="https://google.com">Google</a>) <a class="u-email email" href="mailto:d@domenic.me">d@domenic.me</a>
756+
<dd class="editor h-card p-author vcard"><a class="fn p-name u-url url" href="https://domenic.me/">Domenic Denicola</a> (<a class="org p-org" href="https://google.com">Google</a>) <a class="email u-email" href="mailto:d@domenic.me">d@domenic.me</a>
757757
</dl>
758758
</div>
759759
</details>
@@ -764,10 +764,10 @@ <h1 class="p-name no-ref" id="title">Translator and Language Detector APIs</h1>
764764
<hr title="Separator for header">
765765
</div>
766766
<div class="p-summary" data-fill-with="abstract">
767-
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
767+
<h2 class="heading no-num no-ref no-toc settled" id="abstract"><span class="content">Abstract</span></h2>
768768
<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>
769769
</div>
770-
<h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2>
770+
<h2 class="heading no-num no-ref no-toc settled" id="sotd"><span class="content">Status of this document</span></h2>
771771
<div data-fill-with="status">
772772
<p>
773773
This specification was published by the <a href="https://www.w3.org/community/webmachinelearning/">Web Machine Learning Community Group</a>.
@@ -784,7 +784,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content"
784784
</div>
785785
<div data-fill-with="at-risk"></div>
786786
<nav data-fill-with="table-of-contents" id="toc">
787-
<h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
787+
<h2 class="no-num no-ref no-toc" id="contents">Table of Contents</h2>
788788
<ol class="toc" role="directory">
789789
<li><a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
790790
<li><a href="#dependencies"><span class="secno">2</span> <span class="content">Dependencies</span></a>
@@ -844,7 +844,7 @@ <h2 class="heading settled" data-level="2" id="dependencies"><span class="secno"
844844
<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>. <a data-link-type="biblio" href="#biblio-bcp47" title="Tags for Identifying Languages">[BCP47]</a> <a data-link-type="biblio" href="#biblio-ecma-402" title="ECMAScript Internationalization API Specification">[ECMA-402]</a> <a data-link-type="biblio" href="#biblio-uts35" title="Unicode Locale Data Markup Language (LDML)">[UTS35]</a>.</p>
845845
<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 <a href="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 <a href="https://webmachinelearning.github.io/writing-assistance-apis/#privacy"><cite>Writing Assistance APIs</cite> § 6 Privacy considerations</a> and <a href="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. <a data-link-type="biblio" href="#biblio-writing-assistance-apis" title="Writing Assistance APIs">[WRITING-ASSISTANCE-APIS]</a></p>
846846
<h2 class="heading settled" data-level="3" id="translator-api"><span class="secno">3. </span><span class="content">The translator API</span><a class="self-link" href="#translator-api"></a></h2>
847-
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>]
847+
<pre class="def highlight idl">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>]
848848
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="translator"><code><c- g>Translator</c-></code></dfn> {
849849
<c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#translator" id="ref-for-translator"><c- n>Translator</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-translator-create" id="ref-for-dom-translator-create"><c- g>create</c-></a>(<a data-link-type="idl-name" href="#dictdef-translatorcreateoptions" id="ref-for-dictdef-translatorcreateoptions"><c- n>TranslatorCreateOptions</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Translator/create(options)" data-dfn-type="argument" data-export id="dom-translator-create-options-options"><code><c- g>options</c-></code></dfn>);
850850
<c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise①"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="https://webmachinelearning.github.io/writing-assistance-apis/#enumdef-availability" id="ref-for-enumdef-availability"><c- n>Availability</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-translator-availability" id="ref-for-dom-translator-availability"><c- g>availability</c-></a>(<a data-link-type="idl-name" href="#dictdef-translatorcreatecoreoptions" id="ref-for-dictdef-translatorcreatecoreoptions"><c- n>TranslatorCreateCoreOptions</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="Translator/availability(options)" data-dfn-type="argument" data-export id="dom-translator-availability-options-options"><code><c- g>options</c-></code></dfn>);
@@ -1064,7 +1064,7 @@ <h3 class="heading settled" data-level="3.2" id="translator-availability"><span
10641064
<p>("<code>en</code>", "<code>zh-Hant</code>") → "<code class="idl"><a data-link-type="idl" href="https://webmachinelearning.github.io/writing-assistance-apis/#dom-availability-downloadable" id="ref-for-dom-availability-downloadable②">downloadable</a></code>"</p>
10651065
</ul>
10661066
<p>The use of <a data-link-type="abstract-op" href="https://tc39.es/ecma402/#sec-lookupmatchinglocalebybestfit" id="ref-for-sec-lookupmatchinglocalebybestfit②">LookupMatchingLocaleByBestFit</a> means that <code class="idl"><a data-link-type="idl" href="#dom-translator-availability" id="ref-for-dom-translator-availability①">availability()</a></code> will probably give the following answers:</p>
1067-
<pre class="language-js highlight"><c- a>function</c-> a<c- p>(</c->sourceLanguage<c- p>,</c-> targetLanguage<c- p>)</c-> <c- p>{</c->
1067+
<pre class="highlight language-js"><c- a>function</c-> a<c- p>(</c->sourceLanguage<c- p>,</c-> targetLanguage<c- p>)</c-> <c- p>{</c->
10681068
<c- k>return</c-> ai<c- p>.</c->translator<c- p>.</c->availability<c- p>({</c-> sourceLanguage<c- p>,</c-> targetLanguage <c- p>})</c-><c- o>:</c->
10691069
<c- p>}</c->
10701070

@@ -1339,7 +1339,7 @@ <h4 class="heading settled" data-level="3.4.3" id="translator-errors"><span clas
13391339
<h3 class="heading settled" data-level="3.5" id="translator-permissions-policy"><span class="secno">3.5. </span><span class="content">Permissions policy integration</span><a class="self-link" href="#translator-permissions-policy"></a></h3>
13401340
<p>Access to the translator API is gated behind the <a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature">policy-controlled feature</a> "<dfn class="dfn-paneled idl-code" data-dfn-type="permission" data-export id="permissiondef-translator"><code>translator</code></dfn>", which has a <a data-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><a data-link-type="dfn" href="https://w3c.github.io/webappsec-permissions-policy/#default-allowlist-self" id="ref-for-default-allowlist-self">'self'</a></code>.</p>
13411341
<h2 class="heading settled" data-level="4" id="language-detector-api"><span class="secno">4. </span><span class="content">The language detector API</span><a class="self-link" href="#language-detector-api"></a></h2>
1342-
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>]
1342+
<pre class="def highlight idl">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>]
13431343
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="languagedetector"><code><c- g>LanguageDetector</c-></code></dfn> {
13441344
<c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise" id="ref-for-idl-promise④"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#languagedetector" id="ref-for-languagedetector"><c- n>LanguageDetector</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-languagedetector-create" id="ref-for-dom-languagedetector-create"><c- g>create</c-></a>(
13451345
<c- b>optional</c-> <a data-link-type="idl-name" href="#dictdef-languagedetectorcreateoptions" id="ref-for-dictdef-languagedetectorcreateoptions"><c- n>LanguageDetectorCreateOptions</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="LanguageDetector/create(options), LanguageDetector/create()" data-dfn-type="argument" data-export id="dom-languagedetector-create-options-options"><code><c- g>options</c-></code></dfn> = {}
@@ -1714,8 +1714,8 @@ <h2 class="heading settled" data-level="6" id="security"><span class="secno">6.
17141714
<p>Please see <a href="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 <a href="#dependencies">§ 2 Dependencies</a>.</p>
17151715
</main>
17161716
<script src="https://www.w3.org/scripts/TR/2021/fixup.js"></script>
1717-
<h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
1718-
<h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
1717+
<h2 class="heading no-num no-ref settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
1718+
<h3 class="heading no-num no-ref settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
17191719
<ul class="index">
17201720
<li><a href="#dom-languagedetector-availability">availability()</a><span>, in § 4.2</span>
17211721
<li>
@@ -1838,7 +1838,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
18381838
<li><a href="#validate-and-canonicalize-language-detector-options">validate and canonicalize language detector options</a><span>, in § 4.1</span>
18391839
<li><a href="#validate-and-canonicalize-translator-options">validate and canonicalize translator options</a><span>, in § 3.1</span>
18401840
</ul>
1841-
<h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
1841+
<h3 class="heading no-num no-ref settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
18421842
<ul class="index">
18431843
<li>
18441844
<a data-link-type="biblio">[DOM]</a> defines the following terms:
@@ -1972,8 +1972,8 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
19721972
<li><span class="dfn-paneled" id="814c5352">validate and canonicalize language tags</span>
19731973
</ul>
19741974
</ul>
1975-
<h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
1976-
<h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
1975+
<h2 class="heading no-num no-ref settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
1976+
<h3 class="heading no-num no-ref settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
19771977
<dl>
19781978
<dt id="biblio-dom">[DOM]
19791979
<dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/"><cite>DOM Standard</cite></a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
@@ -1994,15 +1994,15 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N
19941994
<dt id="biblio-writing-assistance-apis">[WRITING-ASSISTANCE-APIS]
19951995
<dd><a href="https://webmachinelearning.github.io/writing-assistance-apis/"><cite>Writing Assistance APIs</cite></a>. Draft Community Group Report. URL: <a href="https://webmachinelearning.github.io/writing-assistance-apis/">https://webmachinelearning.github.io/writing-assistance-apis/</a>
19961996
</dl>
1997-
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
1997+
<h3 class="heading no-num no-ref settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
19981998
<dl>
19991999
<dt id="biblio-bcp47">[BCP47]
20002000
<dd>A. Phillips, Ed.; M. Davis, Ed.. <a href="https://www.rfc-editor.org/rfc/rfc5646"><cite>Tags for Identifying Languages</cite></a>. September 2009. Best Current Practice. URL: <a href="https://www.rfc-editor.org/rfc/rfc5646">https://www.rfc-editor.org/rfc/rfc5646</a>
20012001
<dt id="biblio-uts35">[UTS35]
20022002
<dd>Mark Davis; et al. <a href="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: <a href="https://www.unicode.org/reports/tr35/tr35-61/tr35.html">https://www.unicode.org/reports/tr35/tr35-61/tr35.html</a>
20032003
</dl>
2004-
<h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
2005-
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>]
2004+
<h2 class="heading no-num no-ref settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
2005+
<pre class="def highlight idl">[<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#Exposed"><c- g>Exposed</c-></a>=<c- n>Window</c->, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SecureContext"><c- g>SecureContext</c-></a>]
20062006
<c- b>interface</c-> <a href="#translator"><code><c- g>Translator</c-></code></a> {
20072007
<c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="#translator"><c- n>Translator</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-translator-create"><c- g>create</c-></a>(<a data-link-type="idl-name" href="#dictdef-translatorcreateoptions"><c- n>TranslatorCreateOptions</c-></a> <a href="#dom-translator-create-options-options"><code><c- g>options</c-></code></a>);
20082008
<c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-promise"><c- b>Promise</c-></a>&lt;<a data-link-type="idl-name" href="https://webmachinelearning.github.io/writing-assistance-apis/#enumdef-availability"><c- n>Availability</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-translator-availability"><c- g>availability</c-></a>(<a data-link-type="idl-name" href="#dictdef-translatorcreatecoreoptions"><c- n>TranslatorCreateCoreOptions</c-></a> <a href="#dom-translator-availability-options-options"><code><c- g>options</c-></code></a>);

0 commit comments

Comments
 (0)