]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Obsolete messages now can carry extracted comments and file positions
authorBruno Haible <bruno@clisp.org>
Tue, 4 Oct 2005 11:05:28 +0000 (11:05 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:52 +0000 (12:12 +0200)
- but msgmerge doesn't set them.

gettext-tools/src/ChangeLog
gettext-tools/src/msgmerge.c
gettext-tools/src/write-po.c
gettext-tools/tests/ChangeLog
gettext-tools/tests/msgattrib-10

index eb744dfda3122f10afde5c38a47d275880f80432..0a806f0e1e36cc2dc17e44aab31c0253b635db14 100644 (file)
@@ -1,3 +1,12 @@
+2005-10-01  Bruno Haible  <bruno@clisp.org>
+
+       Change msgattrib to no longer remove extracted comments and file
+       positions when marking messages obsolete.
+       * msgmerge.c (merge): When marking a message obsolete, remove the
+       extracted comments and file positions.
+       * write-po.c (message_print_obsolete): Also print the extracted
+       comments and file positions.
+
 2005-09-25  Bruno Haible  <bruno@clisp.org>
 
        Support for Python source encodings (PEP 0263).
index e325bcdd11e715ed0efccb33837d346028c74796..b114e4122cefea110dd5b81f173e63f3aa08af67 100644 (file)
@@ -1240,6 +1240,24 @@ merge (const char *fn1, const char *fn2, msgdomain_list_ty **defp)
              message_ty *mp;
 
              mp = message_copy (defmsg);
+             /* Clear the extracted comments.  */
+             if (mp->comment_dot != NULL)
+               {
+                 string_list_free (mp->comment_dot);
+                 mp->comment_dot = NULL;
+               }
+             /* Clear the file position comments.  */
+             if (mp->filepos != NULL)
+               {
+                 size_t i;
+
+                 for (i = 0; i < mp->filepos_count; i++)
+                   free ((char *) mp->filepos[i].file_name);
+                 mp->filepos_count = 0;
+                 free (mp->filepos);
+                 mp->filepos = NULL;
+               }
+             /* Mark as obsolete.   */
              mp->obsolete = true;
 
              message_list_append (msgdomain_list_sublist (result, domain, true),
index b1a0b56a0168462c2c9c287a8846bf328f70966b..12250b7633c3b7d117d53b7a62ba1b0094154dce 100644 (file)
@@ -905,6 +905,12 @@ message_print_obsolete (const message_ty *mp, FILE *fp, const char *charset,
   /* Print translator comment if available.  */
   message_print_comment (mp, fp);
 
+  /* Print xgettext extracted comments (normally empty).  */
+  message_print_comment_dot (mp, fp);
+
+  /* Print the file position comments (normally empty).  */
+  message_print_comment_filepos (mp, fp, uniforum, page_width);
+
   /* Print flag information in special comment.  */
   if (mp->is_fuzzy)
     {
index 96470b5749ed532a4feff185bd06441c7b74adff..d3d2a307edc49face0ae07c59463cd2d0631aefd 100644 (file)
@@ -1,3 +1,7 @@
+2005-10-01  Bruno Haible  <bruno@clisp.org>
+
+       * msgattrib-10: Update for changed behaviour of msgattrib.
+
 2005-09-25  Bruno Haible  <bruno@clisp.org>
 
        * xgettext-python-3: New file.
index 766523129d22c2acf4c1cf872bdb986576699f2b..60949365c8ac7db71a7271bf967ada13f80a2004 100755 (executable)
@@ -1,8 +1,7 @@
 #! /bin/sh
 
 # Test --set-obsolete option. Note that the output routines drop untranslated
-# obsolete messages. Note also that obsolete messages don't have file locations
-# attached.
+# obsolete messages.
 
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
@@ -73,10 +72,12 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+#: married-men:4
 #, fuzzy
 #~ msgid "The world is full of married men"
 #~ msgstr "So viele verheiratete Männer"
 
+#: married-men:5
 #~ msgid "with wives who never understand"
 #~ msgstr "und ihre Frauen verstehen sie nicht"