Browse Source

Use configured locale only for translating

Don't use other aspects of it eg for date formatting. We should depend
on the system locale for all these. The user probably likes it that way,
otherwise he would have changed it.
adaptive-webui-19844
sledgehammer999 6 years ago
parent
commit
63cf216550
No known key found for this signature in database
GPG Key ID: 6E4A2D025B7CC9A2
  1. 13
      src/base/net/geoipmanager.cpp

13
src/base/net/geoipmanager.cpp

@ -34,7 +34,6 @@
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QHostAddress> #include <QHostAddress>
#include <QLocale>
#include "base/logger.h" #include "base/logger.h"
#include "base/preferences.h" #include "base/preferences.h"
@ -101,15 +100,12 @@ void GeoIPManager::loadDatabase()
QString error; QString error;
m_geoIPDatabase = GeoIPDatabase::load(filepath, error); m_geoIPDatabase = GeoIPDatabase::load(filepath, error);
if (m_geoIPDatabase) { if (m_geoIPDatabase)
const QLocale locale {Preferences::instance()->getLocale()};
Logger::instance()->addMessage(tr("GeoIP database loaded. Type: %1. Build time: %2.") 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); Log::INFO);
} else
else {
Logger::instance()->addMessage(tr("Couldn't load GeoIP database. Reason: %1").arg(error), Log::WARNING); Logger::instance()->addMessage(tr("Couldn't load GeoIP database. Reason: %1").arg(error), Log::WARNING);
}
manageDatabaseUpdate(); manageDatabaseUpdate();
} }
@ -435,9 +431,8 @@ void GeoIPManager::downloadFinished(const QString &url, QByteArray data)
if (m_geoIPDatabase) if (m_geoIPDatabase)
delete m_geoIPDatabase; delete m_geoIPDatabase;
m_geoIPDatabase = geoIPDatabase; m_geoIPDatabase = geoIPDatabase;
const QLocale locale {Preferences::instance()->getLocale()};
Logger::instance()->addMessage(tr("GeoIP database loaded. Type: %1. Build time: %2.") 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); Log::INFO);
QString targetPath = Utils::Fs::expandPathAbs( QString targetPath = Utils::Fs::expandPathAbs(
specialFolderLocation(SpecialFolder::Data) + GEOIP_FOLDER); specialFolderLocation(SpecialFolder::Data) + GEOIP_FOLDER);

Loading…
Cancel
Save