mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 08:59:37 -05:00
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:
parent
3e7913ee22
commit
5f3d5a7a2c
@ -194,15 +194,15 @@ LanguageSupport::translate(const QString &languageCode)
|
|||||||
QTranslator *systemQtTranslator = new QTranslator(rApp);
|
QTranslator *systemQtTranslator = new QTranslator(rApp);
|
||||||
Q_CHECK_PTR(systemQtTranslator);
|
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);
|
QApplication::installTranslator(systemQtTranslator);
|
||||||
} else {
|
} else {
|
||||||
/* Attempt to load the translations for Qt's internal widgets from the translations directory in the exe dir. */
|
/* 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);
|
QApplication::installTranslator(systemQtTranslator);
|
||||||
} else {
|
} else {
|
||||||
/* Attempt to load the translations for Qt's internal widgets from the translations directory in the data dir. */
|
/* 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);
|
QApplication::installTranslator(systemQtTranslator);
|
||||||
} else {
|
} else {
|
||||||
delete systemQtTranslator;
|
delete systemQtTranslator;
|
||||||
@ -216,7 +216,7 @@ LanguageSupport::translate(const QString &languageCode)
|
|||||||
|
|
||||||
bool result = true;
|
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);
|
QApplication::installTranslator(retroshareTranslator);
|
||||||
} else if (retroshareTranslator->load(":/lang/retroshare_" + languageCode + ".qm")) {
|
} else if (retroshareTranslator->load(":/lang/retroshare_" + languageCode + ".qm")) {
|
||||||
QApplication::installTranslator(retroshareTranslator);
|
QApplication::installTranslator(retroshareTranslator);
|
||||||
|
Loading…
Reference in New Issue
Block a user