From b47aca5fd1782cea68b2cba54263a75b5a3007e8 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 24 Jun 2016 16:01:51 -0700 Subject: Minor UI locale updates. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Qt: Call setlocale before commandline_early_options so that we get proper "-v" output, similar to the GTK+ UI. GTK+: Call setlocale once at startup. Bug: 11960 Change-Id: I3c3a196b9d94fc768e1085200891bc8d67e21a08 Reviewed-on: https://code.wireshark.org/review/16132 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- wireshark-qt.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'wireshark-qt.cpp') diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index cf73e5deb9..4268257a31 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -27,6 +27,8 @@ #include #endif +#include + #ifdef HAVE_GETOPT_H #include #endif @@ -355,8 +357,8 @@ int main(int argc, char *argv[]) #endif /* Set the C-language locale to the native environment. */ - // The GTK+ UI calls this. Should we as well? - //setlocale(LC_ALL, ""); + setlocale(LC_ALL, ""); + #ifdef _WIN32 // QCoreApplication clobbers argv. Let's have a local copy. ws_argv = (char **) g_malloc(sizeof(char *) * argc); @@ -467,7 +469,6 @@ int main(int argc, char *argv[]) AirPDcapInitContext(&airpdcap_ctx); - QString locale; QString cf_name; unsigned int in_file_type = WTAP_TYPE_AUTO; @@ -498,10 +499,9 @@ int main(int argc, char *argv[]) // Initialize our language read_language_prefs(); - locale = QString(language); - wsApp->loadLanguage(locale); + wsApp->loadLanguage(language); - g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Translator %s", locale.toStdString().c_str()); + g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_DEBUG, "Translator %s", language); // Init the main window (and splash) main_w = new(MainWindow); -- cgit v1.2.1