mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 21:35:47 +03:00
Load Qt translations from app dir/bundle, too
This commit is contained in:
parent
bfee6402a6
commit
c0f2f5bcaa
1 changed files with 10 additions and 2 deletions
|
@ -88,8 +88,16 @@ Application::Application(int &argc, char **argv) :
|
|||
if ( _helpOnly ) return;
|
||||
|
||||
QTranslator *qtTranslator = new QTranslator(this);
|
||||
qtTranslator->load(QLatin1String("qt_") + QLocale::system().name(),
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
#if defined(Q_OS_MAC)
|
||||
qtTranslator->load(QLatin1String("qt_") + locale, applicationDirPath()+QLatin1String("/../translations") ); // path defaults to app dir.
|
||||
#endif
|
||||
#elif defined(Q_OS_WIN32)
|
||||
qtTranslator->load(QLatin1String("qt_") + locale, applicationDirPath());
|
||||
#endif
|
||||
if (qtTranslator->isEmpty()) {
|
||||
qtTranslator->load(QLatin1String("qt_") + QLocale::system().name(),
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
}
|
||||
installTranslator(qtTranslator);
|
||||
|
||||
QTranslator *mirallTranslator = new QTranslator(this);
|
||||
|
|
Loading…
Reference in a new issue