Mercurial > mplayer.hg
changeset 32713:f49e1b37281a
Translate messages shown in the GUI window(s) from UTF-8
because the font file only holds a single byte character set font
author | ib |
---|---|
date | Wed, 19 Jan 2011 22:18:07 +0000 |
parents | 6ff3cc81d602 |
children | 5248e989612a |
files | gui/mplayer/gui_common.c |
diffstat | 1 files changed, 23 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/mplayer/gui_common.c Wed Jan 19 22:02:58 2011 +0000 +++ b/gui/mplayer/gui_common.c Wed Jan 19 22:18:07 2011 +0000 @@ -55,6 +55,7 @@ int i; char * p; size_t len; + gchar *msg = NULL; switch ( guiIntfStruct.StreamType ) { @@ -72,21 +73,38 @@ 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++ )