Ticket #3766: Translations-diff-r11433.diff

File Translations-diff-r11433.diff, 2.9 KB (added by rb07, 11 years ago)

Fix for use of translations (against rev.11433)

  • qt/qtr.pro

    $ svn diff qt
     
    2626win32:LIBS += -levent -lws2_32 -lintl
    2727win32:LIBS += -lidn -liconv -lwldap32 -liphlpapi
    2828
    29 TRANSLATIONS += transmission_en.ts transmission_ru.ts
     29TRANSLATIONS += translations/transmission_en.ts \
     30       translations/transmission_ru.ts \
     31       translations/transmission_pt_BR.ts \
     32       translations/transmission_es.ts
    3033
    3134FORMS += mainwin.ui
    3235RESOURCES += application.qrc
  • qt/app.h

     
    1616#include <QApplication>
    1717#include <QSet>
    1818#include <QTimer>
     19#include <QTranslator>
    1920
    2021#include "favicon.h"
    2122
     
    5152        QTimer myStatsTimer;
    5253        QTimer mySessionTimer;
    5354        time_t myLastFullUpdateTime;
     55        QTranslator qtTranslator;
     56        QTranslator appTranslator;
    5457
    5558    private slots:
    5659        void consentGiven( );
  • qt/prefs-dialog.cc

     
    280280        QWidget * w = timeEditNew( Prefs :: ALT_SPEED_LIMIT_TIME_BEGIN );
    281281        h->addWidget( w, 1 );
    282282        mySchedWidgets << w;
    283         QLabel * nd = new QLabel( "&to" );
     283        QLabel * nd = new QLabel( tr("&to") );
    284284        h->addWidget( nd );
    285285        mySchedWidgets << nd;
    286286        w = timeEditNew( Prefs :: ALT_SPEED_LIMIT_TIME_END );
     
    436436
    437437    hig->addSectionTitle( tr( "Blocklist" ) );
    438438
    439     QWidget * l = checkBoxNew( "Enable &blocklist:", Prefs::BLOCKLIST_ENABLED );
     439    QWidget * l = checkBoxNew( tr("Enable &blocklist:"), Prefs::BLOCKLIST_ENABLED );
    440440    QWidget * e = lineEditNew( Prefs::BLOCKLIST_URL );
    441441    myBlockWidgets << e;
    442442    hig->addRow( l, e );
  • qt/app.cc

     
    2323#include <QLabel>
    2424#include <QLibraryInfo>
    2525#include <QRect>
    26 #include <QTranslator>
    2726
    2827#include <libtransmission/transmission.h>
    2928#include <libtransmission/tr-getopt.h>
     
    9493    setApplicationName( MY_CONFIG_NAME );
    9594
    9695    // install the qt translator
    97     QTranslator qtTranslator;
    9896    qtTranslator.load( "qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
    9997    installTranslator( &qtTranslator );
    10098
    10199    // install the transmission translator
    102     QTranslator appTranslator;
    103     appTranslator.load( QString(MY_READABLE_NAME) + "_" + QLocale::system().name() );
     100    appTranslator.load( QString(MY_CONFIG_NAME) + "_" + QLocale::system().name(), QCoreApplication::applicationDirPath() + "/translations" );
    104101    installTranslator( &appTranslator );
    105102
    106103    Formatter::initUnits( );