diff options
-rw-r--r-- | qml/mageiawelcome.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py index 48e8eb4..9ace3ec 100644 --- a/qml/mageiawelcome.py +++ b/qml/mageiawelcome.py @@ -3,7 +3,7 @@ from PyQt5.QtGui import QGuiApplication, QIcon from PyQt5.QtQuick import QQuickView from PyQt5.QtCore import QUrl, QLocale, QTranslator, QLibraryInfo, QVariant, QAbstractListModel, \ - QModelIndex, Qt, QObject, pyqtSlot + QModelIndex, Qt, QObject, pyqtSlot, QCoreApplication from PyQt5.QtNetwork import QNetworkConfigurationManager, QNetworkConfiguration import sys import os @@ -13,6 +13,8 @@ import pwd # Workaround for opengl lib selection from OpenGL import GL +translate = QCoreApplication.translate + class ConfList(QAbstractListModel): NameRole = Qt.UserRole + 1 def __init__(self, parent=None): @@ -55,16 +57,16 @@ class ConfList(QAbstractListModel): netconfs += ", " + conf.name() self.configuration = [ - {'name': self.tr("<b>Congratulations!</b><BR />You have completed the installation of {}").format(release)}, - {'name': self.tr("You are using linux kernel: {}").format(kernel)}, - {'name': self.tr("Your system architecture is: {}").format(arch)}, - {'name': self.tr("You are now using the Desktop: {}").format(desktop)}, - {'name': self.tr("Your user id is: {}").format(os.getuid())}, + {'name': translate('ConfList',"<b>Congratulations!</b><BR />You have completed the installation of {}").format(release)}, + {'name': translate('ConfList',"You are using linux kernel: {}").format(kernel)}, + {'name': translate('ConfList',"Your system architecture is: {}").format(arch)}, + {'name': translate('ConfList',"You are now using the Desktop: {}").format(desktop)}, + {'name': translate('ConfList',"Your user id is: {}").format(os.getuid())}, ] if net.isOnline(): - self.configuration.append({'name': self.tr("You are connected to a network through {}").format(netconfs)}) + self.configuration.append({'name': translate('ConfList',"You are connected to a network through {}").format(netconfs)}) else: - self.configuration.append({'name': self.tr("You have no network connection")}) + self.configuration.append({'name': translate('ConfList',"You have no network connection")}) def data(self, index, role=Qt.DisplayRole): @@ -147,7 +149,7 @@ if __name__ == '__main__': app.installTranslator(appTranslator) view = QQuickView() view.setResizeMode(QQuickView.SizeRootObjectToView) - view.setTitle(app.tr("Welcome to Mageia")) + view.setTitle(app.translate('app',"Welcome to Mageia")) app.setWindowIcon(QIcon("icons/32x32/apps/mageiawelcome.png")) cb = Callbrowser() la = Launcher() |