The Google Translate API supports a number of languages. In this recipe, we will illustrate how we can programmatically determine which languages are supported. This is useful when we need to determine the two-letter code for a language, which is needed for some translation tasks. These two-letter codes generally conform to the ISO-639-1 identifiers, as documented at https://en.wikipedia.org/wiki/ISO_639-1.
In addition, we may need to be aware of any new languages that are supported. A list of currently-supported languages can be found at https://cloud.google.com/translate/docs/languages.
The Google Cloud Platform (GCP) Translate API supports phrase-based machine translation (PBMT) and neural machine translation (NMT) models. PBMT is a statistical approach that requires bilingual text and tries to predict how words should be...