[gimp] Bug 721215 - Preprocessor string concatenation and translation...



commit 254b86d4fa04bc52c2abf011844d257f24e208d8
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jan 1 16:32:27 2014 +0100

    Bug 721215 - Preprocessor string concatenation and translation...
    
    ...don't work together
    
    gimp_config_file_copy(): build the error format string separately and
    in a way that is parsable by xgettext.

 app/config/gimpconfig-file.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/app/config/gimpconfig-file.c b/app/config/gimpconfig-file.c
index c6c3fe7..20cf940 100644
--- a/app/config/gimpconfig-file.c
+++ b/app/config/gimpconfig-file.c
@@ -41,11 +41,11 @@
 
 
 gboolean
-gimp_config_file_copy (const gchar        *source,
-                       const gchar        *dest,
-                       const gchar        *old_options_pattern,
-                       GRegexEvalCallback  update_callback,
-                       GError      **error)
+gimp_config_file_copy (const gchar         *source,
+                       const gchar         *dest,
+                       const gchar         *old_options_pattern,
+                       GRegexEvalCallback   update_callback,
+                       GError             **error)
 {
   gchar        buffer[8192];
   FILE        *sfile;
@@ -106,13 +106,21 @@ gimp_config_file_copy (const gchar        *source,
             }
           else if (! feof (sfile))
             {
+              gchar format[256];
+
               /* We are in unlikely case where a single config line is
                * longer than the buffer!
                */
+
+              g_snprintf (format, sizeof (format),
+                          _("Error parsing '%%s': line longer than %s characters."),
+                          G_GINT64_FORMAT);
+
               g_set_error (error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_PARSE,
-                           _("Error parsing '%s': line longer than %"
-                             G_GINT64_FORMAT" characters."),
-                           gimp_filename_to_utf8 (source), (gint64) sizeof (buffer));
+                           format,
+                           gimp_filename_to_utf8 (source),
+                           (gint64) sizeof (buffer));
+
               fclose (sfile);
               fclose (dfile);
               g_regex_unref (old_options_regexp);


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