Commit ce825efe authored by Eric Petit's avatar Eric Petit

src/libvlc.*: --translation is now a string. Usefull if want to specify

 a different language than your OS, or if your OS is not localized...
parent 90b5e995
...@@ -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.82 2003/05/05 16:09:35 gbazin Exp $ * $Id: libvlc.c,v 1.83 2003/05/08 14:15:36 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,6 +212,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -212,6 +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;
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;
...@@ -330,12 +331,13 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -330,12 +331,13 @@ 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 );
if( !config_GetInt( p_vlc, "translation" ) ) psz_translation = config_GetPsz( p_vlc, "translation" );
if( psz_translation && *psz_translation )
{ {
/* Reset the default domain */ /* Reset the default domain */
SetLanguage( "C" ); SetLanguage( psz_translation );
textdomain( "dummy" ); textdomain( PACKAGE );
module_EndBank( p_vlc ); module_EndBank( p_vlc );
module_InitBank( &libvlc ); module_InitBank( &libvlc );
...@@ -1014,11 +1016,20 @@ static void SetLanguage ( char const *psz_lang ) ...@@ -1014,11 +1016,20 @@ static void SetLanguage ( char const *psz_lang )
} }
else else
{ {
#ifdef SYS_BEOS
static char psz_lcall[20];
#endif
setlocale( LC_ALL, psz_lang ); setlocale( LC_ALL, psz_lang );
#ifdef SYS_DARWIN #ifdef SYS_DARWIN
/* I need that under Darwin, please check it doesn't disturb /* I need that under Darwin, please check it doesn't disturb
* other platforms. --Meuuh */ * other platforms. --Meuuh */
setenv( "LANG", psz_lang, 1 ); setenv( "LANG", psz_lang, 1 );
#endif
#ifdef SYS_BEOS
/* I need this under BeOS... */
snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
psz_lcall[19] = '\0';
putenv( psz_lcall );
#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.61 2003/05/07 23:13:07 hartman Exp $ * $Id: libvlc.h,v 1.62 2003/05/08 14:15:36 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>
...@@ -57,7 +57,9 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL }; ...@@ -57,7 +57,9 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL };
#define TRANSLATION_TEXT N_("Translation") #define TRANSLATION_TEXT N_("Translation")
#define TRANSLATION_LONGTEXT N_( \ #define TRANSLATION_LONGTEXT N_( \
"This option allows you to enable the translation of the interface.") "This option allows you to set the language of the interface " \
"(e.g. 'fr', 'de'...). If not specified, the system language is " \
"auto-detected." )
#define COLOR_TEXT N_("Color messages") #define COLOR_TEXT N_("Color messages")
#define COLOR_LONGTEXT N_( \ #define COLOR_LONGTEXT N_( \
...@@ -443,7 +445,7 @@ vlc_module_begin(); ...@@ -443,7 +445,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_bool( "translation", 1, NULL, TRANSLATION_TEXT, TRANSLATION_LONGTEXT, VLC_FALSE ); add_string( "translation", NULL, NULL, TRANSLATION_TEXT, TRANSLATION_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