From: Christophe Mutricy Date: Mon, 15 Oct 2007 21:43:40 +0000 (+0000) Subject: i18n for the Qt dialogs X-Git-Tag: 0.9.0-test0~5014 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b304bb033d70a5d6ba79a69d362cb9325a4f08c3;p=vlc i18n for the Qt dialogs --- diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index a5f97af407..8ecb99d4e0 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -22,8 +22,11 @@ *****************************************************************************/ #include +#include +#include #include "qt4.hpp" +#include #include "dialogs_provider.hpp" #include "input_manager.hpp" #include "main_interface.hpp" @@ -245,6 +248,23 @@ static void Init( intf_thread_t *p_intf ) else /*if( p_intf->pf_show_dialog )*/ vlc_thread_ready( p_intf ); + // Translation - get locale + QLocale ql = QLocale::system (); + // Translations for qt's own dialogs + QTranslator qtTranslator( 0 ); + // Let's find the right path for the translation file +#if !defined( WIN32 ) + + QString path = QString(QT4LOCALEDIR); +#else + QString path = QString( QString(system_VLCPath()) + DIR_SEP + + "locale" + DIR_SEP ); +#endif + // files depending on locale + bool b_loaded = qtTranslator.load( path + "qt_" + ql.name()); + if (!b_loaded) + msg_Dbg(p_intf, "Error while initializing qt-specific localization"); + app->installTranslator(&qtTranslator); /* Start playing if needed */ if( !p_intf->pf_show_dialog && p_intf->b_play )