From: Bruno Haible Date: Tue, 4 Oct 2005 11:05:28 +0000 (+0000) Subject: Obsolete messages now can carry extracted comments and file positions X-Git-Tag: v0.15~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0363f750348a37b37c286cbd11221aa02f355eef;p=thirdparty%2Fgettext.git Obsolete messages now can carry extracted comments and file positions - but msgmerge doesn't set them. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index eb744dfda..0a806f0e1 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,12 @@ +2005-10-01 Bruno Haible + + 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 Support for Python source encodings (PEP 0263). diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index e325bcdd1..b114e4122 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -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), diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c index b1a0b56a0..12250b763 100644 --- a/gettext-tools/src/write-po.c +++ b/gettext-tools/src/write-po.c @@ -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) { diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 96470b574..d3d2a307e 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,7 @@ +2005-10-01 Bruno Haible + + * msgattrib-10: Update for changed behaviour of msgattrib. + 2005-09-25 Bruno Haible * xgettext-python-3: New file. diff --git a/gettext-tools/tests/msgattrib-10 b/gettext-tools/tests/msgattrib-10 index 766523129..60949365c 100755 --- a/gettext-tools/tests/msgattrib-10 +++ b/gettext-tools/tests/msgattrib-10 @@ -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"