
Explanation:

To validate that an input language is supported for translation, call the Translator SDK's GetLanguagesAsync with scope: " translation " to retrieve the supported languages. The call returns a GetLanguagesResult, whose Translation property is a dictionary keyed by language codes (e.g., " en " , " it " ). You can then check membership with ContainsKey(language) . If the key exists, the language is supported; otherwise, it isn't.
This matches the .NET Translator client design:
TextTranslationClient.GetLanguagesAsync(...) fetches supported languages.
GetLanguagesResult.Translation is a dictionary of translation-capable languages, so ContainsKey is the correct check.
Microsoft References
TextTranslationClient.GetLanguagesAsync (overview and signature).
Languages REST reference - use scope=translation to get languages supported for translation. Microsoft Learn GetLanguagesResult class - Translation dictionary property.