use gnulib's proper_name_utf8 function, but *not* proper_name
authorJim Meyering <meyering@redhat.com>
Mon, 19 May 2008 14:14:13 +0000 (16:14 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 26 May 2008 06:37:08 +0000 (08:37 +0200)
* bootstrap.conf (gnulib_modules): Add propername.
(XGETTEXT_OPTIONS): Add options to tell xgettext about the functions.
* src/cat.c, src/cp.c, src/df.c, src/du.c, src/split.c:
Mark Torbjörn Granlund's name.
* src/ptx.c: Mark François Pinard's name.
Use "TRANSLATORS:" comment marker, rather than "Note to translators:".
* src/system.h: Include propername.h.
(proper_name): Define away.
* src/Makefile.am (cat_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD):
Initialize, so we can...
(cat_LDADD, cp_LDADD, df_LDADD, du_LDADD, ptx_LDADD, split_LDADD):
...Use "+=" to append $(LIBICONV) for each program that uses
proper_name_utf8.

bootstrap.conf
src/Makefile.am
src/cat.c
src/cp.c
src/df.c
src/du.c
src/ptx.c
src/split.c
src/system.h

index f74f759..7b5be83 100644 (file)
@@ -67,7 +67,11 @@ gnulib_modules="
        memrchr mgetgroups
        mkancesdirs mkdir mkdir-p mkstemp mktime modechange
        mountlist mpsort obstack pathmax perl physmem
-       posix-shell posixtm posixver putenv
+       posix-shell
+       posixtm
+       posixver
+       propername
+       putenv
        quote quotearg raise readlink areadlink-with-size
        randint
        randperm
@@ -118,6 +122,14 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
  --flag=xprintf:1:c-format\\\
 '
 
+# Append these, since we use the propername module.
+see_manual='"This is a proper name. See the gettext manual, section Names."'
+see_manual=\'"$see_manual"\'
+XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
+ --keyword=proper_name:1,'"$see_manual"'\\\
+ --keyword=proper_name_utf8:1,'"$see_manual"'\\\
+'
+
 # If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]"
 # appears in configure.ac, exclude some unnecessary files.
 # Without grep's -E option (not portable enough, pre-configure),
index 668e178..8d1cfcf 100644 (file)
@@ -75,6 +75,12 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib
 # replacement functions defined in libcoreutils.a.
 LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a
 
+cat_LDADD = $(LDADD)
+df_LDADD = $(LDADD)
+du_LDADD = $(LDADD)
+ptx_LDADD = $(LDADD)
+split_LDADD = $(LDADD)
+
 # for eaccess in lib/euidaccess.c.
 chcon_LDADD = $(LDADD) $(LIB_SELINUX)
 cp_LDADD = $(LDADD) $(LIB_EACCESS) $(LIB_SELINUX)
@@ -137,6 +143,14 @@ ginstall_LDADD += $(LIB_ACL)
 
 stat_LDADD = $(LDADD) $(LIB_SELINUX)
 
+# Append $(LIBICONV) to each program that uses proper_name_utf8.
+cat_LDADD += $(LIBICONV)
+cp_LDADD += $(LIBICONV)
+df_LDADD += $(LIBICONV)
+du_LDADD += $(LIBICONV)
+ptx_LDADD += $(LIBICONV)
+split_LDADD += $(LIBICONV)
+
 $(PROGRAMS): ../lib/libcoreutils.a
 
 # Get the release year from ../lib/version-etc.c.
index d121445..b0bed28 100644 (file)
--- a/src/cat.c
+++ b/src/cat.c
@@ -1,5 +1,5 @@
 /* cat -- concatenate files and print on the standard output.
-   Copyright (C) 88, 90, 91, 1995-2007 Free Software Foundation, Inc.
+   Copyright (C) 88, 90, 91, 1995-2008 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
@@ -43,7 +43,9 @@
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "cat"
 
-#define AUTHORS "Torbjorn Granlund", "Richard M. Stallman"
+#define AUTHORS \
+  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+    "Richard M. Stallman"
 
 /* Undefine, to avoid warning about redefinition on some systems.  */
 #undef max
index 3f95871..ee5379a 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -52,7 +52,9 @@
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "cp"
 
-#define AUTHORS "Torbjorn Granlund", "David MacKenzie", "Jim Meyering"
+#define AUTHORS \
+  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+    "David MacKenzie", "Jim Meyering"
 
 /* Used by do_copy, make_dir_parents_private, and re_protect
    to keep a list of leading directories whose protections
index f0fdcd7..e8162f6 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -1,5 +1,5 @@
 /* df - summarize free disk space
-   Copyright (C) 91, 1995-2007 Free Software Foundation, Inc.
+   Copyright (C) 91, 1995-2008 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
@@ -38,7 +38,8 @@
 #define PROGRAM_NAME "df"
 
 #define AUTHORS \
-  "Torbjorn Granlund", "David MacKenzie", "Paul Eggert"
+  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+    "David MacKenzie", "Paul Eggert"
 
 /* Name this program was run with. */
 char *program_name;
index 55aa1fe..1c4a736 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -50,7 +50,8 @@ extern bool fts_debug;
 #define PROGRAM_NAME "du"
 
 #define AUTHORS \
-  "Torbjorn Granlund", "David MacKenzie, Paul Eggert", "Jim Meyering"
+  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+  "David MacKenzie, Paul Eggert", "Jim Meyering"
 
 #if DU_DEBUG
 # define FTS_CROSS_CHECK(Fts) fts_cross_check (Fts)
index 8f7ae95..174b347 100644 (file)
--- a/src/ptx.c
+++ b/src/ptx.c
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "ptx"
 
-/* Note to translator: Please translate "F. Pinard" to "François
-   Pinard" if "ç" (c-with-cedilla) is available in the
-   translation's character set and encoding.  */
-#define AUTHORS _("F. Pinard")
+/* TRANSLATORS: Please translate "F. Pinard" to "François Pinard"
+   if "ç" (c-with-cedilla) is available in the translation's character
+   set and encoding.  */
+#define AUTHORS proper_name_utf8 ("F. Pinard", "Fran\xc3\xa7ois Pinard")
 
 /* Number of possible characters in a byte.  */
 #define CHAR_SET_SIZE 256
index f84d40e..d78b506 100644 (file)
@@ -40,7 +40,9 @@
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "split"
 
-#define AUTHORS "Torbjorn Granlund", "Richard M. Stallman"
+#define AUTHORS \
+  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+    "Richard M. Stallman"
 
 #define DEFAULT_SUFFIX_LENGTH 2
 
index b640c01..f7c689f 100644 (file)
@@ -454,6 +454,13 @@ enum
 #include "closein.h"
 #include "closeout.h"
 #include "version-etc.h"
+#include "propername.h"
+/* Define away proper_name (leaving proper_name_utf8, which affects far
+   fewer programs), since it's not worth the cost of adding ~17KB to
+   the x86_64 text size of every single program.  This avoids a 40%
+   (almost ~2MB) increase in the on-disk space utilization for the set
+   of the 100 binaries. */
+#define proper_name(x) (x)
 
 #define case_GETOPT_VERSION_CHAR(Program_name, Authors)                        \
   case GETOPT_VERSION_CHAR:                                            \