mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-24 07:08:07 +00:00
fix(app): property set locale
This commit is contained in:
parent
37c15e9f8b
commit
71c44d41ed
2 changed files with 8 additions and 4 deletions
|
|
@ -23,12 +23,16 @@
|
|||
App *App::m_instance = nullptr;
|
||||
|
||||
App::App (int &argc, char **argv) : QApplication(argc, argv) {
|
||||
QString current_locale = QLocale::system().name();
|
||||
|
||||
// Try to use default locale. Otherwise use english.
|
||||
if (m_translator.load(QString(LANGUAGES_PATH) + QLocale::system().name()) ||
|
||||
m_translator.load(LANGUAGES_PATH "en")) {
|
||||
if (m_translator.load(QString(LANGUAGES_PATH) + current_locale)) {
|
||||
installTranslator(&m_translator);
|
||||
m_locale = current_locale;
|
||||
} else if (m_translator.load(LANGUAGES_PATH "en")) {
|
||||
installTranslator(&m_translator);
|
||||
} else {
|
||||
qWarning("No translation found.");
|
||||
qFatal("No translation found.");
|
||||
}
|
||||
|
||||
setWindowIcon(QIcon(WINDOW_ICON_PATH));
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ private:
|
|||
QTranslator m_translator;
|
||||
|
||||
Notifier *m_notifier = nullptr;
|
||||
QString m_locale;
|
||||
QString m_locale = "en";
|
||||
|
||||
static App *m_instance;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue