[evolution-kolab] Bug #675907 - Plural forms
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] Bug #675907 - Plural forms
- Date: Tue, 29 May 2012 13:42:29 +0000 (UTC)
commit d8ba2dfb2a15897f2230d4bc2fa4815bbfeaff38
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue May 29 15:39:04 2012 +0200
Bug #675907 - Plural forms
* KolabMailMimeBuilder: use ngettext() for reporting
expected minimum number of Kolab mail MIME parts
* KolabMailSideCache: use ngettext() for reporting
expected vs. actual payload bytes read from cache
src/libekolab/kolab-mail-mime-builder.c | 21 ++++++++++++++++++++-
src/libekolab/kolab-mail-side-cache.c | 25 +++++++++++++++++++++++--
2 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/src/libekolab/kolab-mail-mime-builder.c b/src/libekolab/kolab-mail-mime-builder.c
index a5e0c10..b7e3122 100644
--- a/src/libekolab/kolab-mail-mime-builder.c
+++ b/src/libekolab/kolab-mail-mime-builder.c
@@ -247,10 +247,29 @@ kolab_mail_mime_builder_conv_new_from_camel (KolabMailMimeBuilder *self,
g_debug ("%s: number of parts: %i", __func__, nparts);
if (nparts < KOLAB_MAIL_MIME_PARTS_MIN) {
+ const gchar *errmsg = NULL;
+ /* Hint to translators:
+ *
+ * The minimum number of mime parts expected here
+ * is subject to the Kolab format specification.
+ * The Kolab2 format mandates a minimum number of
+ * two mime parts, the first being a descriptive
+ * text, the second being the Kolab XML mime part.
+ * More mime parts may follow (e.g. attachments).
+ * Unless the Kolab format specification changes,
+ * KOLAB_MAIL_MIME_PARTS_MIN will therefore be 2.
+ *
+ * The singular form of this message will never
+ * be displayed.
+ */
+ /* xgettext: range: 2..2 */
+ errmsg = ngettext ("Mail message does not have the expected minimum of %i mime part, ignoring",
+ "Mail message does not have the expected minimum of %i mime parts, ignoring",
+ KOLAB_MAIL_MIME_PARTS_MIN);
g_set_error (err,
KOLAB_BACKEND_ERROR,
KOLAB_BACKEND_ERROR_DATATYPE_KOLAB,
- _("Mail message does not have the expected minimum of %i mime parts, ignoring"),
+ errmsg,
KOLAB_MAIL_MIME_PARTS_MIN);
return NULL;
}
diff --git a/src/libekolab/kolab-mail-side-cache.c b/src/libekolab/kolab-mail-side-cache.c
index 4ebcf8a..445535d 100644
--- a/src/libekolab/kolab-mail-side-cache.c
+++ b/src/libekolab/kolab-mail-side-cache.c
@@ -308,11 +308,32 @@ kolab_mail_side_cache_sql_query_object (KolabUtilSqliteDb *kdb,
nbytes = (guint) sqlite3_column_bytes(sql_stmt,
KOLAB_CONV_MAIL_SQLCOL_FIELD_DATA);
if (mpart->length != nbytes) {
+ gchar *errmsg_0 = NULL;
+ const gchar *errmsg_1 = NULL;
+ const gchar *errmsg_2 = NULL;
+ /* Hint to translators:
+ *
+ * These error messages truly comprise one sentence
+ * with two plural forms. Since ngettext() cannot handle
+ * such, I've decided to break it up into three (though
+ * this can also be problematic when translating).
+ *
+ * Both bytecounts are never expected to be one or less.
+ */
+ errmsg_0 = g_strdup_printf (_("Internal inconsistency detected: Invalid cache object, UID '%s', Folder '%s'."),
+ uid, foldername);
+ errmsg_1 = ngettext ("Expected payload size is %i byte.",
+ "Expected payload size is %i bytes.",
+ nbytes);
+ errmsg_2 = ngettext ("Actual payload size is %i byte.",
+ "Actual payload size is %i bytes.",
+ mpart->length);
g_set_error (&tmp_err,
KOLAB_UTIL_ERROR,
KOLAB_UTIL_ERROR_SQLITE_DB,
- _("Internal inconsistency detected: Invalid cache object has %i payload bytes, expected %i bytes, UID '%s', Folder '%s'"),
- mpart->length, nbytes, uid, foldername);
+ "%s %s %s",
+ errmsg_0, errmsg_1, errmsg_2);
+ g_free (errmsg_0);
break;
}
mpart->name = g_strdup ((gchar *) sqlite3_column_text (sql_stmt,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]