Action function for the languages command.
(deepl_client: deepl.DeepLClient, glossary: bool)
| 30 | |
| 31 | |
| 32 | def action_languages(deepl_client: deepl.DeepLClient, glossary: bool): |
| 33 | """Action function for the languages command.""" |
| 34 | if glossary: |
| 35 | glossary_languages = deepl_client.get_glossary_languages() |
| 36 | print("Language pairs supported for glossaries: (source, target)") |
| 37 | for language_pair in glossary_languages: |
| 38 | print(f"{language_pair.source_lang}, {language_pair.target_lang}") |
| 39 | else: |
| 40 | source_languages = deepl_client.get_source_languages() |
| 41 | target_languages = deepl_client.get_target_languages() |
| 42 | |
| 43 | print("Source languages available:") |
| 44 | for language in source_languages: |
| 45 | print(f"{language.code}: {language.name}") |
| 46 | print("Target languages available:") |
| 47 | for language in target_languages: |
| 48 | if language.supports_formality: |
| 49 | print(f"{language.code}: {language.name} (supports formality)") |
| 50 | else: |
| 51 | print(f"{language.code}: {language.name}") |
| 52 | |
| 53 | |
| 54 | def action_document( |
nothing calls this directly
no test coverage detected