]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
New xgettext option --copyright-holder.
authorBruno Haible <bruno@clisp.org>
Wed, 19 Dec 2001 19:20:29 +0000 (19:20 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 21:51:17 +0000 (23:51 +0200)
doc/ChangeLog
doc/xgettext.texi
m4/ChangeLog
m4/gettext.m4
po/ChangeLog
po/Makefile.in.in
po/Makevars
src/ChangeLog
src/xgettext.c
tests/ChangeLog
tests/xgettext-14

index bcb119f97420839c2f2772afb5207f159c5a656f..270880a0bb0cde0d61b6f1c666adf74b01ea4b2d 100644 (file)
@@ -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.
index 5bf260d9b0b456d19eb93505cf99b1e34f7d3af4..3d3c74915f8f99290f6114ed98e4eb49ab25ba11 100644 (file)
@@ -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}]
index 320cc00a4b424f53a7ea71031ac1182f67d951a7..dba7d91c5c073dc96cf3920d5abc21afc6ec23b2 100644 (file)
@@ -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.
index a1f79d9288960664c39da9660b8e7874791b6614..cfc89705a39977ba7d7ca11afcaa86930443b012 100644 (file)
@@ -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(
index 07033c4ac2daf9a97eb0a102fc200805c81acbdb..7ccbd0fcc07f87f3d7d19e5e3fae86944cf251e7 100644 (file)
@@ -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
index 7eeb6d5495fa538c044dd8258e2078ee3c197fdf..946ece287ff34a67446ca8b9f464bdf887200c9d 100644 (file)
@@ -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 )
index 0a2fd64aa066cbd14ac1129c2b02d6f5e71d7049..456f3f0bcbef872a6acc2c29846c50de0e388233 100644 (file)
@@ -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.
index dff025afbbde98640b1723107c7dcea3f0b83209..fb5d3a7d2d3e0efd0b57db297c96a35bcbba0aba 100644 (file)
@@ -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>.
index e20fae10961e83b4a71f3ce4a97fa692312ce852..21ada5aa00eeb667169468985cd0149ffcfaa6c8 100644 (file)
@@ -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;
index 3418a8197659bb0d0ce2a1ccfa0ab05744f437f3..958d8c898cd41393010868a1740815d9f3c6eb52 100644 (file)
@@ -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.
index b8eefd399c8065a5fc1f6283185692694786e826..1beca5884d9d45303f898c1ce7283d89828bcf4a 100755 (executable)
@@ -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