Microsoft Translator: Does GetLanguagesForTranslation() translate language names into the browser language?

StackOverflow https://stackoverflow.com/questions/11729361

  •  23-06-2021
  •  | 
  •  

Question

This may be a stupid question, but I have no way of testing this with multiple languages.

I am wondering if the Microsoft Translator translates the list of supported languages into the language detected by the browser? I assume is does, but would appreciate validation.

TIA

Was it helpful?

Solution

GetLanguagesForTranslate() returns the set of supported languages IDs. GetLanguageNames() takes an array of languag IDs and returns the friendly name of the language in the language you specify in the "locale" parameter, where locale is the ISO639 language code.

You may listen to the browser's accept-language setting and pass the first element of it to the locale parameter. That's what the Bing Translator home page does (www.bing.com/translator)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top