{"id":21081794,"url":"https://github.com/openvoiceos/ovos-translate-plugin-deepl","last_synced_at":"2025-08-02T02:11:57.128Z","repository":{"id":156758261,"uuid":"633144416","full_name":"OpenVoiceOS/ovos-translate-plugin-deepl","owner":"OpenVoiceOS","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-08T21:14:41.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-03-14T04:41:25.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenVoiceOS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-26T21:59:16.000Z","updated_at":"2023-05-01T20:32:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca5855db-0a1e-41f6-a051-26f7ddd2024b","html_url":"https://github.com/OpenVoiceOS/ovos-translate-plugin-deepl","commit_stats":null,"previous_names":["emphasize/ovos-translate-plugin-deepl"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/OpenVoiceOS/ovos-translate-plugin-deepl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-translate-plugin-deepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-translate-plugin-deepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-translate-plugin-deepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-translate-plugin-deepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenVoiceOS","download_url":"https://codeload.github.com/OpenVoiceOS/ovos-translate-plugin-deepl/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVoiceOS%2Fovos-translate-plugin-deepl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268326739,"owners_count":24232496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T20:11:00.293Z","updated_at":"2025-08-02T02:11:57.062Z","avatar_url":"https://github.com/OpenVoiceOS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![codecov](https://codecov.io/github/OpenVoiceOS/ovos-translate-plugin-deepl/branch/dev/graph/badge.svg?token=TOViE9yLEg)](https://codecov.io/github/OpenVoiceOS/ovos-translate-plugin-deepl)\n\n# OVOS Translator Module (DeepL)\n\nLanguage Plugin for [DeepL](https://www.deepl.com/translator) language detection and translation\n\nIn order to work, you'll need an API-key, issued [here](https://www.deepl.com/pro-api?cta=header-pro-api)\n\n## Usage\n\n### OVOS\n\nThe plugin is used in a wider context to translate utterances/texts on demand (e.g. from a [UniversalSkill]())\n\n_Configuration_\n```python\n# add this to one of the configuration files (eg ~./config/mycroft/mycroft.conf)\n\n\"language\": {\n    \"detection_module\": \"deepl_detection_plug\",\n    \"translation_module\": \"deepl_translate_plug\",\n    \"internal\": \u003clang\u003e,                                # default target lang being used unless passed as arg\n    \"deepl_detection_plug\": {\n        \"api_key\": \"\u003cAPI_KEY\u003e\"\n    },\n    \"deepl_translate_plug\": {\n        \"api_key\": \"\u003cAPI_KEY\u003e\"\n    }\n}\n\n```\n\n### General\n\nUsing this module standalone, the API key has to be passed\n\n\n**Translation**\n```python\nfrom ovos_translate_plugin_deepl import DeepLTranslator\n\ntranslator = DeepLTranslator({\"api_key\": \u003cAPI_KEY\u003e})\ntranslator.translate(\"hallo zusammen\", \"en-us\")  # auto detect source lang\n# 'hello together'\ntranslator.translate(\"hallo zusammen\", \"en-us\", \"de\")  # define source lang; both languages can be passed ISO 639-1 (2-digit) /ISO 3166-1 (4-digit),\n                                                       # appropriate (available) will be chosen\n```\n_for batch translation just pass the list_\n```python\ntranslator.translate([\"hallo zusammen\", \"das ist ein test\"], \"en-us\")\n# ['hello together', 'this is a test'] \n```\n_to get the supported **target** language codes_\n```python\ntranslator.available_languages\n# {'CS', 'EL', 'DA', 'SL', 'UK', 'PT-PT', 'HU', 'ZH', 'KO', 'NB', 'SK', 'FR', 'LV', 'DE', 'ES', 'TR', 'NL', 'FI', 'IT', 'BG', 'PT-BR', 'ID', 'ET', 'RU', 'PL', 'SV', 'LT', 'EN-US', 'JA', 'RO', 'EN-GB'}\n```\n_to get the supported **source** language codes_\n```python\ntranslator.source_languages\n# {'BG', 'CS', 'DA', 'DE', 'EL', 'EN', 'ES', 'ET', 'FI', 'FR', 'HU', 'ID', 'IT', 'JA', 'KO', 'LT', 'LV', 'NB', 'NL', 'PL', 'PT', 'RO', 'RU', 'SK', 'SL', 'SV', 'TR', 'UK', 'ZH'}\n```\n_format a **target** langcode relative to the service capabilities_\n```python\ntranslator.get_langcode(\"se-fi\")  # Sami (Northern) (Finland)\n# 'FI'\n```\n_format a **source** langcode (as some of them are joined e.g PT-BR/PT-PT (target) -\u003e PT (source))_\n```python\ntranslator.get_langcode(\"pt-br\", source=True)  # Portuguese (Brasilian)\n# 'PT'\n```\n_this can also been used to check availability_\n```python\ntranslator.get_langcode(\"xx-xx\")\n# None\n```\n_NOTE: This is checked internally before every translation, so just an assurance up front_\n\n_to check in which languages a text can be translated to, you can also either_\n```python\n# if lang is known\ntranslator.supported_translations(\u003clangcode\u003e)\n# empty set if not translatedable, a lang code set otherwise\n\n# only the text is known\ntranslator.supported_translations(text=\u003ctext\u003e)\n```\n\n**Detection**\n```python\nfrom ovos_translate_plugin_deepl import DeepLDetector\n\ndetector = DeepLDetector({\"api_key\": \u003cAPI_KEY\u003e})\ndetector.detect(\"This is a test\")\n# en\n```\n_get detectable source languages_\n```python\ndetector.available_languages\n# {'BG', 'CS', 'DA', 'DE', 'EL', 'EN', 'ES', 'ET', 'FI', 'FR', 'HU', 'ID', 'IT', 'JA', 'KO', 'LT', 'LV', 'NB', 'NL', 'PL', 'PT', 'RO', 'RU', 'SK', 'SL', 'SV', 'TR', 'UK', 'ZH'}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvoiceos%2Fovos-translate-plugin-deepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvoiceos%2Fovos-translate-plugin-deepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvoiceos%2Fovos-translate-plugin-deepl/lists"}