Commit 231797fc authored by Eric Petit's avatar Eric Petit

* src/libvlc.[ch]: removed --translation to avoid breaking compatibility

 with old config files; --language is now a string_from_list you can use
 to specify the language (default is auto-detection).
parent 55365965
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.84 2003/05/08 15:58:44 gbazin Exp $ * $Id: libvlc.c,v 1.85 2003/05/10 13:40:37 titer Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -212,7 +212,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -212,7 +212,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
char * p_tmp; char * p_tmp;
char * psz_modules; char * psz_modules;
char * psz_parser; char * psz_parser;
char * psz_translation; char * psz_language;
vlc_bool_t b_exit = VLC_FALSE; vlc_bool_t b_exit = VLC_FALSE;
vlc_t * p_vlc; vlc_t * p_vlc;
module_t *p_help_module; module_t *p_help_module;
...@@ -331,11 +331,12 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -331,11 +331,12 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
config_LoadConfigFile( p_vlc, "main" ); config_LoadConfigFile( p_vlc, "main" );
config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE ); config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE );
psz_translation = config_GetPsz( p_vlc, "translation" ); /* Check if the user specified a custom language */
if( psz_translation && *psz_translation ) psz_language = config_GetPsz( p_vlc, "language" );
if( psz_language && *psz_language && strcmp( psz_language, "auto" ) )
{ {
/* Reset the default domain */ /* Reset the default domain */
SetLanguage( psz_translation ); SetLanguage( psz_language );
/* Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */ /* Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
msg_Dbg( p_vlc, "translation test: code is \"%s\"", _("C") ); msg_Dbg( p_vlc, "translation test: code is \"%s\"", _("C") );
...@@ -347,6 +348,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -347,6 +348,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
module_LoadMain( &libvlc ); module_LoadMain( &libvlc );
config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE ); config_LoadCmdLine( p_vlc, &i_argc, ppsz_argv, VLC_TRUE );
} }
if( psz_language ) free( psz_language );
#endif #endif
/* /*
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header * libvlc.h: main libvlc header
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.63 2003/05/08 15:58:44 gbazin Exp $ * $Id: libvlc.h,v 1.64 2003/05/10 13:40:37 titer Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
static char *ppsz_sout_acodec[] = { "", "mpeg1", "mpeg2", "mpeg4", "vorbis", NULL }; static char *ppsz_sout_acodec[] = { "", "mpeg1", "mpeg2", "mpeg4", "vorbis", NULL };
static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL }; static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL };
static char *ppsz_language[] = { "auto", "de", "en_GB", "fr", "it",
"ja", "nl", "no", "pl", "ru", "sv" };
/***************************************************************************** /*****************************************************************************
* Configuration options for the main program. Each module will also separatly * Configuration options for the main program. Each module will also separatly
...@@ -55,12 +57,10 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL }; ...@@ -55,12 +57,10 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL };
#define QUIET_LONGTEXT N_( \ #define QUIET_LONGTEXT N_( \
"This options turns off all warning and information messages.") "This options turns off all warning and information messages.")
#define TRANSLATION_TEXT N_("Translation") #define LANGUAGE_TEXT N_("Language")
#define TRANSLATION_LONGTEXT N_( \ #define LANGUAGE_LONGTEXT N_( "This option allows you to set the language " \
"This option allows you to set the language of the interface or disable " \ "of the interface. The system language is auto-detected if \"auto\" is " \
"the translation alltogether " \ "specified here." )
"(e.g. 'C' (for disable), 'fr', 'de', 'en_GB', ...). " \
"The system language is auto-detected if nothing is specified here." )
#define COLOR_TEXT N_("Color messages") #define COLOR_TEXT N_("Color messages")
#define COLOR_LONGTEXT N_( \ #define COLOR_LONGTEXT N_( \
...@@ -446,7 +446,7 @@ vlc_module_begin(); ...@@ -446,7 +446,7 @@ vlc_module_begin();
add_integer_with_short( "verbose", 'v', -1, NULL, add_integer_with_short( "verbose", 'v', -1, NULL,
VERBOSE_TEXT, VERBOSE_LONGTEXT, VLC_FALSE ); VERBOSE_TEXT, VERBOSE_LONGTEXT, VLC_FALSE );
add_bool_with_short( "quiet", 'q', 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_TRUE ); add_bool_with_short( "quiet", 'q', 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_TRUE );
add_string( "translation", NULL, NULL, TRANSLATION_TEXT, TRANSLATION_LONGTEXT, VLC_FALSE ); add_string_from_list( "language", "auto", ppsz_language, NULL, LANGUAGE_TEXT, LANGUAGE_LONGTEXT, VLC_FALSE );
add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE ); add_bool( "color", 0, NULL, COLOR_TEXT, COLOR_LONGTEXT, VLC_TRUE );
add_bool( "advanced", 0, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT, VLC_FALSE ); add_bool( "advanced", 0, NULL, ADVANCED_TEXT, ADVANCED_LONGTEXT, VLC_FALSE );
add_string( "search-path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT, VLC_TRUE ); add_string( "search-path", NULL, NULL, INTF_PATH_TEXT, INTF_PATH_LONGTEXT, VLC_TRUE );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment