--- a/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/TranslationEngine.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/TranslationEngine.py Wed Jul 13 14:55:47 2022 +0200 @@ -16,52 +16,53 @@ """ Class implementing the translation engine base class containing default methods. - + @signal availableTranslationsLoaded() emitted to indicate the availability of the list of supported translation languages """ + availableTranslationsLoaded = pyqtSignal() - + def __init__(self, plugin, parent=None): """ Constructor - + @param plugin reference to the plugin object @type TranslatorPlugin @param parent reference to the parent object @type QObject """ super().__init__(parent) - + self.plugin = plugin - + def engineName(self): """ Public method to get the name of the engine. - + @return engine name @rtype str """ return "" - + def supportedLanguages(self): """ Public method to get the supported languages. - + @return list of supported language codes @rtype list of str """ return [] - + def supportedTargetLanguages(self, original): """ Public method to get a list of supported target languages for an original language. - + Note: The default implementation return the list of supported languages (i.e. the same as those for the source) with the given original removed. - + @param original original language @type str @return list of supported target languages for the given original @@ -70,22 +71,22 @@ targetLanguages = self.supportedLanguages()[:] with contextlib.suppress(ValueError): targetLanguages.remove(original) - + return targetLanguages - + def hasTTS(self): """ Public method indicating the Text-to-Speech capability. - + @return flag indicating the Text-to-Speech capability @rtype bool """ return False - + def getTextToSpeechData(self, requestObject, text, language): """ Public method to pronounce the given text. - + @param requestObject reference to the request object @type TranslatorRequest @param text text to be pronounced @@ -96,12 +97,13 @@ @rtype tuple of (QByteArray or str, bool) """ return self.tr("No pronounce data available"), False - - def getTranslation(self, requestObject, text, originalLanguage, - translationLanguage): + + def getTranslation( + self, requestObject, text, originalLanguage, translationLanguage + ): """ Public method to translate the given text. - + @param requestObject reference to the request object @type TranslatorRequest @param text text to be translated