[MPlayer-cvslog] r32800 - trunk/gui/mplayer/gui_common.c
ib
subversion at mplayerhq.hu
Wed Jan 19 23:18:07 CET 2011
Author: ib
Date: Wed Jan 19 23:18:07 2011
New Revision: 32800
Log:
Translate messages shown in the GUI window(s) from UTF-8
because the font file only holds a single byte character set font
Modified:
trunk/gui/mplayer/gui_common.c
Modified: trunk/gui/mplayer/gui_common.c
==============================================================================
--- trunk/gui/mplayer/gui_common.c Wed Jan 19 23:02:58 2011 (r32799)
+++ trunk/gui/mplayer/gui_common.c Wed Jan 19 23:18:07 2011 (r32800)
@@ -55,6 +55,7 @@ static inline void TranslateFilename( in
int i;
char * p;
size_t len;
+ gchar *msg = NULL;
switch ( guiIntfStruct.StreamType )
{
@@ -72,21 +73,38 @@ static inline void TranslateFilename( in
if ( ( len > 3 )&&( tmp[len - 3] == '.' ) ) tmp[len - 3]=0;
else if ( ( len > 4 )&&( tmp[len - 4] == '.' ) ) tmp[len - 4]=0;
else if ( ( len > 5 )&&( tmp[len - 5] == '.' ) ) tmp[len - 5]=0;
- } else av_strlcpy( tmp,MSGTR_NoFileLoaded,tmplen );
+ }
+ else
+ {
+ msg = g_filename_from_utf8( MSGTR_NoFileLoaded, -1, NULL, NULL, NULL );
+ av_strlcpy( tmp, msg, tmplen );
+ }
break;
#ifdef CONFIG_DVDREAD
case STREAMTYPE_DVD:
- if ( guiIntfStruct.DVD.current_chapter ) snprintf(tmp,tmplen,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
- else av_strlcat( tmp,MSGTR_NoChapter,tmplen );
+ if ( guiIntfStruct.DVD.current_chapter )
+ {
+ msg = g_filename_from_utf8( MSGTR_Chapter, -1, NULL, NULL, NULL );
+ snprintf( tmp, tmplen, msg, guiIntfStruct.DVD.current_chapter );
+ }
+ else
+ {
+ msg = g_filename_from_utf8( MSGTR_NoChapter, -1, NULL, NULL, NULL );
+ av_strlcat( tmp, msg, tmplen );
+ }
break;
#endif
#ifdef CONFIG_VCD
case STREAMTYPE_VCD:
- snprintf( tmp,tmplen,MSGTR_VCDTrack,guiIntfStruct.Track );
+ msg = g_filename_from_utf8( MSGTR_VCDTrack, -1, NULL, NULL, NULL );
+ snprintf( tmp, tmplen, msg, guiIntfStruct.Track );
break;
#endif
- default: av_strlcpy( tmp,MSGTR_NoMediaOpened,tmplen );
+ default:
+ msg = g_filename_from_utf8( MSGTR_NoMediaOpened, -1, NULL, NULL, NULL );
+ av_strlcpy( tmp, msg, tmplen );
}
+ g_free(msg);
if ( c )
{
for ( i=0;i < (int)strlen( tmp );i++ )
More information about the MPlayer-cvslog
mailing list