Commit 659a6a5f authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app): display locale only if help or version is not displayed

parent 29b90408
...@@ -102,6 +102,8 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U ...@@ -102,6 +102,8 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
if (mParser->isSet("version")) if (mParser->isSet("version"))
mParser->showVersion(); mParser->showVersion();
qInfo() << QStringLiteral("Use locale: %1").arg(mLocale);
} }
App::~App () { App::~App () {
...@@ -462,7 +464,6 @@ void App::initLocale (const shared_ptr<linphone::Config> &config) { ...@@ -462,7 +464,6 @@ void App::initLocale (const shared_ptr<linphone::Config> &config) {
if (!locale.isEmpty() && ::installLocale(*this, *mTranslator, QLocale(locale))) { if (!locale.isEmpty() && ::installLocale(*this, *mTranslator, QLocale(locale))) {
mLocale = locale; mLocale = locale;
qInfo() << QStringLiteral("Use preferred locale: %1").arg(locale);
return; return;
} }
...@@ -470,7 +471,6 @@ void App::initLocale (const shared_ptr<linphone::Config> &config) { ...@@ -470,7 +471,6 @@ void App::initLocale (const shared_ptr<linphone::Config> &config) {
QLocale sysLocale = QLocale::system(); QLocale sysLocale = QLocale::system();
if (::installLocale(*this, *mTranslator, sysLocale)) { if (::installLocale(*this, *mTranslator, sysLocale)) {
mLocale = sysLocale.name(); mLocale = sysLocale.name();
qInfo() << QStringLiteral("Use system locale: %1").arg(mLocale);
return; return;
} }
...@@ -478,7 +478,6 @@ void App::initLocale (const shared_ptr<linphone::Config> &config) { ...@@ -478,7 +478,6 @@ void App::initLocale (const shared_ptr<linphone::Config> &config) {
mLocale = DEFAULT_LOCALE; mLocale = DEFAULT_LOCALE;
if (!::installLocale(*this, *mTranslator, QLocale(mLocale))) if (!::installLocale(*this, *mTranslator, QLocale(mLocale)))
qFatal("Unable to install default translator."); qFatal("Unable to install default translator.");
qInfo() << QStringLiteral("Use default locale: %1").arg(mLocale);
} }
QString App::getConfigLocale () const { QString App::getConfigLocale () const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment