web api instance property
Translator: sourceLanguage property
Limited availabilitySecure context
The sourceLanguage read-only property of the Translator interface returns the expected language of the input text to be translated.
A Translator instance’s sourceLanguage is set when creating it via a create() call.
Value
A string specifying the source language. This will be a valid BCP 47 language tag.
Examples
const translator = await Translator.create({
sourceLanguage: "en",
targetLanguage: "ja",
});
// Logs "en"
console.log(translator.sourceLanguage);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.