Пример #1
0
    class __Translator:
        def __init__(self):
            self.dff = QTranslator()

            self.generic = QTranslator()
            self.Conf = Conf()
            self.loadLanguage()

        def loadLanguage(self):
            """ Load DFF translation + a Qt translation file

            FIXME need to check if qt4 directory exists in /usr/share or /usr/local/share
            """

            l1 = self.generic.load("/usr/share/qt4/translations/qt_" + str(self.Conf.getLanguage()).lower()[:2])
            l2 = self.dff.load(
                sys.modules["ui.gui"].__path__[0] + "/i18n/Dff_" + str(self.Conf.getLanguage()).lower()[:2]
            )

            return l1 and l2

        def getDFF(self):
            return self.dff

        def getGeneric(self):
            return self.generic
Пример #2
0
        def __init__(self):
            self.dff = QTranslator()

            self.generic = QTranslator()
            self.Conf = Conf()
            self.loadLanguage()