Request the list of available target languages. :param skip_cache: Deprecated, and now has no effect as the corresponding internal functionality has been removed. This parameter will be removed in a future version. :return: List of supported target languages.
(self, skip_cache: bool = False)
| 987 | ] |
| 988 | |
| 989 | def get_target_languages(self, skip_cache: bool = False) -> List[Language]: |
| 990 | """Request the list of available target languages. |
| 991 | |
| 992 | :param skip_cache: Deprecated, and now has no effect as the |
| 993 | corresponding internal functionality has been removed. This |
| 994 | parameter will be removed in a future version. |
| 995 | :return: List of supported target languages. |
| 996 | """ |
| 997 | data = {"type": "target"} |
| 998 | status, content, json = self._api_call( |
| 999 | "v2/languages", method="GET", data=data |
| 1000 | ) |
| 1001 | self._raise_for_status(status, content, json) |
| 1002 | languages = json if (json and isinstance(json, list)) else [] |
| 1003 | return [ |
| 1004 | Language( |
| 1005 | language["language"], |
| 1006 | language["name"], |
| 1007 | language.get("supports_formality", None), |
| 1008 | ) |
| 1009 | for language in languages |
| 1010 | ] |
| 1011 | |
| 1012 | def get_glossary_languages(self) -> List[GlossaryLanguagePair]: |
| 1013 | """Request the list of language pairs supported for glossaries.""" |