Commit 64b58623 authored by Christophe Massiot's avatar Christophe Massiot

* configure.ac.in: Disabled Swedish translation since it doesn't use the

  right charset,
* Implemented localization for audio-channels and video-device variables.
parent 4b664e9c
...@@ -169,7 +169,7 @@ AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32") ...@@ -169,7 +169,7 @@ AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
dnl dnl
dnl Gettext stuff dnl Gettext stuff
dnl dnl
ALL_LINGUAS="de en_GB fr it ja no ru nl pl sv" ALL_LINGUAS="de en_GB fr it ja no ru nl pl"
AM_GNU_GETTEXT_VERSION(0.10.40) AM_GNU_GETTEXT_VERSION(0.10.40)
AM_GNU_GETTEXT AM_GNU_GETTEXT
if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
......
...@@ -399,7 +399,7 @@ ...@@ -399,7 +399,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.5.0</string> <string>0.5.1-cvs</string>
<key>NSAppleScriptEnabled</key> <key>NSAppleScriptEnabled</key>
<string>YES</string> <string>YES</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin * controls.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: controls.m,v 1.21 2003/02/07 21:30:25 hartman Exp $ * $Id: controls.m,v 1.22 2003/02/08 17:26:00 massiot Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -635,7 +635,7 @@ ...@@ -635,7 +635,7 @@
if( [o_mi state] == NSOffState ) if( [o_mi state] == NSOffState )
{ {
const char * psz_variable = (const char *)[o_mi tag]; const char * psz_variable = (const char *)[o_mi tag];
const char * psz_value = [[o_mi title] cString]; char * psz_value = [NSApp delocalizeString: [o_mi title]];
vlc_object_t * p_object = (vlc_object_t *) vlc_object_t * p_object = (vlc_object_t *)
[[o_mi representedObject] pointerValue]; [[o_mi representedObject] pointerValue];
vlc_value_t val; vlc_value_t val;
...@@ -646,6 +646,8 @@ ...@@ -646,6 +646,8 @@
{ {
msg_Warn( p_object, "cannot set variable (%s)", psz_value ); msg_Warn( p_object, "cannot set variable (%s)", psz_value );
} }
free( psz_value );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin * intf.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: intf.h,v 1.23 2003/02/07 20:23:17 hartman Exp $ * $Id: intf.h,v 1.24 2003/02/08 17:26:00 massiot Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
- (void)initIntlSupport; - (void)initIntlSupport;
- (NSString *)localizedString:(char *)psz; - (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz;
- (void)setIntf:(intf_thread_t *)p_intf; - (void)setIntf:(intf_thread_t *)p_intf;
- (intf_thread_t *)getIntf; - (intf_thread_t *)getIntf;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin * intf.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.48 2003/02/07 20:23:17 hartman Exp $ * $Id: intf.m,v 1.49 2003/02/08 17:26:00 massiot Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -154,6 +154,32 @@ static void Run( intf_thread_t *p_intf ) ...@@ -154,6 +154,32 @@ static void Run( intf_thread_t *p_intf )
return( o_str ); return( o_str );
} }
- (char *)delocalizeString:(NSString *)id
{
NSData * o_data = [id dataUsingEncoding: i_encoding
allowLossyConversion: NO];
char * psz_string;
if ( o_data == nil )
{
o_data = [id dataUsingEncoding: i_encoding
allowLossyConversion: YES];
psz_string = malloc( [o_data length] + 1 );
[o_data getBytes: psz_string];
psz_string[ [o_data length] ] = '\0';
msg_Err( p_intf, "cannot convert to wanted encoding: %s",
psz_string );
}
else
{
psz_string = malloc( [o_data length] + 1 );
[o_data getBytes: psz_string];
psz_string[ [o_data length] ] = '\0';
}
return psz_string;
}
- (void)setIntf:(intf_thread_t *)_p_intf - (void)setIntf:(intf_thread_t *)_p_intf
{ {
p_intf = _p_intf; p_intf = _p_intf;
...@@ -1259,8 +1285,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -1259,8 +1285,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
NSMenuItem * o_lmi; NSMenuItem * o_lmi;
NSString * o_title; NSString * o_title;
//o_title = [NSApp localizedString: val.p_list->p_values[i].psz_string]; o_title = [NSApp localizedString: val.p_list->p_values[i].psz_string];
o_title = [NSString stringWithCString: val.p_list->p_values[i].psz_string];
o_lmi = [o_menu addItemWithTitle: o_title o_lmi = [o_menu addItemWithTitle: o_title
action: pf_callback keyEquivalent: @""]; action: pf_callback keyEquivalent: @""];
/* FIXME: this isn't 64-bit clean ! */ /* FIXME: this isn't 64-bit clean ! */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin * vout.m: MacOS X video output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.25 2003/02/07 21:30:25 hartman Exp $ * $Id: vout.m,v 1.26 2003/02/08 17:26:00 massiot Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -191,7 +191,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -191,7 +191,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
NSRect s_rect = [o_screen frame]; NSRect s_rect = [o_screen frame];
snprintf( psz_temp, sizeof(psz_temp)/sizeof(psz_temp[0])-1, snprintf( psz_temp, sizeof(psz_temp)/sizeof(psz_temp[0])-1,
"%s %d (%dx%d)", "Screen", i, "%s %d (%dx%d)", _("Screen"), i,
(int)s_rect.size.width, (int)s_rect.size.height ); (int)s_rect.size.width, (int)s_rect.size.height );
val.psz_string = psz_temp; val.psz_string = psz_temp;
...@@ -953,7 +953,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -953,7 +953,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
unsigned int i_index = 0; unsigned int i_index = 0;
NSArray *o_screens = [NSScreen screens]; NSArray *o_screens = [NSScreen screens];
if( !sscanf( val.psz_string, "Screen %d", &i_index ) || if( !sscanf( val.psz_string, _("Screen %d"), &i_index ) ||
[o_screens count] < i_index ) [o_screens count] < i_index )
{ {
o_screen = [NSScreen mainScreen]; o_screen = [NSScreen mainScreen];
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
src/libvlc.c src/libvlc.c
src/libvlc.h src/libvlc.h
src/misc/configuration.c src/misc/configuration.c
src/audio_output/output.c
include/interface.h include/interface.h
# access modules # access modules
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* output.c : internal management of output streams for the audio output * output.c : internal management of output streams for the audio output
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: output.c,v 1.35 2003/01/28 12:23:40 massiot Exp $ * $Id: output.c,v 1.36 2003/02/08 17:26:00 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -69,25 +69,25 @@ int aout_OutputNew( aout_instance_t * p_aout, ...@@ -69,25 +69,25 @@ int aout_OutputNew( aout_instance_t * p_aout,
/* The user may have selected a different channels configuration. */ /* The user may have selected a different channels configuration. */
var_Get( p_aout, "audio-channels", &val ); var_Get( p_aout, "audio-channels", &val );
if ( !strcmp( val.psz_string, N_("Reverse stereo") ) ) if ( !strcmp( val.psz_string, _("Reverse stereo") ) )
{ {
p_aout->output.output.i_original_channels |= p_aout->output.output.i_original_channels |=
AOUT_CHAN_REVERSESTEREO; AOUT_CHAN_REVERSESTEREO;
} }
else if ( !strcmp( val.psz_string, N_("Both") ) ) else if ( !strcmp( val.psz_string, _("Stereo") ) )
{ {
p_aout->output.output.i_original_channels = p_aout->output.output.i_original_channels =
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT; AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
} }
else if ( !strcmp( val.psz_string, N_("Left") ) ) else if ( !strcmp( val.psz_string, _("Left") ) )
{ {
p_aout->output.output.i_original_channels = AOUT_CHAN_LEFT; p_aout->output.output.i_original_channels = AOUT_CHAN_LEFT;
} }
else if ( !strcmp( val.psz_string, N_("Right") ) ) else if ( !strcmp( val.psz_string, _("Right") ) )
{ {
p_aout->output.output.i_original_channels = AOUT_CHAN_RIGHT; p_aout->output.output.i_original_channels = AOUT_CHAN_RIGHT;
} }
else if ( !strcmp( val.psz_string, N_("Dolby Surround") ) ) else if ( !strcmp( val.psz_string, _("Dolby Surround") ) )
{ {
p_aout->output.output.i_original_channels p_aout->output.output.i_original_channels
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_DOLBYSTEREO; = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_DOLBYSTEREO;
...@@ -100,17 +100,17 @@ int aout_OutputNew( aout_instance_t * p_aout, ...@@ -100,17 +100,17 @@ int aout_OutputNew( aout_instance_t * p_aout,
{ {
/* Mono - create the audio-channels variable. */ /* Mono - create the audio-channels variable. */
var_Create( p_aout, "audio-channels", VLC_VAR_STRING | VLC_VAR_HASCHOICE ); var_Create( p_aout, "audio-channels", VLC_VAR_STRING | VLC_VAR_HASCHOICE );
val.psz_string = N_("Both"); val.psz_string = _("Stereo");
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
val.psz_string = N_("Left"); val.psz_string = _("Left");
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
val.psz_string = N_("Right"); val.psz_string = _("Right");
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
if ( p_aout->output.output.i_original_channels & AOUT_CHAN_DUALMONO ) if ( p_aout->output.output.i_original_channels & AOUT_CHAN_DUALMONO )
{ {
/* Go directly to the left channel. */ /* Go directly to the left channel. */
p_aout->output.output.i_original_channels = AOUT_CHAN_LEFT; p_aout->output.output.i_original_channels = AOUT_CHAN_LEFT;
val.psz_string = N_("Left"); val.psz_string = _("Left");
var_Set( p_aout, "audio-channels", val ); var_Set( p_aout, "audio-channels", val );
} }
var_AddCallback( p_aout, "audio-channels", aout_ChannelsRestart, var_AddCallback( p_aout, "audio-channels", aout_ChannelsRestart,
...@@ -125,24 +125,24 @@ int aout_OutputNew( aout_instance_t * p_aout, ...@@ -125,24 +125,24 @@ int aout_OutputNew( aout_instance_t * p_aout,
var_Create( p_aout, "audio-channels", VLC_VAR_STRING | VLC_VAR_HASCHOICE ); var_Create( p_aout, "audio-channels", VLC_VAR_STRING | VLC_VAR_HASCHOICE );
if ( p_aout->output.output.i_original_channels & AOUT_CHAN_DOLBYSTEREO ) if ( p_aout->output.output.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
{ {
val.psz_string = N_("Dolby Surround"); val.psz_string = _("Dolby Surround");
} }
else else
{ {
val.psz_string = N_("Both"); val.psz_string = _("Stereo");
} }
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
val.psz_string = N_("Left"); val.psz_string = _("Left");
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
val.psz_string = N_("Right"); val.psz_string = _("Right");
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
val.psz_string = N_("Reverse stereo"); val.psz_string = _("Reverse stereo");
var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val ); var_Change( p_aout, "audio-channels", VLC_VAR_ADDCHOICE, &val );
if ( p_aout->output.output.i_original_channels & AOUT_CHAN_DUALMONO ) if ( p_aout->output.output.i_original_channels & AOUT_CHAN_DUALMONO )
{ {
/* Go directly to the left channel. */ /* Go directly to the left channel. */
p_aout->output.output.i_original_channels = AOUT_CHAN_LEFT; p_aout->output.output.i_original_channels = AOUT_CHAN_LEFT;
val.psz_string = N_("Left"); val.psz_string = _("Left");
var_Set( p_aout, "audio-channels", val ); var_Set( p_aout, "audio-channels", val );
} }
var_AddCallback( p_aout, "audio-channels", aout_ChannelsRestart, var_AddCallback( p_aout, "audio-channels", aout_ChannelsRestart,
......
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