Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. LanguageDetector
  4. expectedInputLanguages

LanguageDetector: expectedInputLanguages property

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheexpectedInputLanguages read-only property of theLanguageDetector interface returns the expected languages to be detected in the input text. Specifying expected input languages helps improve the accuracy of the language detection.

ALanguageDetector instance'sexpectedInputLanguages are set when creating it via acreate() call.

Value

An array of strings specifying the expected input languages. These will be validBCP 47 language tags.

Examples

js
const detector = await LanguageDetector.create({  expectedInputLanguages: ["en-US", "zh"],});// Logs ["en-US", "zh"]console.log(detector.expectedInputLanguages);

Specifications

Specification
Translator and Language Detector APIs
# dom-languagedetector-expectedinputlanguages

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp