]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid attaching "previous msgid" information to untranslated messages.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Feb 2008 23:36:14 +0000 (23:36 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:37 +0000 (12:15 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/msgmerge.c

index 61624e2d90942ee82f0c37d05da071aec88ec51e..1fc68d86e0d685afdd42a4386f7e0e3d58062070 100644 (file)
@@ -1,3 +1,10 @@
+2008-02-04  Bruno Haible  <bruno@clisp.org>
+
+       * msgmerge.c (match_domain): Remove the prev_msgid fields also from
+       the untranslated messages.
+       Reported by Yukiko Bando <ybando@k6.dion.ne.jp> via
+       Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>.
+
 2008-02-04  Bruno Haible  <bruno@clisp.org>
 
        * msgmerge.c (message_merge): Store the prev_msgid field also if the
index 7edef4106de5fa92fa2bad63e736c9ad07a3cd5a..2ed6afccd2a21bde7efaae1f0f96ca7271aaf2b5 100644 (file)
@@ -1172,9 +1172,9 @@ message_merge (message_ty *def, message_ty *ref, bool force_fuzzy,
      Do so only when --previous is specified, for backward compatibility.
      Since the "previous msgid" represents the original msgid that led to
      the current msgstr,
-       - we can omit it if the resulting message is not fuzzy (but do this
-         in a later pass, since result->is_fuzzy is not finalized at this
-         point),
+       - we can omit it if the resulting message is not fuzzy or is
+         untranslated (but do this in a later pass, since result->is_fuzzy
+         is not finalized at this point),
        - otherwise, if the corresponding message from the definition file
          was translated (not fuzzy), we use that message's msgid,
        - otherwise, we use that message's prev_msgid.  */
@@ -1496,13 +1496,14 @@ this message should not define plural forms"));
       }
   }
 
-  /* Now that mp->is_fuzzy is finalized for all messages, remove the previous
-     msgid information from all messages that are not fuzzy.  */
+  /* Now that mp->is_fuzzy is finalized for all messages, remove the
+     "previous msgid" information from all messages that are not fuzzy or
+     are untranslated.  */
   for (j = 0; j < resultmlp->nitems; j++)
     {
       message_ty *mp = resultmlp->item[j];
 
-      if (!mp->is_fuzzy)
+      if (!mp->is_fuzzy || mp->msgstr[0] == '\0')
        {
          mp->prev_msgctxt = NULL;
          mp->prev_msgid = NULL;