mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Set test locale to C
This commit is contained in:
committed by
Jonathan White
parent
aace1dc913
commit
0acb15de0f
@@ -63,7 +63,7 @@ namespace Bootstrap
|
||||
* Perform early application bootstrapping that does not rely on a QApplication
|
||||
* being present.
|
||||
*/
|
||||
void bootstrap()
|
||||
void bootstrap(const QString& uiLanguage)
|
||||
{
|
||||
#ifdef QT_NO_DEBUG
|
||||
disableCoreDumps();
|
||||
@@ -72,7 +72,7 @@ namespace Bootstrap
|
||||
setupSearchPaths();
|
||||
applyEarlyQNetworkAccessManagerWorkaround();
|
||||
|
||||
Translator::installTranslators();
|
||||
Translator::installTranslators(uiLanguage);
|
||||
}
|
||||
|
||||
// LCOV_EXCL_START
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace Bootstrap
|
||||
{
|
||||
void bootstrap();
|
||||
void bootstrap(const QString& uiLanguage = "system");
|
||||
void disableCoreDumps();
|
||||
bool createWindowsDACL();
|
||||
void setupSearchPaths();
|
||||
|
||||
@@ -25,24 +25,22 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "core/Config.h"
|
||||
#include "core/Resources.h"
|
||||
|
||||
/**
|
||||
* Install all KeePassXC and Qt translators.
|
||||
*/
|
||||
void Translator::installTranslators()
|
||||
void Translator::installTranslators(const QString& uiLanguage)
|
||||
{
|
||||
QStringList languages;
|
||||
QString languageSetting = config()->get(Config::GUI_Language).toString();
|
||||
if (languageSetting.isEmpty() || languageSetting == "system") {
|
||||
if (uiLanguage.isEmpty() || uiLanguage == "system") {
|
||||
// NOTE: this is a workaround for the terrible way Qt loads languages
|
||||
// using the QLocale::uiLanguages() approach. Instead, we search each
|
||||
// language and all country variants in order before moving to the next.
|
||||
QLocale locale;
|
||||
languages = locale.uiLanguages();
|
||||
} else {
|
||||
languages << languageSetting;
|
||||
languages << uiLanguage;
|
||||
}
|
||||
|
||||
// Always try to load english last
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
class Translator
|
||||
{
|
||||
public:
|
||||
static void installTranslators();
|
||||
static void installTranslators(const QString& uiLanguage = "system");
|
||||
static QList<QPair<QString, QString>> availableLanguages();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user