diff -r 7fd9b7ecbcfe -r d71b094845e7 Plugins/UiExtensionPlugins/Translator/TranslatorEngines/TranslationEngine.py --- a/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/TranslationEngine.py Sat Jul 07 14:38:13 2018 +0200 +++ b/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/TranslationEngine.py Sun Jul 08 13:05:23 2018 +0200 @@ -9,14 +9,19 @@ from __future__ import unicode_literals -from PyQt5.QtCore import QObject +from PyQt5.QtCore import pyqtSignal, QObject class TranslationEngine(QObject): """ 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 @@ -49,12 +54,23 @@ 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 - @rtype None, if function is not supported; list of str otherwise + @rtype list of str """ - return None + targetLanguages = self.supportedLanguages()[:] + try: + targetLanguages.remove(original) + except ValueError: + # original is not in the list of target languages + pass + + return targetLanguages def hasTTS(self): """