1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-04 03:25:39 +02:00

* Fixed untranslatable strings issue.

This commit is contained in:
Christian Muehlhaeuser
2012-05-26 11:13:42 +02:00
parent cfa63049e2
commit da82f398be
3 changed files with 72 additions and 64 deletions

View File

@@ -29,6 +29,7 @@
#include <QtNetwork/QNetworkReply>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QTranslator>
#include "Artist.h"
#include "Album.h"
@@ -129,6 +130,29 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
setApplicationVersion( QLatin1String( TOMAHAWK_VERSION ) );
registerMetaTypes();
installTranslator();
}
void
TomahawkApp::installTranslator()
{
QString locale = QLocale::system().name();
if ( locale == "C" )
locale = "en";
QTranslator* translator = new QTranslator( this );
if ( translator->load( QString( ":/lang/tomahawk_" ) + locale ) )
{
tDebug() << "Using system locale:" << locale;
}
else
{
tDebug() << "Using default locale, system locale one not found:" << locale;
translator->load( QString( ":/lang/tomahawk_en" ) );
}
TOMAHAWK_APPLICATION::installTranslator( translator );
}