From 7db1dad8a5ffc9db53fb5daa363905600ded1a54 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sat, 22 Sep 2018 10:30:06 +0200 Subject: [PATCH] Add debug info References #248 --- projectgenerator/qgs_project_generator.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projectgenerator/qgs_project_generator.py b/projectgenerator/qgs_project_generator.py index 22edc4a79..825045c32 100644 --- a/projectgenerator/qgs_project_generator.py +++ b/projectgenerator/qgs_project_generator.py @@ -27,7 +27,10 @@ from projectgenerator.libqgsprojectgen.dataobjects.project import Project from projectgenerator.libqgsprojectgen.generator.generator import Generator -from qgis.core import QgsProject +from qgis.core import ( + QgsProject, + QgsMessageLog +) from qgis.PyQt.QtWidgets import QAction, QMenu, QMessageBox from qgis.PyQt.QtCore import QObject, QTranslator, QSettings, QLocale, QCoreApplication, Qt from qgis.PyQt.QtGui import QIcon @@ -52,7 +55,9 @@ def __init__(self, iface): locale.setlocale(locale.LC_ALL, '') # initialize translation - qgis_locale = QLocale(QSettings().value('locale/userLocale')) + qgis_locale_id = str(QSettings().value('locale/userLocale')) + QgsMessageLog.logMessage('Running with locale {}'.format(qgis_locale_id), self.tr('Projectgenerator')) + qgis_locale = QLocale(qgis_locale_id) locale_path = os.path.join(self.plugin_dir, 'i18n') self.translator = QTranslator() self.translator.load(qgis_locale, 'projectgenerator', '_', locale_path)