[easytag] Avoid macro in translatable string, bug 705952
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Avoid macro in translatable string, bug 705952
- Date: Wed, 14 Aug 2013 08:05:07 +0000 (UTC)
commit 3fd5461eda337ef2dacca873e9608e5d393b8375
Author: David King <amigadave amigadave com>
Date: Wed Aug 14 09:02:53 2013 +0100
Avoid macro in translatable string, bug 705952
Avoid using G_GSIZE_FORMAT in a translatable string, as xgettext does
not extract such strings correctly:
http://savannah.gnu.org/bugs/index.php?19086
src/id3v24_tag.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/id3v24_tag.c b/src/id3v24_tag.c
index f706fda..af76b4d 100644
--- a/src/id3v24_tag.c
+++ b/src/id3v24_tag.c
@@ -1488,14 +1488,26 @@ etag_write_tags (const gchar *filename,
{
gchar *filename_utf8 = filename_to_display(filename);
gchar *basename_utf8 = g_path_get_basename(filename_utf8);
+ gchar *bytes_missing = g_strdup_printf ("%" G_GSIZE_FORMAT,
+ ctxsize - size_read);
+ /* Construct the string in this awkward way as xgettext does not
+ * support macros in extracted strings.
+ * https://bugzilla.gnome.org/show_bug.cgi?id=705952
+ */
Log_Print (LOG_ERROR,
- _("Cannot write tag of file '%s' (%" G_GSSIZE_FORMAT
- " bytes were read but %" G_GSIZE_FORMAT
- " bytes were expected)"),
- basename_utf8, size_read, ctxsize);
+ /* Translators: The first string is a filename, the
+ * second string is the number of bytes that were
+ * missing (not read for some reason) while reading from
+ * the file.
+ */
+ ngettext ("Cannot write tag of file '%s' (a byte was missing)",
+ "Cannot write tag of file ā%sā (%s bytes were missing)",
+ ctxsize - size_read),
+ basename_utf8, bytes_missing);
g_free(filename_utf8);
g_free(basename_utf8);
+ g_free (bytes_missing);
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]