Skip to content

Commit

Permalink
Merge pull request #10013 from sledgehammer999/revert_locale
Browse files Browse the repository at this point in the history
Use configured locale only for translating
  • Loading branch information
sledgehammer999 committed Dec 18, 2018
2 parents 38f4bea + 63cf216 commit 6f63805
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/base/net/geoipmanager.cpp
Expand Up @@ -34,7 +34,6 @@
#include <QDir>
#include <QFile>
#include <QHostAddress>
#include <QLocale>

#include "base/logger.h"
#include "base/preferences.h"
Expand Down Expand Up @@ -101,15 +100,12 @@ void GeoIPManager::loadDatabase()

QString error;
m_geoIPDatabase = GeoIPDatabase::load(filepath, error);
if (m_geoIPDatabase) {
const QLocale locale {Preferences::instance()->getLocale()};
if (m_geoIPDatabase)
Logger::instance()->addMessage(tr("GeoIP database loaded. Type: %1. Build time: %2.")
.arg(m_geoIPDatabase->type(), locale.toString(m_geoIPDatabase->buildEpoch())),
.arg(m_geoIPDatabase->type(), m_geoIPDatabase->buildEpoch().toString()),
Log::INFO);
}
else {
else
Logger::instance()->addMessage(tr("Couldn't load GeoIP database. Reason: %1").arg(error), Log::WARNING);
}

manageDatabaseUpdate();
}
Expand Down Expand Up @@ -435,9 +431,8 @@ void GeoIPManager::downloadFinished(const QString &url, QByteArray data)
if (m_geoIPDatabase)
delete m_geoIPDatabase;
m_geoIPDatabase = geoIPDatabase;
const QLocale locale {Preferences::instance()->getLocale()};
Logger::instance()->addMessage(tr("GeoIP database loaded. Type: %1. Build time: %2.")
.arg(m_geoIPDatabase->type(), locale.toString(m_geoIPDatabase->buildEpoch())),
.arg(m_geoIPDatabase->type(), m_geoIPDatabase->buildEpoch().toString()),
Log::INFO);
QString targetPath = Utils::Fs::expandPathAbs(
specialFolderLocation(SpecialFolder::Data) + GEOIP_FOLDER);
Expand Down

0 comments on commit 6f63805

Please sign in to comment.