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
*`languagePairAvailable(sourceLanguageTag, targetLanguageTag)`, for the `ai.translation.capabilities()` object
91
+
*`languageAvailable(languageTag)`, for the `ai.languageDetection.capabilities()` object
92
92
93
93
Both of these methods return `"no"`, `"after-download"`, or `"readily"`, which have the same meanings as above, except specialized to the specific arguments in question.
94
94
@@ -110,7 +110,7 @@ async function translateUnknownCustomerInput(textToTranslate, targetLanguage) {
110
110
}
111
111
112
112
// Special-case check for Japanese since for our site it's particularly important.
113
-
if (languageDetectorCapabilities.canDetect("ja") ==="no") {
113
+
if (languageDetectorCapabilities.languageAvailable("ja") ==="no") {
114
114
console.warn("Japanese Language detection is not available. Falling back to cloud API.");
@@ -339,7 +339,7 @@ Some sort of mitigation may be necessary here. We believe this is adjacent to ot
339
339
* Partitioning download status by top-level site, introducing a fake download (which takes time but does not actually download anything) for the second-onward site to download a language pack.
340
340
* Only exposing a fixed set of languages to this API, e.g. based on the user's locale or the document's main language.
341
341
342
-
As a first step, we require that detecting the availability of translation for a given language pair be done via individual calls to `canTranslate()` and `canDetect()`. This allows browsers to implement possible mitigation techniques, such as detecting excessive calls to these methods and starting to return `"no"`.
342
+
As a first step, we require that detecting the availability of translation/detection be done via individual calls to `translationCapabilities.languagePairAvailable()` and `detectionCapabilities.languageAvailable()`. This allows browsers to implement possible mitigation techniques, such as detecting excessive calls to these methods and starting to return `"no"`.
343
343
344
344
Another way in which this API might enhance the web's fingerprinting surface is if translation and language detection models are updated separately from browser versions. In that case, differing results from different versions of the model provide additional fingerprinting bits beyond those already provided by the browser's major version number. Mandating that older browser versions not receive updates or be able to download models from too far into the future might be a possible remediation for this.
0 commit comments