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

Était-ce utile?

La 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)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top