[Gnucash-changes] r13888 - gnucash/trunk - Fix retrieval of reconcile abbreviation if the translators erroneously

Christian Stimming cstim at cvs.gnucash.org
Sun Apr 30 06:32:35 EDT 2006


Author: cstim
Date: 2006-04-30 06:32:34 -0400 (Sun, 30 Apr 2006)
New Revision: 13888
Trac: http://svn.gnucash.org/trac/changeset/13888

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/app-utils/gnc-ui-util.c
Log:
Fix retrieval of reconcile abbreviation if the translators erroneously
did not use the same string length as the english string. Bug #339722.




Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-04-30 03:52:05 UTC (rev 13887)
+++ gnucash/trunk/ChangeLog	2006-04-30 10:32:34 UTC (rev 13888)
@@ -1,3 +1,9 @@
+2006-04-30  Christian Stimming  <stimming at tuhh.de>
+
+	* src/app-utils/gnc-ui-util.c: Fix retrieval of reconcile
+	abbreviation if the translators erroneously did not use the same
+	string length as the english string. Bug #339722.
+
 2006-04-29  David Hampton  <hampton at employees.org>
 
 	* src/engine/gnc-lot.c:

Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c	2006-04-30 03:52:05 UTC (rev 13887)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c	2006-04-30 10:32:34 UTC (rev 13888)
@@ -483,6 +483,20 @@
 }
 
 
+static const char *
+string_after_colon (const char *msgstr)
+{
+  const char *string_at_colon;
+  g_assert(msgstr);
+  string_at_colon = strchr(msgstr, ':');
+  if (string_at_colon)
+    return string_at_colon + 1;
+  else
+    /* No colon found; we assume the translation contains only the
+       part after the colon, similar to the disambiguation prefixes */
+    return msgstr;
+}
+
 /********************************************************************\
  * gnc_get_reconcile_str                                            *
  *   return the i18n'd string for the given reconciled flag         *
@@ -497,16 +511,16 @@
   {
     /* Translators: For the following strings, the single letters
        after the colon are abbreviations of the word before the
-       colon. Please only translate the letter *after* the colon. */
-    case NREC: return _("not cleared:n") + 12;
-      /* Please only translate the letter *after* the colon. */
-    case CREC: return _("cleared:c") + 8;
-      /* Please only translate the letter *after* the colon. */
-    case YREC: return _("reconciled:y") + 11;
-      /* Please only translate the letter *after* the colon. */
-    case FREC: return _("frozen:f") + 7;
-      /* Please only translate the letter *after* the colon. */
-    case VREC: return _("void:v") + 5;
+       colon. You should only translate the letter *after* the colon. */
+    case NREC: return string_after_colon(_("not cleared:n"));
+      /* Translators: Please only translate the letter *after* the colon. */
+    case CREC: return string_after_colon(_("cleared:c"));
+      /* Translators: Please only translate the letter *after* the colon. */
+    case YREC: return string_after_colon(_("reconciled:y"));
+      /* Translators: Please only translate the letter *after* the colon. */
+    case FREC: return string_after_colon(_("frozen:f"));
+      /* Translators: Please only translate the letter *after* the colon. */
+    case VREC: return string_after_colon(_("void:v"));
     default:
       PERR("Bad reconciled flag\n");
       return NULL;



More information about the gnucash-changes mailing list