From 704d0bb297cff6fc53beca48ccc2cfd061f0bf5e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 1 Mar 2024 11:57:50 +0000 Subject: [PATCH] gfileutils: Use g_format_size() for another translatable string As with commit a3c2691c235fa0978167ffba095631d41043be9a, another instance of the same pattern was missed. Signed-off-by: Philip Withnall Fixes: #3271 --- glib/gfileutils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 165e40c57..2801777e4 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -818,14 +818,19 @@ get_contents_regfile (const gchar *filename, if (buf == NULL) { + char *display_size = g_format_size_full (alloc_size, G_FORMAT_SIZE_LONG_FORMAT); display_filename = g_filename_display_name (filename); g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM, - g_dngettext (GETTEXT_PACKAGE, "Could not allocate %" G_GSIZE_MODIFIER "u byte to read file “%s”", "Could not allocate %" G_GSIZE_MODIFIER "u bytes to read file “%s”", alloc_size), - alloc_size, + /* Translators: the first %s contains the file size + * (already formatted with units), and the second %s + * contains the file name */ + _("Could not allocate %s to read file “%s”"), + display_size, display_filename); g_free (display_filename); + g_free (display_size); goto error; }