Translations: Add debug logging
This commit is contained in:
parent
39fd89cb90
commit
e12f27a945
@ -26,9 +26,13 @@
|
||||
#include <QString>
|
||||
|
||||
#include "translations.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/potranslator.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
Translations::Translations(QObject *parent) : QObject(parent) {}
|
||||
|
||||
Translations::~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) {
|
||||
|
||||
const QString basefilename = prefix + u'_' + language;
|
||||
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);
|
||||
translations_ << t;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user