Changeset b26801b000 in tspsg


Ignore:
Timestamp:
Jul 10, 2012, 5:44:43 PM (12 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
0af510a462
Parents:
1299ea5b49
git-author:
Oleksii Serdiuk <contacts@…> (07/10/12 17:44:43)
git-committer:
Oleksii Serdiuk <contacts@…> (07/10/12 17:51:53)
Message:

Added a rule to run lrelease before running build.

qt_*.qm translations are no longer included into the resources.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • l10n/l10n.qrc

    r1299ea5b49 rb26801b000  
    11<RCC>
    22    <qresource prefix="/l10n">
    3         <file>qt_ru.qm</file>
    4         <file>qt_uk.qm</file>
    53        <file>tspsg_en.qm</file>
    64        <file>tspsg_ru.qm</file>
  • src/mainwindow.cpp

    r1299ea5b49 rb26801b000  
    14021402    // Trying to load system Qt library translation...
    14031403    qtTranslator = new QTranslator(this);
    1404     if (qtTranslator->load("qt_" + lng, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
     1404    if (qtTranslator->load("qt_" + lng, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
    14051405        qApp->installTranslator(qtTranslator);
    1406     else {
    1407         // No luck. Let's try to load a bundled one.
    1408         if (qtTranslator->load("qt_" + lng, PATH_L10N)) {
    1409             // We have a translation in the localization direcotry.
    1410             qApp->installTranslator(qtTranslator);
    1411         } else if (qtTranslator->load("qt_" + lng, ":/l10n")) {
    1412             // We have a translation "built-in" into application resources.
    1413             qApp->installTranslator(qtTranslator);
    1414         } else {
    1415             // Qt library translation unavailable for this language.
    1416             delete qtTranslator;
    1417             qtTranslator = NULL;
    1418         }
     1406    } else {
     1407        // Qt library translation unavailable for this language.
     1408        delete qtTranslator;
     1409        qtTranslator = NULL;
    14191410    }
    14201411
  • tspsg.pro

    r1299ea5b49 rb26801b000  
    5656UI_DIR = tmp
    5757
     58# We need to generate translations before building.
     59# Either way, resource files won't compile.
     60translations.name = Translations
     61translations.input = TRANSLATIONS
     62translations.output = $$_PRO_FILE_PWD_/l10n/${QMAKE_FILE_BASE}.qm
     63translations.commands = $$[QT_INSTALL_BINS]/lrelease ${QMAKE_FILE_IN}
     64translations.CONFIG = no_link
     65QMAKE_EXTRA_COMPILERS += translations
     66PRE_TARGETDEPS += compiler_translations_make_all
     67
    5868# Include 3rd party libraries
    5969!handheld {
Note: See TracChangeset for help on using the changeset viewer.