Plugins/UiExtensionPlugins/Translator/ConfigurationPage/TranslatorPage.py

changeset 6539
0de153b92d53
parent 6411
7fd9b7ecbcfe
child 6645
ad476851d7e0
diff -r 0a24808561e0 -r 0de153b92d53 Plugins/UiExtensionPlugins/Translator/ConfigurationPage/TranslatorPage.py
--- a/Plugins/UiExtensionPlugins/Translator/ConfigurationPage/TranslatorPage.py	Fri Oct 05 19:02:37 2018 +0200
+++ b/Plugins/UiExtensionPlugins/Translator/ConfigurationPage/TranslatorPage.py	Sat Oct 06 14:47:40 2018 +0200
@@ -39,6 +39,10 @@
         self.__plugin = plugin
         self.__enableLanguageWarning = True
         
+        self.deeplLabel.setText(self.tr(
+            """<p>A key is <b>required</b> to use this service."""
+            """ <a href="{0}">Get a commercial API key.</a></p>""").format(
+                TranslatorEngines.getKeyUrl("deepl")))
         self.googlev2Label.setText(self.tr(
             """<p>A key is <b>required</b> to use this service."""
             """ <a href="{0}">Get a commercial API key.</a></p>""").format(
@@ -76,6 +80,9 @@
             self.languagesList.addItem(itm)
         self.languagesList.sortItems()
         
+        # DeepL settings
+        self.deeplKeyEdit.setText(
+            self.__plugin.getPreferences("DeeplKey"))
         # Google settings
         self.dictionaryCheckBox.setChecked(
             self.__plugin.getPreferences("GoogleEnableDictionary"))
@@ -109,6 +116,9 @@
         self.__plugin.setPreferences(
             "EnabledLanguages", enabledLanguages)
         
+        # DeepL settings
+        self.__plugin.setPreferences(
+            "DeeplKey", self.deeplKeyEdit.text())
         # Google settings
         self.__plugin.setPreferences(
             "GoogleEnableDictionary", self.dictionaryCheckBox.isChecked())

eric ide

mercurial