changeset 32715:d78209361383

Translate messages shown in the GUI window(s) only from UTF-8 if they are in UTF-8, i.e. check the conversation
author ib
date Thu, 20 Jan 2011 10:23:06 +0000
parents 5248e989612a
children 72dfebf10aff
files gui/mplayer/gui_common.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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 )