# HG changeset patch # User ib # Date 1295518986 0 # Node ID d7820936138313cfd8308353995d3a44f0b58603 # Parent 5248e989612a454d555fa806f2eccade2dfd5818 Translate messages shown in the GUI window(s) only from UTF-8 if they are in UTF-8, i.e. check the conversation diff -r 5248e989612a -r d78209361383 gui/mplayer/gui_common.c --- a/gui/mplayer/gui_common.c Thu Jan 20 09:41:43 2011 +0000 +++ b/gui/mplayer/gui_common.c Thu Jan 20 10:23:06 2011 +0000 @@ -77,7 +77,7 @@ else { msg = g_filename_from_utf8( MSGTR_NoFileLoaded, -1, NULL, NULL, NULL ); - av_strlcpy( tmp, msg, tmplen ); + av_strlcpy( tmp, ( msg ? msg : MSGTR_NoFileLoaded ), tmplen ); } break; #ifdef CONFIG_DVDREAD @@ -85,24 +85,24 @@ if ( guiIntfStruct.DVD.current_chapter ) { msg = g_filename_from_utf8( MSGTR_Chapter, -1, NULL, NULL, NULL ); - snprintf( tmp, tmplen, msg, guiIntfStruct.DVD.current_chapter ); + snprintf( tmp, tmplen, ( msg ? msg : MSGTR_Chapter ), guiIntfStruct.DVD.current_chapter ); } else { msg = g_filename_from_utf8( MSGTR_NoChapter, -1, NULL, NULL, NULL ); - av_strlcat( tmp, msg, tmplen ); + av_strlcat( tmp, ( msg ? msg : MSGTR_NoChapter ), tmplen ); } break; #endif #ifdef CONFIG_VCD case STREAMTYPE_VCD: msg = g_filename_from_utf8( MSGTR_VCDTrack, -1, NULL, NULL, NULL ); - snprintf( tmp, tmplen, msg, guiIntfStruct.Track ); + snprintf( tmp, tmplen, ( msg ? msg : MSGTR_VCDTrack ), guiIntfStruct.Track ); break; #endif default: msg = g_filename_from_utf8( MSGTR_NoMediaOpened, -1, NULL, NULL, NULL ); - av_strlcpy( tmp, msg, tmplen ); + av_strlcpy( tmp, ( msg ? msg : MSGTR_NoMediaOpened ), tmplen ); } g_free(msg); if ( c )