From a9e4038f2abbc082c056e3a91d11e38f16659a73 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 12 Aug 2022 09:34:56 +0200 Subject: file: Drop string concatenation to make gettext work properly The commit 35647f2 fixed build on 32-bit architectures using the relevant format string, but gettext isn't able to extract the text now due to string concatenation. Let's use the format string outside of the `ngettext` function to fix the issue. Related: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/940 --- src/nautilus-file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nautilus-file.c') diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 2d6f58857..2807c85d9 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -6924,6 +6924,7 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file) { guint item_count; gboolean count_unreadable; + g_autofree char *size_str = NULL; if (file == NULL) { @@ -6946,10 +6947,11 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file) return NULL; } - return g_strdup_printf (ngettext ("%" G_GOFFSET_FORMAT " byte", - "%" G_GOFFSET_FORMAT " bytes", + size_str = g_strdup_printf ("%" G_GOFFSET_FORMAT, file->details->size); + return g_strdup_printf (ngettext ("%s byte", + "%s bytes", file->details->size), - file->details->size); + size_str); } -- cgit v1.2.1