diff options
author | Bruno Haible <bruno@clisp.org> | 2001-12-19 19:20:29 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-21 23:51:17 +0200 |
commit | 60836b622d468e882787479dca1b1b7d61f83022 (patch) | |
tree | e31a0acc78f0f7618759c7d69c0fd7581f923113 | |
parent | 24924e652a8d58279abee8c11476550e741ceda3 (diff) | |
download | external_gettext-60836b622d468e882787479dca1b1b7d61f83022.zip external_gettext-60836b622d468e882787479dca1b1b7d61f83022.tar.gz external_gettext-60836b622d468e882787479dca1b1b7d61f83022.tar.bz2 |
New xgettext option --copyright-holder.
-rw-r--r-- | doc/ChangeLog | 4 | ||||
-rw-r--r-- | doc/xgettext.texi | 17 | ||||
-rw-r--r-- | m4/ChangeLog | 5 | ||||
-rw-r--r-- | m4/gettext.m4 | 6 | ||||
-rw-r--r-- | po/ChangeLog | 6 | ||||
-rw-r--r-- | po/Makefile.in.in | 3 | ||||
-rw-r--r-- | po/Makevars | 7 | ||||
-rw-r--r-- | src/ChangeLog | 11 | ||||
-rw-r--r-- | src/xgettext.c | 31 | ||||
-rw-r--r-- | tests/ChangeLog | 4 | ||||
-rwxr-xr-x | tests/xgettext-14 | 1 |
11 files changed, 79 insertions, 16 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index bcb119f..270880a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2001-12-12 Bruno Haible <bruno@clisp.org> + + * xgettext.texi: Document option --copyright-holder. + 2001-12-17 Bruno Haible <bruno@clisp.org> * msggrep.texi: Document that --location arguments may be wildcards. diff --git a/doc/xgettext.texi b/doc/xgettext.texi index 5bf260d..3d3c749 100644 --- a/doc/xgettext.texi +++ b/doc/xgettext.texi @@ -177,9 +177,22 @@ of variance for generated @code{.gmo} files. With @code{--omit-header}, two invocations of @code{xgettext} on the same files with the same options at different times are guaranteed to produce the same results. +@item --copyright-holder=@var{string} +Set the copyright holder in the output. Translators are expected to transfer +the copyright for their translations, so that package maintainers can +distribute them without legal risk. If @var{string} is empty, the output +files are marked as being in the public domain; in this case, the translators +are expected to disclaim their copyright, again so that package maintainers +can distribute them without legal risk. + +The default value for @var{string} is the Free Software Foundation, Inc. +This is recommended also for packages outside the GNU project, because the +FSF is a well trusted organization. + @item --foreign-user -Omit FSF copyright in output. This can be useful for translators -outside the GNU project. +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 -m [@var{string}] @itemx --msgstr-prefix[=@var{string}] diff --git a/m4/ChangeLog b/m4/ChangeLog index 320cc00..dba7d91 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2001-12-12 Bruno Haible <bruno@clisp.org> + + * gettext.m4 (AM_PO_SUBDIRS): Reject xgettext versions that don't + support the --copyright-holder option. + 2001-12-17 Bruno Haible <bruno@clisp.org> * fnmatch.m4: New file, inspired by autoconf-2.13 and autoconf-2.52. diff --git a/m4/gettext.m4 b/m4/gettext.m4 index a1f79d9..cfc8970 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -251,9 +251,9 @@ AC_DEFUN([AM_PO_SUBDIRS], [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - dnl Search for GNU xgettext in the PATH. + dnl Search for GNU xgettext 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1], :) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, @@ -278,7 +278,7 @@ 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 /dev/null >/dev/null 2>&1; then + if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1; then : ; else AC_MSG_RESULT( diff --git a/po/ChangeLog b/po/ChangeLog index 07033c4..7ccbd0f 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,9 @@ +2001-12-12 Bruno Haible <bruno@clisp.org> + + * Makevars (COPYRIGHT_HOLDER): New variable. + * Makefile.in.in ($(DOMAIN).pot): Pass --copyright-holder option to + xgettext. + 2001-12-18 Bruno Haible <bruno@clisp.org> * sl.po: Update from diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 7eeb6d5..946ece2 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -79,7 +79,8 @@ all-no: $(srcdir)/$(DOMAIN).pot: $(POTFILES) $(srcdir)/POTFILES.in $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ + --files-from=$(srcdir)/POTFILES.in + --copyright-holder='$(COPYRIGHT_HOLDER)' \ && test ! -f $(DOMAIN).po \ || ( rm -f $(srcdir)/$(DOMAIN).pot \ && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot ) diff --git a/po/Makevars b/po/Makevars index 0a2fd64..456f3f0 100644 --- a/po/Makevars +++ b/po/Makevars @@ -9,3 +9,10 @@ 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. Translators are expected to transfer the copyright +# for their translations to this person or entity. 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. diff --git a/src/ChangeLog b/src/ChangeLog index dff025a..fb5d3a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2001-12-12 Bruno Haible <bruno@clisp.org> + + * xgettext.c: Include <limits.h>. + (copyright_holder): New variable. + (foreign_user): Remove variable. + (long_options): Add --copyright-holder option. + (main): Implement --copyright-holder option. + (usage): Document --copyright-holder option. + (construct_header): Use the copyright_holder variable. If it is + empty, add a "public domain" comment. + 2001-12-17 Bruno Haible <bruno@clisp.org> * msggrep.c: Include <fnmatch.h>. diff --git a/src/xgettext.c b/src/xgettext.c index e20fae1..21ada5a 100644 --- a/src/xgettext.c +++ b/src/xgettext.c @@ -31,6 +31,7 @@ #include <stdlib.h> #include <stdbool.h> #include <locale.h> +#include <limits.h> #ifdef HAVE_UNISTD_H # include <unistd.h> @@ -95,9 +96,8 @@ message_list_ty *exclude; /* Force output of PO file even if empty. */ static int force_po; -/* If nonzero a non GNU related user wants to use this. Omit the FSF - copyright in the output. */ -static int foreign_user; +/* Copyright holder of the output file and the translations. */ +static const char *copyright_holder = "THE PACKAGE'S COPYRIGHT HOLDER"; /* String used as prefix for msgstr. */ static const char *msgstr_prefix; @@ -117,6 +117,7 @@ static const struct option long_options[] = { "add-comments", optional_argument, NULL, 'c' }, { "add-location", no_argument, &line_comment, 1 }, { "c++", no_argument, NULL, 'C' }, + { "copyright-holder", required_argument, NULL, CHAR_MAX + 1 }, { "debug", no_argument, &do_debug, 1 }, { "default-domain", required_argument, NULL, 'd' }, { "directory", required_argument, NULL, 'D' }, @@ -125,7 +126,7 @@ static const struct option long_options[] = { "extract-all", no_argument, NULL, 'a' }, { "files-from", required_argument, NULL, 'f' }, { "force-po", no_argument, &force_po, 1 }, - { "foreign-user", no_argument, &foreign_user, 1 }, + { "foreign-user", no_argument, NULL, CHAR_MAX + 2 }, { "help", no_argument, NULL, 'h' }, { "indent", no_argument, NULL, 'i' }, { "join-existing", no_argument, NULL, 'j' }, @@ -345,6 +346,12 @@ main (argc, argv) case 'x': read_exclusion_file (optarg); break; + case CHAR_MAX + 1: /* --copyright-holder */ + copyright_holder = optarg; + break; + case CHAR_MAX + 2: /* --foreign-user */ + copyright_holder = ""; + break; default: usage (EXIT_FAILURE); /* NOTREACHED */ @@ -582,6 +589,7 @@ Output details:\n\ -s, --sort-output generate sorted output\n\ -F, --sort-by-file sort output by file location\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\ -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\ @@ -1140,14 +1148,17 @@ Content-Transfer-Encoding: 8bit\n", mp = message_alloc ("", NULL, msgstr, strlen (msgstr) + 1, &pos); - if (foreign_user) - message_comment_append (mp, "\ + message_comment_append (mp, + copyright_holder[0] != '\0' + ? xasprintf ("\ SOME DESCRIPTIVE TITLE.\n\ -FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n"); - else - message_comment_append (mp, "\ +Copyright (C) YEAR %s\n\ +This file is distributed under the same license as the PACKAGE package. +FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n", + copyright_holder) + : "\ SOME DESCRIPTIVE TITLE.\n\ -Copyright (C) YEAR Free Software Foundation, Inc.\n\ +This file is put in the public domain.\n\ FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n"); mp->is_fuzzy = true; diff --git a/tests/ChangeLog b/tests/ChangeLog index 3418a81..958d8c8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2001-12-15 Bruno Haible <bruno@clisp.org> + + * xgettext-14: Change expected output. + 2001-12-18 Bruno Haible <bruno@clisp.org> * msgfilter-1: Avoid failure on Solaris, due to broken 'fold' program. diff --git a/tests/xgettext-14 b/tests/xgettext-14 index b8eefd3..1beca58 100755 --- a/tests/xgettext-14 +++ b/tests/xgettext-14 @@ -19,6 +19,7 @@ ${XGETTEXT} --output - --foreign-user --no-location -k_ xg-test14.in.c \ tmpfiles="$tmpfiles xg-test14.ok" cat <<EOF > xg-test14.ok # SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy |