diff -r 0a24808561e0 -r 0de153b92d53 Plugins/UiExtensionPlugins/Translator/TranslatorEngines/__init__.py --- a/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/__init__.py Fri Oct 05 19:02:37 2018 +0200 +++ b/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/__init__.py Sat Oct 06 14:47:40 2018 +0200 @@ -23,11 +23,8 @@ @return names of supported engines (list of string) """ - # TODO: port deepl to use the commercial API -## return ["googlev1", "mymemory", "glosbe", "promt", "yandex", "googlev2", -## "microsoft", "deepl", "ibm_watson"] return ["googlev1", "mymemory", "glosbe", "promt", "yandex", "googlev2", - "microsoft", "ibm_watson"] + "microsoft", "deepl", "ibm_watson"] def engineDisplayName(name): @@ -51,8 +48,8 @@ return QCoreApplication.translate("TranslatorEngines", "Google V.2") elif name == "microsoft": return QCoreApplication.translate("TranslatorEngines", "Microsoft") -## elif name == "deepl": -## return QCoreApplication.translate("TranslatorEngines", "DeepL") + elif name == "deepl": + return QCoreApplication.translate("TranslatorEngines", "DeepL Pro") elif name == "ibm_watson": return QCoreApplication.translate("TranslatorEngines", "IBM Watson") else: @@ -91,9 +88,9 @@ elif name == "microsoft": from .MicrosoftEngine import MicrosoftEngine engine = MicrosoftEngine(plugin, parent) -## elif name == "deepl": -## from .DeepLEngine import DeepLEngine -## engine = DeepLEngine(plugin, parent) + elif name == "deepl": + from .DeepLEngine import DeepLEngine + engine = DeepLEngine(plugin, parent) elif name == "ibm_watson": from .IbmWatsonEngine import IbmWatsonEngine engine = IbmWatsonEngine(plugin, parent) @@ -126,7 +123,6 @@ @param name name of the online translation service (string) @return key request URL (string) """ - # TODO: get URL for deepl if name == "mymemory": return "http://mymemory.translated.net/doc/keygen.php" elif name == "yandex": @@ -137,5 +133,7 @@ return "https://portal.azure.com" elif name == "ibm_watson": return "https://www.ibm.com/watson/services/language-translator/" + elif name == "deepl": + return "https://www.deepl.com/pro-registration.html" else: return ""