[vlc-devel] commit: Fix language selection (Christophe Mutricy )
git version control
git at videolan.org
Thu Aug 7 01:52:51 CEST 2008
vlc | branch: master | Christophe Mutricy <xtophe at videolan.org> | Thu Aug 7 00:06:05 2008 +0100| [d0e8ece1bff1834d104fedaef4af9de0486354c0] | committer: Christophe Mutricy
Fix language selection
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0e8ece1bff1834d104fedaef4af9de0486354c0
---
modules/gui/qt4/qt4.cpp | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 722e6fb..a463fce 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -386,7 +386,13 @@ static void *Init( vlc_object_t *obj )
#ifdef ENABLE_NLS
// Translation - get locale
- QLocale ql = QLocale::system();
+# if defined (WIN32) || defined (__APPLE__)
+ QString lang = qfu( config_GetPsz( p_intf, "language" ) );
+ if (lang == "auto")
+ lang = QLocale::system().name();
+# else
+ QString lang = QLocale::system().name();
+# endif
// Translations for qt's own dialogs
QTranslator qtTranslator( 0 );
// Let's find the right path for the translation file
@@ -397,7 +403,7 @@ static void *Init( vlc_object_t *obj )
"locale" + DIR_SEP + "qt4" + DIR_SEP );
#endif
// files depending on locale
- bool b_loaded = qtTranslator.load( path + "qt_" + ql.name());
+ bool b_loaded = qtTranslator.load( path + "qt_" + lang );
if (!b_loaded)
msg_Dbg( p_intf, "Error while initializing qt-specific localization" );
app->installTranslator( &qtTranslator );
More information about the vlc-devel
mailing list