Changeset 458 for trunk/gui/src/main.cpp

Show
Ignore:
Timestamp:
09/08/08 16:42:53 (5 years ago)
Author:
wolke
Message:

applied hydrogen-svn20080901-Qt-translation.patch from guido scholz (thx)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gui/src/main.cpp

    r436 r458  
    2222 
    2323#include <QtGui> 
     24#include <QLibraryInfo> 
    2425#include "config.h" 
    2526#include "version.h" 
     
    218219                pQApp->setFont( QFont( family, pPref->getApplicationFontPointSize() ) ); 
    219220 
     221                QTranslator qttor( 0 ); 
    220222                QTranslator tor( 0 ); 
    221223                QString sTranslationFile = QString("hydrogen.") + QLocale::system().name(); 
    222224                QString sLocale = QLocale::system().name(); 
    223225                if ( sLocale != "C") { 
     226                        if (qttor.load( QString( "qt_" ) + sLocale, 
     227                                QLibraryInfo::location(QLibraryInfo::TranslationsPath))) 
     228                                pQApp->installTranslator( &qttor ); 
     229                        else 
     230                                _INFOLOG( QString("Warning: No Qt translation for locale %1 found.").arg(QLocale::system().name())); 
     231 
     232 
    224233                        QString sTranslationPath = "data/i18n"; 
    225234                        QString total = sTranslationPath + "/" + sTranslationFile + ".qm";