-
Notifications
You must be signed in to change notification settings - Fork 12
Description
This is an open question discussed in this part of the explainer. The current proposal includes the ability to translate without specifying a source language, in which case the return type of translate()
and translateStreaming()
will change to include the detected language.
The alternative API is to require the web developer to specify the source language. If they don't know it, they can use the language detection part of the API first, and then separately use the translation API.
Both approaches have some precedents:
- Google Cloud Translation API, DeepL Translate API, and Azure Translator API allow unknown source languages
- Google ML Kit requires separate detect-then-translate steps
One factor to note is that bundling together language detection with translation requires the implementation to make a single best-guess at the source language. Whereas, separating the steps allows the detection step to return multiple possibilities, and then the developer can choose what to do with that information.