changeset 36717:33d8f99d110a

Make more messages translatable.
author ib
date Sat, 08 Feb 2014 20:39:02 +0000
parents 4926c0a1d1f7
children bcc482b14d39
files help/help_mp-en.h libvo/x11_common.c
diffstat 2 files changed, 26 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/help/help_mp-en.h	Sat Feb 08 20:04:46 2014 +0000
+++ b/help/help_mp-en.h	Sat Feb 08 20:39:02 2014 +0000
@@ -1175,6 +1175,19 @@
 #define MSGTR_EwmhFullscreenStateFailed "\nX11: Couldn't send EWMH fullscreen event!\n"
 #define MSGTR_CouldNotFindXScreenSaver "xscreensaver_disable: Could not find XScreenSaver window.\n"
 #define MSGTR_SelectedVideoMode "XF86VM: Selected video mode %dx%d for image size %dx%d.\n"
+#define MSGTR_X11Error "X11 error: %s\n"
+#define MSGTR_CouldntFindUTF8Locale "Could not find a UTF-8 locale, some keys will not be handled.\n"
+#define MSGTR_CouldntOpenDisplay "vo: couldn't open the X11 display (%s)!\n"
+#define MSGTR_WindowDestroyed "Our window was destroyed, exiting\n"
+#define MSGTR_DPMSnotAvailable "DPMS not available?\n"
+#define MSGTR_DPMSnotEnabled "Could not enable DPMS\n"
+#define MSGTR_BadAccessXSelectInput "X11 error: BadAccess during XSelectInput Call\n"
+#define MSGTR_ButtonPressMaskInUse "X11 error: The 'ButtonPressMask' mask of specified window was probably already used by another application (see man XSelectInput)\n"
+#define MSGTR_DiscardMouseControl "X11 error: MPlayer discards mouse control (reconfiguring)\n"
+#define MSGTR_NoXF86VidModeExtension "XF86VidMode extension not available.\n"
+#define MSGTR_ReturningOriginalMode "Returning to original mode %dx%d\n"
+#define MSGTR_CouldntSetColorkey "[xv common] Couldn't set colorkey!\n"
+#define MSGTR_CouldntGetColorkey "[xv common] Couldn't get colorkey! Maybe the selected Xv port has no overlay.\n"
 
 #define MSGTR_InsertingAfVolume "[Mixer] No hardware mixing, inserting volume filter.\n"
 #define MSGTR_NoVolume "[Mixer] No volume control available.\n"
--- a/libvo/x11_common.c	Sat Feb 08 20:04:46 2014 +0000
+++ b/libvo/x11_common.c	Sat Feb 08 20:39:02 2014 +0000
@@ -220,7 +220,7 @@
 
     XGetErrorText(display, event->error_code, (char *) &msg, MSGLEN);
 
-    mp_msg(MSGT_VO, MSGL_ERR, "X11 error: %s\n", msg);
+    mp_msg(MSGT_VO, MSGL_ERR, MSGTR_X11Error, msg);
 
     mp_msg(MSGT_VO, MSGL_V,
            "Type: %x, display: %p, resourceid: %lx, serial: %lx\n",
@@ -431,7 +431,7 @@
 
     // Required so that XLookupString returns UTF-8
     if (!setlocale(LC_CTYPE, "C.UTF-8") && !setlocale(LC_CTYPE, "en_US.utf8"))
-        mp_msg(MSGT_VO, MSGL_WARN, "Could not find a UTF-8 locale, some keys will not be handled.\n");
+        mp_msg(MSGT_VO, MSGL_WARN, MSGTR_CouldntFindUTF8Locale);
     XSetErrorHandler(x11_errorhandler);
 
     dispName = XDisplayName(mDisplayName);
@@ -442,7 +442,7 @@
     if (!mDisplay)
     {
         mp_msg(MSGT_VO, MSGL_ERR,
-               "vo: couldn't open the X11 display (%s)!\n", dispName);
+               MSGTR_CouldntOpenDisplay, dispName);
         return 0;
     }
     mScreen = DefaultScreen(mDisplay);  // screen ID
@@ -924,7 +924,7 @@
                 }
                 break;
             case DestroyNotify:
-                mp_msg(MSGT_VO, MSGL_WARN, "Our window was destroyed, exiting\n");
+                mp_msg(MSGT_VO, MSGL_WARN, MSGTR_WindowDestroyed);
                 mplayer_put_key(KEY_CLOSE_WIN);
                 break;
 	    case ClientMessage:
@@ -1530,7 +1530,7 @@
         {
             if (!DPMSEnable(mDisplay))
             {                   // restoring power saving settings
-                mp_msg(MSGT_VO, MSGL_WARN, "DPMS not available?\n");
+                mp_msg(MSGT_VO, MSGL_WARN, MSGTR_DPMSnotAvailable);
             } else
             {
                 // DPMS does not seem to be enabled unless we call DPMSInfo
@@ -1545,7 +1545,7 @@
                            "Successfully enabled DPMS\n");
                 } else
                 {
-                    mp_msg(MSGT_VO, MSGL_WARN, "Could not enable DPMS\n");
+                    mp_msg(MSGT_VO, MSGL_WARN, MSGTR_DPMSnotEnabled);
                 }
             }
         }
@@ -1592,9 +1592,9 @@
     {
         selectinput_err = 1;
         mp_msg(MSGT_VO, MSGL_ERR,
-               "X11 error: BadAccess during XSelectInput Call\n");
+               MSGTR_BadAccessXSelectInput);
         mp_msg(MSGT_VO, MSGL_ERR,
-               "X11 error: The 'ButtonPressMask' mask of specified window was probably already used by another application (see man XSelectInput)\n");
+               MSGTR_ButtonPressMaskInUse);
         /* If you think MPlayer should shutdown with this error,
          * comment out the following line */
         return 0;
@@ -1626,7 +1626,7 @@
     if (selectinput_err)
     {
         mp_msg(MSGT_VO, MSGL_ERR,
-               "X11 error: MPlayer discards mouse control (reconfiguring)\n");
+               MSGTR_DiscardMouseControl);
         XSelectInput(display, w,
                      event_mask &
                      (~
@@ -1652,7 +1652,7 @@
         have_vm = 1;
     } else {
         mp_msg(MSGT_VO, MSGL_WARN,
-               "XF86VidMode extension not available.\n");
+               MSGTR_NoXF86VidModeExtension);
     }
 
     if (have_vm)
@@ -1708,7 +1708,7 @@
                 && (vidmodes[i]->vdisplay == vo_screenheight))
             {
                 mp_msg(MSGT_VO, MSGL_INFO,
-                       "Returning to original mode %dx%d\n",
+                       MSGTR_ReturningOriginalMode,
                        vo_screenwidth, vo_screenheight);
                 break;
             }
@@ -2250,7 +2250,7 @@
         if ( rez != Success )
         {
           mp_msg( MSGT_VO, MSGL_FATAL,
-                  "[xv common] Couldn't set colorkey!\n" );
+                  MSGTR_CouldntSetColorkey );
           return 0; // error setting colorkey
         }
       }
@@ -2267,8 +2267,7 @@
       else
       {
         mp_msg( MSGT_VO, MSGL_FATAL,
-                "[xv common] Couldn't get colorkey!"
-                "Maybe the selected Xv port has no overlay.\n" );
+                MSGTR_CouldntGetColorkey );
         return 0; // error getting colorkey
       }
     }