diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2015-04-22 17:00:09 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2015-04-23 07:58:07 +0000 |
commit | 611734729f590623455965017567ec7c9db4f9a4 (patch) | |
tree | ffc855ce13ab9ce10af4b16541582944fe0027e5 /src/core/web_engine_library_info.cpp | |
parent | d7ee26965f5fac77e8609c1d812198421023c11c (diff) |
Force to use English language for QML auto tests
Moreover, localization setting via QtWebEngine is fixed. System
localization setting can be overridden by --lang command line argument.
Task-number: QTBUG-45715
Change-Id: I39f3a891e55ee47a57afc394e849ea02b0c76ad5
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r-- | src/core/web_engine_library_info.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 17f6b2a05..e78ab09e7 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -38,9 +38,11 @@ #include "web_engine_library_info.h" #include "base/base_paths.h" +#include "base/command_line.h" #include "base/files/file_util.h" #include "content/public/common/content_paths.h" #include "ui/base/ui_base_paths.h" +#include "ui/base/ui_base_switches.h" #include "type_conversion.h" #include <QByteArray> @@ -289,3 +291,12 @@ base::string16 WebEngineLibraryInfo::getApplicationName() { return toString16(qApp->applicationName()); } + +std::string WebEngineLibraryInfo::getApplicationLocale() +{ + CommandLine *parsedCommandLine = CommandLine::ForCurrentProcess(); + if (!parsedCommandLine->HasSwitch(switches::kLang)) + return QLocale().bcp47Name().toStdString(); + + return parsedCommandLine->GetSwitchValueASCII(switches::kLang); +} |