Fixed loading of translations with dependencies (Qt 5)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6868 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-10-21 22:46:59 +00:00
parent 3e7913ee22
commit 5f3d5a7a2c

View File

@ -194,15 +194,15 @@ LanguageSupport::translate(const QString &languageCode)
QTranslator *systemQtTranslator = new QTranslator(rApp);
Q_CHECK_PTR(systemQtTranslator);
if (systemQtTranslator->load(QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/qt_" + languageCode + ".qm")) {
if (systemQtTranslator->load("qt_" + languageCode + ".qm", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
QApplication::installTranslator(systemQtTranslator);
} else {
/* Attempt to load the translations for Qt's internal widgets from the translations directory in the exe dir. */
if (systemQtTranslator->load(QCoreApplication::applicationDirPath() + "/translations/qt_" + languageCode + ".qm")) {
if (systemQtTranslator->load("qt_" + languageCode + ".qm", QCoreApplication::applicationDirPath() + "/translations")) {
QApplication::installTranslator(systemQtTranslator);
} else {
/* Attempt to load the translations for Qt's internal widgets from the translations directory in the data dir. */
if (systemQtTranslator->load(EXTERNAL_TRANSLATION_DIR + "/translations/qt_" + languageCode + ".qm")) {
if (systemQtTranslator->load("qt_" + languageCode + ".qm", EXTERNAL_TRANSLATION_DIR + "/translations")) {
QApplication::installTranslator(systemQtTranslator);
} else {
delete systemQtTranslator;
@ -216,7 +216,7 @@ LanguageSupport::translate(const QString &languageCode)
bool result = true;
if (retroshareTranslator->load(EXTERNAL_TRANSLATION_DIR + "/translations/retroshare_" + languageCode + ".qm")) {
if (retroshareTranslator->load("retroshare_" + languageCode + ".qm", EXTERNAL_TRANSLATION_DIR + "/translations")) {
QApplication::installTranslator(retroshareTranslator);
} else if (retroshareTranslator->load(":/lang/retroshare_" + languageCode + ".qm")) {
QApplication::installTranslator(retroshareTranslator);