[glib] Fix some errors in translated strings



commit 99670eaccc05a4d5e9725614550e1da75cda45c0
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 7 07:37:42 2010 -0400

    Fix some errors in translated strings
    
    gettext can't handle macros, so we have to use literal format
    specifiers, unfortunately.

 gio/gdbusaddress.c |    3 ++-
 gio/gdbusmessage.c |    9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
index c489591..6d56bfb 100644
--- a/gio/gdbusaddress.c
+++ b/gio/gdbusaddress.c
@@ -669,10 +669,11 @@ g_dbus_address_connect (const gchar   *address_entry,
 
           if (nonce_length != 16)
             {
+              /* G_GSIZE_FORMAT doesn't work with gettext, so we use %lu */
               g_set_error (error,
                            G_IO_ERROR,
                            G_IO_ERROR_INVALID_ARGUMENT,
-                           _("The nonce-file `%s' was %" G_GSIZE_FORMAT " bytes. Expected 16 bytes."),
+                           _("The nonce-file `%s' was %lu bytes. Expected 16 bytes."),
                            nonce_file,
                            nonce_length);
               g_free (nonce_contents);
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 0523d78..37c14d6 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -726,10 +726,11 @@ read_string (GMemoryInputStream    *mis,
         goto fail;
       if (num_read == 0)
         {
+          /* G_GSIZE_FORMAT doesn't work with gettext, so we use %lu */
           g_set_error (error,
                        G_IO_ERROR,
                        G_IO_ERROR_INVALID_ARGUMENT,
-                       _("Wanted to read %" G_GSIZE_FORMAT " bytes but got EOF"),
+                       _("Wanted to read %lu bytes but got EOF"),
                        to_read);
           goto fail;
         }
@@ -1012,10 +1013,11 @@ parse_value_from_blob (GMemoryInputStream    *mis,
 
           if (array_len > (2<<26))
             {
+              /* G_GUINT32_FORMAT doesn't work with gettext, so use u */
               g_set_error (&local_error,
                            G_IO_ERROR,
                            G_IO_ERROR_INVALID_ARGUMENT,
-                           _("Encountered array of length %" G_GUINT32_FORMAT " bytes. Maximum length is 2<<26 bytes."),
+                           _("Encountered array of length %u bytes. Maximum length is 2<<26 bytes."),
                            array_len);
               goto fail;
             }
@@ -1494,10 +1496,11 @@ g_dbus_message_new_from_blob (guchar                *blob,
       /* no signature, this is only OK if the body is empty */
       if (message_body_len != 0)
         {
+          /* G_GUINT32_FORMAT doesn't work with gettext, just use %u */
           g_set_error (error,
                        G_IO_ERROR,
                        G_IO_ERROR_INVALID_ARGUMENT,
-                       _("No signature header in message but the message body is %" G_GUINT32_FORMAT " bytes"),
+                       _("No signature header in message but the message body is %u bytes"),
                        message_body_len);
           goto out;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]