mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
System menu translation
This commit is contained in:
parent
ac9b327fe7
commit
4f650b3177
|
@ -59,6 +59,7 @@
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <qlibraryinfo.h>
|
||||||
#include <tox/tox.h>
|
#include <tox/tox.h>
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
|
@ -217,7 +218,20 @@ void Widget::setTranslation()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (translator->load(locale, ":translations/"))
|
if (translator->load(locale, ":translations/"))
|
||||||
|
{
|
||||||
qDebug() << "Loaded translation" << locale;
|
qDebug() << "Loaded translation" << locale;
|
||||||
|
|
||||||
|
// system menu translation
|
||||||
|
QTranslator *qtTranslator = new QTranslator();
|
||||||
|
QString s_locale = "qt_"+locale;
|
||||||
|
if ( qtTranslator->load(s_locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) )
|
||||||
|
{
|
||||||
|
QApplication::installTranslator(qtTranslator);
|
||||||
|
qDebug() << "System translation loaded" << locale;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
qDebug() << "System translation not loaded" << locale;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
qDebug() << "Error loading translation" << locale;
|
qDebug() << "Error loading translation" << locale;
|
||||||
QCoreApplication::installTranslator(translator);
|
QCoreApplication::installTranslator(translator);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user