Translations: Add debug logging
This commit is contained in:
@@ -26,9 +26,13 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include "translations.h"
|
#include "translations.h"
|
||||||
|
#include "core/logging.h"
|
||||||
#include "core/potranslator.h"
|
#include "core/potranslator.h"
|
||||||
|
|
||||||
|
using namespace Qt::Literals::StringLiterals;
|
||||||
|
|
||||||
Translations::Translations(QObject *parent) : QObject(parent) {}
|
Translations::Translations(QObject *parent) : QObject(parent) {}
|
||||||
|
|
||||||
Translations::~Translations() {
|
Translations::~Translations() {
|
||||||
|
|
||||||
for (QTranslator *t : std::as_const(translations_)) {
|
for (QTranslator *t : std::as_const(translations_)) {
|
||||||
@@ -40,8 +44,10 @@ Translations::~Translations() {
|
|||||||
|
|
||||||
void Translations::LoadTranslation(const QString &prefix, const QString &path, const QString &language) {
|
void Translations::LoadTranslation(const QString &prefix, const QString &path, const QString &language) {
|
||||||
|
|
||||||
|
const QString basefilename = prefix + u'_' + language;
|
||||||
QTranslator *t = new PoTranslator;
|
QTranslator *t = new PoTranslator;
|
||||||
if (t->load(prefix + QLatin1Char('_') + language, path)) {
|
if (t->load(basefilename, path)) {
|
||||||
|
qLog(Debug) << "Tranlations loaded from" << basefilename;
|
||||||
QCoreApplication::installTranslator(t);
|
QCoreApplication::installTranslator(t);
|
||||||
translations_ << t;
|
translations_ << t;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user