[vlmc-devel] commit: Add option for language auto-detection. (Ludovic Fauvet )

git at videolan.org git at videolan.org
Tue Apr 13 12:11:29 CEST 2010


vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Tue Apr 13 12:10:36 2010 +0200| [192dcd6d45fe4aa9b59ca6b22f2e3d115f230e58] | committer: Ludovic Fauvet 

Add option for language auto-detection.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=192dcd6d45fe4aa9b59ca6b22f2e3d115f230e58
---

 src/Gui/MainWindow.cpp              |    2 +-
 src/Gui/settings/LanguageWidget.cpp |    7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index a4b5e94..db820d8 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -195,7 +195,7 @@ MainWindow::initVlmcPreferences()
     CREATE_MENU_SHORTCUT( "keyboard/importmedia", "Ctrl+I", "Import media", "Open the import window", actionImport );
     CREATE_MENU_SHORTCUT( "keyboard/renderproject", "Ctrl+R", "Render the project", "Render the project to a file", actionRender );
 
-    VLMC_CREATE_PREFERENCE_LANGUAGE( "general/VLMCLang", "en_US", "Langage", "The VLMC's UI language" );
+    VLMC_CREATE_PREFERENCE_LANGUAGE( "general/VLMCLang", "default", "Langage", "The VLMC's UI language" );
     SettingsManager::getInstance()->watchValue( "general/VLMCLang",
                                                 LanguageHelper::getInstance(),
                                                 SLOT( languageChanged( const QVariant& ) ),
diff --git a/src/Gui/settings/LanguageWidget.cpp b/src/Gui/settings/LanguageWidget.cpp
index ce831f4..750e3d7 100644
--- a/src/Gui/settings/LanguageWidget.cpp
+++ b/src/Gui/settings/LanguageWidget.cpp
@@ -66,10 +66,15 @@ LanguageWidget::LanguageWidget( SettingValue *s, QWidget *parent /*= NULL*/ ) :
                 QLocale::languageToString( locale.language() ),
                 QLocale::countryToString( locale.country() ) ), countryCode );
     }
-    m_list->addItem( "English (UnitedStates)",    "en_US" );
+    // Add the built-in us_US locale.
+    m_list->addItem( "English (UnitedStates)", "en_US" );
 
     // Sort the combobox
     m_list->model()->sort( 0 );
+
+    // Add the system default option (auto-detection of the locale)
+    m_list->insertItem( 0, "System Locale (autodetect)", "default" );
+
     QString lang = VLMC_GET_STRING( "general/VLMCLang" );
     int idx = m_list->findData( lang );
     if ( idx != -1 )



More information about the Vlmc-devel mailing list