diff options
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | gettext-runtime/m4/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-runtime/m4/gettext.m4 | 10 | ||||
-rw-r--r-- | gettext-runtime/po/ChangeLog | 10 | ||||
-rw-r--r-- | gettext-runtime/po/Makefile.in.in | 17 | ||||
-rw-r--r-- | gettext-runtime/po/Makevars | 16 | ||||
-rw-r--r-- | gettext-tools/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gettext-tools/doc/gettext.texi | 16 | ||||
-rw-r--r-- | gettext-tools/doc/xgettext.texi | 24 | ||||
-rw-r--r-- | gettext-tools/misc/ChangeLog | 6 | ||||
-rw-r--r-- | gettext-tools/misc/gettextize.in | 28 | ||||
-rw-r--r-- | gettext-tools/po/ChangeLog | 11 | ||||
-rw-r--r-- | gettext-tools/po/Makefile.in.in | 17 | ||||
-rw-r--r-- | gettext-tools/po/Makevars | 16 | ||||
-rw-r--r-- | gettext-tools/po/Makevars.template | 41 | ||||
-rw-r--r-- | gettext-tools/src/ChangeLog | 11 | ||||
-rw-r--r-- | gettext-tools/src/msgmerge.c | 61 | ||||
-rw-r--r-- | gettext-tools/src/xgettext.c | 23 |
18 files changed, 277 insertions, 45 deletions
@@ -7,6 +7,11 @@ Version 0.11.6 - October 2002 system that has users who desire to use internationalization. Whereas the 'gettext-tools' package is only for developers and translators. +* The po/Makevars file has a new field MSGID_BUGS_ADDRESS, which program + maintainers should fill in, to help feedback from the translators to the + program maintainers. + xgettext, accordingly, has a new option --msgid-bugs-address. + * xgettext now also supports Smalltalk and PHP. * A new C++ class, called gnu::autosprintf, makes it possible to use C format diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index cf4b062..42d6e4b 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,5 +1,10 @@ 2003-02-16 Bruno Haible <bruno@clisp.org> + * gettext.m4 (AM_PO_SUBDIRS): Require an xgettext that supports the + --msgid-bugs-address option. + +2003-02-16 Bruno Haible <bruno@clisp.org> + * gettext.m4 (AM_GNU_GETTEXT): Move INTLOBJS to backward compatibility section. diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4 index 1ac36a8..17bd132 100644 --- a/gettext-runtime/m4/gettext.m4 +++ b/gettext-runtime/m4/gettext.m4 @@ -366,12 +366,12 @@ AC_DEFUN([AM_PO_SUBDIRS], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - dnl Search for GNU xgettext 0.11 or newer in the PATH. + dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po @@ -401,8 +401,8 @@ AC_DEFUN([AM_PO_SUBDIRS], if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. - if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( diff --git a/gettext-runtime/po/ChangeLog b/gettext-runtime/po/ChangeLog index f756e51..e2afca1 100644 --- a/gettext-runtime/po/ChangeLog +++ b/gettext-runtime/po/ChangeLog @@ -1,3 +1,13 @@ +2003-02-16 Bruno Haible <bruno@clisp.org> + + * Makevars (MSGID_BUGS_ADDRESS): New variable. + * Makefile.in.in (DISTFILES.common): Remove Makevars. + (DISTFILES): Add Makevars here. + ($(DOMAIN).pot-update): Pass --msgid-bugs-address to xgettext. + (install-data): Install Makevars.template. Uninstall Makevars. + (uninstall-data): Uninstall Makevars.template. + (dist2): Distribute Makevars.template, in gettext-tools package only. + 2003-02-12 Bruno Haible <bruno@clisp.org> * POTFILES.in: New file. diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in index 1360f2c..fa15e7f 100644 --- a/gettext-runtime/po/Makefile.in.in +++ b/gettext-runtime/po/Makefile.in.in @@ -42,9 +42,9 @@ POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ -DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot stamp-po \ +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) @@ -101,7 +101,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ @@ -137,10 +138,13 @@ install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ - for file in $(DISTFILES.common); do \ + for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ else \ : ; \ fi @@ -237,7 +241,7 @@ uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ - for file in $(DISTFILES.common); do \ + for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ @@ -281,6 +285,9 @@ dist distdir: # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ diff --git a/gettext-runtime/po/Makevars b/gettext-runtime/po/Makevars index 8b09f53..5c118c5 100644 --- a/gettext-runtime/po/Makevars +++ b/gettext-runtime/po/Makevars @@ -20,6 +20,22 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/doc/ChangeLog b/gettext-tools/doc/ChangeLog index 4517026..3c3e0ab 100644 --- a/gettext-tools/doc/ChangeLog +++ b/gettext-tools/doc/ChangeLog @@ -1,5 +1,10 @@ 2003-02-16 Bruno Haible <bruno@clisp.org> + * gettext.texi (Header Entry): Document Report-Msgid-Bugs-To. + * xgettext.texi: Document --msgid-bugs-address option. + +2003-02-16 Bruno Haible <bruno@clisp.org> + * gettext.texi (Prioritizing messages): New section. 2003-02-16 Bruno Haible <bruno@clisp.org> diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index 29d06fc..40dba07 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -2514,6 +2514,22 @@ entry. You should fill in the following fields. @item Project-Id-Version This is the name and version of the package. +@item Report-Msgid-Bugs-To +This has already been filled in by @code{xgettext}. It contains an email +address or URL where you can report bugs in the untranslated strings: + +@itemize - +@item Strings which are not entire sentences, see the maintainer guidelines +in @ref{Preparing Strings}. +@item Strings which use unclear terms or require additional context to be +understood. +@item Strings which make invalid assumptions about notation of date, time or +money. +@item Pluralisation problems. +@item Incorrect English spelling. +@item Incorrect formatting. +@end itemize + @item POT-Creation-Date This has already been filled in by @code{xgettext}. diff --git a/gettext-tools/doc/xgettext.texi b/gettext-tools/doc/xgettext.texi index f4a0b7a..425672c 100644 --- a/gettext-tools/doc/xgettext.texi +++ b/gettext-tools/doc/xgettext.texi @@ -269,6 +269,30 @@ Omit FSF copyright in output. This option is equivalent to @samp{--copyright-holder=''}. It can be useful for packages outside the GNU project that want their translations to be in the public domain. +@item --msgid-bugs-address=@var{email@@address} +@opindex --msgid-bugs-address@r{, @code{xgettext} option} +Set the reporting address for msgid bugs. This is the email address or URL +to which the translators shall report bugs in the untranslated strings: + +@itemize - +@item Strings which are not entire sentences, see the maintainer guidelines +in @ref{Preparing Strings}. +@item Strings which use unclear terms or require additional context to be +understood. +@item Strings which make invalid assumptions about notation of date, time or +money. +@item Pluralisation problems. +@item Incorrect English spelling. +@item Incorrect formatting. +@end itemize + +It can be your email address, or a mailing list address where translators +can write to without being subscribed, or the URL of a web page through +which the translators can contact you. + +The default value is empty, which means that translators will be clueless! +Don't forget to specify this option. + @item -m [@var{string}] @itemx --msgstr-prefix[=@var{string}] @opindex -m@r{, @code{xgettext} option} diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index a6a984a..a232545 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -1,5 +1,11 @@ 2003-02-16 Bruno Haible <bruno@clisp.org> + * gettextize.in: Create po/Makevars.template from installed + po/Makevars.template, not from po/Makevars. + (func_version): Update copyright year. + +2003-02-16 Bruno Haible <bruno@clisp.org> + * po-compat.el: Add testing instructions. (po-find-file-coding-system-guts) [XEMACS]: Make it work again, after (car (nth i po-content-type-charset-alist)) changed from symbol diff --git a/gettext-tools/misc/gettextize.in b/gettext-tools/misc/gettextize.in index 5b2863d..46059a9 100644 --- a/gettext-tools/misc/gettextize.in +++ b/gettext-tools/misc/gettextize.in @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. +# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ Report bugs to <bug-gnu-gettext@gnu.org>." func_version () { echo "$progname (GNU $package) $version" - echo "Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. + echo "Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." echo "Written by" "Ulrich Drepper" @@ -509,24 +509,24 @@ for file in *; do Makefile.in.in) # Already handled above. ;; - Makevars) - func_linkorcopy $file "$gettext_dir/po/$file" po/$file.template - if test -f "$srcdir/po/$file"; then - sed -n -e 's/[ ]*\([A-Za-z0-9_]*\)[ ]*=.*/\1/p' < "$srcdir/po/$file" | LC_ALL=C sort > "$srcdir/po/$file.tmp1" - sed -n -e 's/[ ]*\([A-Za-z0-9_]*\)[ ]*=.*/\1/p' < "$srcdir/po/$file.template" | LC_ALL=C sort > "$srcdir/po/$file.tmp2" - missingvars=`LC_ALL=C comm -13 "$srcdir/po/$file.tmp1" "$srcdir/po/$file.tmp2"` - rm -f "$srcdir/po/$file.tmp1" "$srcdir/po/$file.tmp2" + Makevars.template) + func_linkorcopy Makevars.template "$gettext_dir/po/Makevars.template" po/Makevars.template + if test -f "$srcdir/po/Makevars"; then + sed -n -e 's/[ ]*\([A-Za-z0-9_]*\)[ ]*=.*/\1/p' < "$srcdir/po/Makevars" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp1" + sed -n -e 's/[ ]*\([A-Za-z0-9_]*\)[ ]*=.*/\1/p' < "$srcdir/po/Makevars.template" | LC_ALL=C sort > "$srcdir/po/Makevars.tmp2" + missingvars=`LC_ALL=C comm -13 "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2"` + rm -f "$srcdir/po/Makevars.tmp1" "$srcdir/po/Makevars.tmp2" if test -n "$missingvars"; then please="$please -Please update po/$file so that it defines all the variables mentioned -in po/$file.template. -You can then remove po/$file.template. +Please update po/Makevars so that it defines all the variables mentioned +in po/Makevars.template. +You can then remove po/Makevars.template. " fi else please="$please -Please create po/$file from the template in po/$file.template. -You can then remove po/$file.template. +Please create po/Makevars from the template in po/Makevars.template. +You can then remove po/Makevars.template. " fi ;; diff --git a/gettext-tools/po/ChangeLog b/gettext-tools/po/ChangeLog index de06c1e..5a929fc 100644 --- a/gettext-tools/po/ChangeLog +++ b/gettext-tools/po/ChangeLog @@ -1,3 +1,14 @@ +2003-02-16 Bruno Haible <bruno@clisp.org> + + * Makevars.template: New file. + * Makevars (MSGID_BUGS_ADDRESS): New variable. + * Makefile.in.in (DISTFILES.common): Remove Makevars. + (DISTFILES): Add Makevars here. + ($(DOMAIN).pot-update): Pass --msgid-bugs-address to xgettext. + (install-data): Install Makevars.template. Uninstall Makevars. + (uninstall-data): Uninstall Makevars.template. + (dist2): Distribute Makevars.template, in gettext-tools package only. + 2003-02-12 Bruno Haible <bruno@clisp.org> * POTFILES.in: Bring up to date. diff --git a/gettext-tools/po/Makefile.in.in b/gettext-tools/po/Makefile.in.in index 1360f2c..fa15e7f 100644 --- a/gettext-tools/po/Makefile.in.in +++ b/gettext-tools/po/Makefile.in.in @@ -42,9 +42,9 @@ POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ -DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ +DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot stamp-po \ +DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) @@ -101,7 +101,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ @@ -137,10 +138,13 @@ install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ - for file in $(DISTFILES.common); do \ + for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ else \ : ; \ fi @@ -237,7 +241,7 @@ uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ - for file in $(DISTFILES.common); do \ + for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ @@ -281,6 +285,9 @@ dist distdir: # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ diff --git a/gettext-tools/po/Makevars b/gettext-tools/po/Makevars index 8b09f53..5c118c5 100644 --- a/gettext-tools/po/Makevars +++ b/gettext-tools/po/Makevars @@ -20,6 +20,22 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/po/Makevars.template b/gettext-tools/po/Makevars.template new file mode 100644 index 0000000..32692ab --- /dev/null +++ b/gettext-tools/po/Makevars.template @@ -0,0 +1,41 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 01a2f72..5441e59 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,14 @@ +2003-02-16 Bruno Haible <bruno@clisp.org> + + * msgmerge.c (message_merge): Add support for Report-Msgid-Bugs-To + field. + * xgettext.c (msgid_bugs_address): New variable. + (long_options): Add option --msgid-bugs-address. + (main): Handle option --msgid-bugs-address. + (usage): Document option --msgid-bugs-address. + (construct_header): Add 'Report-Msgid-Bugs-To:' field. Warn if + msgid_bugs_address is empty. + 2003-02-15 Bruno Haible <bruno@clisp.org> * user-email.in: Add support for GNOME evolution, OpenOffice and diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index 22dbf53..87bd713 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -561,7 +561,7 @@ message_merge (message_ty *def, message_ty *ref) /* Take the msgstr from the definition. The msgstr of the reference is usually empty, as it was generated by xgettext. If we currently process the header entry we have to merge the msgstr by using the - POT-Creation-Date field from the reference. */ + Report-Msgid-Bugs-To and POT-Creation-Date fields from the reference. */ if (ref->msgid[0] == '\0') { /* Oh, oh. The header entry and we have something to fill in. */ @@ -572,24 +572,26 @@ message_merge (message_ty *def, message_ty *ref) } known_fields[] = { { "Project-Id-Version:", sizeof ("Project-Id-Version:") - 1 }, -#define PROJECT_ID 0 +#define PROJECT_ID 0 + { "Report-Msgid-Bugs-To:", sizeof ("Report-Msgid-Bugs-To:") - 1 }, +#define REPORT_MSGID_BUGS_TO 1 { "POT-Creation-Date:", sizeof ("POT-Creation-Date:") - 1 }, -#define POT_CREATION 1 +#define POT_CREATION_DATE 2 { "PO-Revision-Date:", sizeof ("PO-Revision-Date:") - 1 }, -#define PO_REVISION 2 +#define PO_REVISION_DATE 3 { "Last-Translator:", sizeof ("Last-Translator:") - 1 }, -#define LAST_TRANSLATOR 3 +#define LAST_TRANSLATOR 4 { "Language-Team:", sizeof ("Language-Team:") - 1 }, -#define LANGUAGE_TEAM 4 +#define LANGUAGE_TEAM 5 { "MIME-Version:", sizeof ("MIME-Version:") - 1 }, -#define MIME_VERSION 5 +#define MIME_VERSION 6 { "Content-Type:", sizeof ("Content-Type:") - 1 }, -#define CONTENT_TYPE 6 +#define CONTENT_TYPE 7 { "Content-Transfer-Encoding:", sizeof ("Content-Transfer-Encoding:") - 1 } -#define CONTENT_TRANSFER 7 +#define CONTENT_TRANSFER 8 }; -#define UNKNOWN 8 +#define UNKNOWN 9 struct { const char *string; @@ -657,6 +659,36 @@ message_merge (message_ty *def, message_ty *ref) } { + const char *msgid_bugs_ptr; + + msgid_bugs_ptr = strstr (ref->msgstr, "Report-Msgid-Bugs-To:"); + if (msgid_bugs_ptr != NULL) + { + size_t msgid_bugs_len; + const char *endp; + + msgid_bugs_ptr += sizeof ("Report-Msgid-Bugs-To:") - 1; + + endp = strchr (msgid_bugs_ptr, '\n'); + if (endp == NULL) + { + /* Add a trailing newline. */ + char *extended; + endp = strchr (msgid_bugs_ptr, '\0'); + msgid_bugs_len = (endp - msgid_bugs_ptr) + 1; + extended = (char *) alloca (msgid_bugs_len + 1); + stpcpy (stpcpy (extended, msgid_bugs_ptr), "\n"); + msgid_bugs_ptr = extended; + } + else + msgid_bugs_len = (endp - msgid_bugs_ptr) + 1; + + header_fields[REPORT_MSGID_BUGS_TO].string = msgid_bugs_ptr; + header_fields[REPORT_MSGID_BUGS_TO].len = msgid_bugs_len; + } + } + + { const char *pot_date_ptr; pot_date_ptr = strstr (ref->msgstr, "POT-Creation-Date:"); @@ -681,8 +713,8 @@ message_merge (message_ty *def, message_ty *ref) else pot_date_len = (endp - pot_date_ptr) + 1; - header_fields[POT_CREATION].string = pot_date_ptr; - header_fields[POT_CREATION].len = pot_date_len; + header_fields[POT_CREATION_DATE].string = pot_date_ptr; + header_fields[POT_CREATION_DATE].len = pot_date_len; } } @@ -702,8 +734,9 @@ message_merge (message_ty *def, message_ty *ref) header_fields[idx].string, header_fields[idx].len) IF_FILLED (PROJECT_ID); - IF_FILLED (POT_CREATION); - IF_FILLED (PO_REVISION); + IF_FILLED (REPORT_MSGID_BUGS_TO); + IF_FILLED (POT_CREATION_DATE); + IF_FILLED (PO_REVISION_DATE); IF_FILLED (LAST_TRANSLATOR); IF_FILLED (LANGUAGE_TEAM); IF_FILLED (MIME_VERSION); diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index fabbd06..74e0b14 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -102,6 +102,9 @@ static int force_po; /* Copyright holder of the output file and the translations. */ static const char *copyright_holder = "THE PACKAGE'S COPYRIGHT HOLDER"; +/* Email address or URL for reports of bugs in msgids. */ +static const char *msgid_bugs_address = ""; + /* String used as prefix for msgstr. */ static const char *msgstr_prefix; @@ -155,6 +158,7 @@ static const struct option long_options[] = { "keyword", optional_argument, NULL, 'k' }, { "keyword-substring", no_argument, NULL, 'K'}, { "language", required_argument, NULL, 'L' }, + { "msgid-bugs-address", required_argument, NULL, CHAR_MAX + 5 }, { "msgstr-prefix", optional_argument, NULL, 'm' }, { "msgstr-suffix", optional_argument, NULL, 'M' }, { "no-escape", no_argument, NULL, 'e' }, @@ -384,6 +388,9 @@ main (int argc, char *argv[]) case CHAR_MAX + 4: /* --no-wrap */ message_page_width_ignore (); break; + case CHAR_MAX + 5: /* --msgid-bugs-address */ + msgid_bugs_address = optarg; + break; default: usage (EXIT_FAILURE); /* NOTREACHED */ @@ -684,6 +691,7 @@ Output details:\n\ --omit-header don't write header with `msgid \"\"' entry\n\ --copyright-holder=STRING set copyright holder in output\n\ --foreign-user omit FSF copyright in output for foreign user\n\ + --msgid-bugs-address=EMAIL@ADDRESS set report address for msgid bugs\n\ -m, --msgstr-prefix[=STRING] use STRING or \"\" as prefix for msgstr entries\n\ -M, --msgstr-suffix[=STRING] use STRING or \"\" as suffix for msgstr entries\n\ ")); @@ -1024,7 +1032,8 @@ remember_a_message (message_list_ty *mlp, char *string, lex_pos_ty *pos) buffer[0] = '\0'; else sprintf (buffer, ":%ld", (long) pos->line_number); - multiline_warning (xasprintf ("%s%s: warning: ", pos->file_name, buffer), + multiline_warning (xasprintf (_("%s%s: warning: "), pos->file_name, + buffer), xstrdup (_("\ Empty msgid. It is reserved by GNU gettext:\n\ gettext(\"\") returns the header entry with\n\ @@ -1246,11 +1255,21 @@ construct_header () char *msgstr; static lex_pos_ty pos = { __FILE__, __LINE__, }; + if (msgid_bugs_address[0] == '\0') + multiline_warning (xasprintf (_("warning: ")), + xstrdup (_("\ +The option --msgid-bugs-address was not specified.\n\ +If you are using a `Makevars' file, please specify\n\ +the MSGID_BUGS_ADDRESS variable there; otherwise please\n\ +specify an --msgid-bugs-address command line option.\n\ +"))); + time (&now); timestring = po_strftime (&now); msgstr = xasprintf ("\ Project-Id-Version: PACKAGE VERSION\n\ +Report-Msgid-Bugs-To: %s\n\ POT-Creation-Date: %s\n\ PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n\ Last-Translator: FULL NAME <EMAIL@ADDRESS>\n\ @@ -1258,7 +1277,7 @@ Language-Team: LANGUAGE <LL@li.org>\n\ MIME-Version: 1.0\n\ Content-Type: text/plain; charset=CHARSET\n\ Content-Transfer-Encoding: 8bit\n", - timestring); + msgid_bugs_address, timestring); free (timestring); mp = message_alloc ("", NULL, msgstr, strlen (msgstr) + 1, &pos); |