[MPlayer-dev-eng] [PATCH] EDL fix harcoded translatable messages

Reynaldo H. Verdejo Pinochet reynaldo at opendot.cl
Mon Sep 13 05:23:54 CEST 2004


Hi

this patches fix those anoying harcoded translatable messages
( my dumb mystake ) on EDL you were talking about.

Best regards

  Reynaldo

ps1: given Im doing some long term work trying to implement edl
on mencoder too, and having prooved im not a cola addict ;) could
you consider granting write cvs access?

ps2: I can send the spanish translation for this messages too, just
want to know if this is the right thing to do, given there ARE spanish
translators for this kind of messages.
-------------- next part --------------
--- edl.c	2004-09-04 04:37:12.000000000 -0400
+++ ../my_main/edl.c	2004-09-12 22:35:59.000000000 -0400
@@ -3,6 +3,8 @@
 #include "config.h"
 #include "mp_msg.h"
 #include "edl.h"
+#define HELP_MP_DEFINE_STATIC
+#include "help_mp.h"
 
 #ifdef USE_EDL
 
@@ -39,8 +41,7 @@
     {
         if ((fd = fopen(edl_filename, "r")) == NULL)
         {
-            mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                   "Invalid EDL file, cant open '%s' for reading!\n",
+            mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlCantOpenForRead,
                    edl_filename);
             return (EDL_ERROR);
         } else
@@ -56,8 +57,7 @@
                         entries += 2;
                 } else
                 {
-                    mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                           "Invalid EDL line: %s\n", line);
+                    mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine, line);
                     return (EDL_ERROR);
                 }
 
@@ -99,9 +99,8 @@
                 if ((sscanf(line, "%f %f %d", &start, &stop, &action))
                     != 3)
                 {
-                    mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                           "Badly formated EDL line [%d]. Discarding!\n",
-                           lineCount + 1, line);
+                    mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadlyFormatedLine,
+                           lineCount + 1);
                     continue;
                 } else
                 {
@@ -109,22 +108,19 @@
                     {
                         if (start <= (next_edl_record - 1)->stop_sec)
                         {
-                            mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                                   "Invalid EDL line [%d]: %s",
-                                   lineCount, line);
-                            mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                                   "Last stop position was [%f]; next start is [%f]. Entries must be in chronological order and cannot overlap. Discarding!\n",
+                            mp_msg(MSGT_CPLAYER, MSGL_WARN, 
+                                   MSGTR_EdlNOValidLine, line);
+                            mp_msg(MSGT_CPLAYER, MSGL_WARN, 
+                                   MSGTR_EdlBadLineOverlap,
                                    (next_edl_record - 1)->stop_sec, start);
                             continue;
                         }
                     }
                     if (stop <= start)
                     {
-                        mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                               "Invalid EDL line [%d]: %s", lineCount,
+                        mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlNOValidLine,
                                line);
-                        mp_msg(MSGT_CPLAYER, MSGL_WARN,
-                               "Stop time has to be after start time. Discarding!\n");
+                        mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdlBadLineBadStop);
                         continue;
                     }
                     next_edl_record->action = action;
-------------- next part --------------
--- ./help/help_mp-en.h	2004-09-12 21:44:12.000000000 -0400
+++ ../my_main/help/help_mp-en.h	2004-09-12 23:09:28.000000000 -0400
@@ -159,6 +159,18 @@
 "  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and\n"\
 "  won't help unless you provide this information when reporting a possible bug.\n"
 
+#define MSGTR_EdlCantUseBothModes "Cant use -edl and -edlout at the same time\n"
+#define MSGTR_EdlOutOfMem "Cant allocate enough memory to hold edl data\n"
+#define MSGTR_EdlRecordsNo "Readed %d EDL actions\n"
+#define MSGTR_EdlQueueEmpty "There are no EDL actions to take care of\n"
+#define MSGTR_EdlCantOpenForWrite "Error opening file [%s] for writing!\n"
+#define MSGTR_EdlCantOpenForRead "Cant open EDL file '%s' for reading!\n"
+#define MSGTR_EdlNOsh_video "Cannot use EDL without video, disabling\n"
+#define MSGTR_EdlNOValidLine "Invalid EDL line: %s\n"
+#define MSGTR_EdlBadlyFormatedLine "Badly formated EDL line [%d] Discarding!\n"
+#define MSGTR_EdlBadLineOverlap "Last stop position was [%f]; next start is "\
+"[%f]. Entries must be in chronological order, cannot overlap. Discarding!\n"
+#define MSGTR_EdlBadLineBadStop "Stop time has to be after start time\n"
 
 // mencoder.c:
 
-------------- next part --------------
--- mplayer.c	2004-09-12 21:44:02.000000000 -0400
+++ ../my_main/mplayer.c	2004-09-12 22:18:28.000000000 -0400
@@ -979,8 +979,7 @@
 #ifdef USE_EDL
 if (edl_check_mode() == EDL_ERROR && edl_filename)
 {
-    mp_msg(MSGT_CPLAYER, MSGL_ERR,
-           "Cant use -edl and -edlout at the same time, exiting\n");
+    mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantUseBothModes);
     exit_player(NULL);
 } else if (edl_filename)
 {
@@ -990,20 +989,18 @@
         edl_records = calloc(edl_memory_slots, sizeof(struct edl_record));
         if (edl_records == NULL)
         {
-            mp_msg(MSGT_CPLAYER, MSGL_FATAL,
-                   "Cant allocate enough memory to hold EDL data, exiting!\n");
+            mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_EdlOutOfMem);
             exit_player(NULL);	    
         } else
         {
             if ((edl_operations = edl_parse_file(edl_records)) > 0)
             {
-                mp_msg(MSGT_CPLAYER, MSGL_INFO, "Readed %d EDL actions\n",
+                mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlRecordsNo, 
                        edl_operations);
             } else
             {
 
-                mp_msg(MSGT_CPLAYER, MSGL_INFO,
-                       "There are no EDL actions to take care of\n");
+                mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdlQueueEmpty);
             }
         }
     }
@@ -1014,8 +1011,7 @@
 {
     if ((edl_fd = fopen(edl_output_filename, "w")) == NULL)
     {
-        mp_msg(MSGT_CPLAYER, MSGL_ERR, 
-	       "Error opening file [%s] for writing!, exiting\n",
+        mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlCantOpenForWrite,
                edl_output_filename);
         exit_player(NULL);
     }
@@ -2462,7 +2458,7 @@
 #ifdef USE_EDL
  if( next_edl_record ) { // Are we (still?) doing EDL?
   if ( !sh_video ) {
-    mp_msg( MSGT_CPLAYER, MSGL_ERR, "Cannot use edit list without video. EDL disabled.\n" );
+    mp_msg( MSGT_CPLAYER, MSGL_ERR, MSGTR_EdlNOsh_video );
     next_edl_record->next = NULL;
   } else {
    if( sh_video->pts >= next_edl_record->start_sec ) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040912/0644e33c/attachment.pgp>


More information about the MPlayer-dev-eng mailing list