--- a/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorLanguagesDb.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorLanguagesDb.py Wed Jul 13 14:55:47 2022 +0200 @@ -18,15 +18,16 @@ """ Class implementing the translation languages database. """ + def __init__(self, parent=None): """ Constructor - + @param parent reference to the parent object @type QObject """ super().__init__(parent) - + self.__languages = { "af": self.tr("Afrikaans"), "ar": self.tr("Arabic"), @@ -80,7 +81,7 @@ "zh-CN": self.tr("Chinese (China)"), "zh-TW": self.tr("Chinese (Taiwan)"), } - + self.__toThreeCharacterCode = { "af": "afr", "ar": "ara", @@ -134,24 +135,26 @@ "zh-CN": "zho", "zh-TW": "zho", } - + def getLanguageIcon(self, code): """ Public method to get a language icon. - + @param code language code @type str @return language icon @rtype QIcon """ - return UI.PixmapCache.getIcon(os.path.join( - os.path.dirname(__file__), "icons", "flags", - "{0}".format(code))) - + return UI.PixmapCache.getIcon( + os.path.join( + os.path.dirname(__file__), "icons", "flags", "{0}".format(code) + ) + ) + def getLanguage(self, code): """ Public method to get a translated language. - + @param code language code @type str @return translated language @@ -161,21 +164,21 @@ return self.__languages[code] except KeyError: return "" - + def getAllLanguages(self): """ Public method to get a list of the supported language codes. - + @return list of supported language codes @rtype list of str """ return list(self.__languages.keys()) - + def convertTwoToThree(self, code): """ Public method to convert a two character language code to a thre character code. - + @param code two character language code @type str @return three character language code