summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2022-08-12 09:34:56 +0200
committerOndrej Holy <oholy@redhat.com>2022-08-15 06:17:10 +0000
commita9e4038f2abbc082c056e3a91d11e38f16659a73 (patch)
tree09b3d94e440185c33bdb5415d0bccc18810d3ba6
parentc867dbc73b3ec3e205a11a8862cee13e9a353de2 (diff)
downloadnautilus-a9e4038f2abbc082c056e3a91d11e38f16659a73.tar.gz
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
-rw-r--r--src/nautilus-file.c8
1 files changed, 5 insertions, 3 deletions
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);
}