mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 08:34:34 +02:00
load translation based on system locale
this loads the resource that contains translations for the locale the user has set.
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
a55124ed75
commit
59391e3841
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tomahawk/tomahawkapp.h"
|
#include "tomahawk/tomahawkapp.h"
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
#include "tomahawkapp_mac.h"
|
#include "tomahawkapp_mac.h"
|
||||||
@@ -41,6 +42,12 @@ main( int argc, char *argv[] )
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
TomahawkApp a( argc, argv );
|
TomahawkApp a( argc, argv );
|
||||||
|
|
||||||
|
QString locale = QLocale::system().name();
|
||||||
|
|
||||||
|
QTranslator translator;
|
||||||
|
translator.load(QString(":/lang/tomahawk_") + locale);
|
||||||
|
a.installTranslator(&translator);
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
catch( const std::runtime_error& e )
|
catch( const std::runtime_error& e )
|
||||||
|
Reference in New Issue
Block a user