1 /* Localization of proper names. -*- coding: utf-8 -*-
2 Copyright (C) 2006, 2008-2018 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
22 Torbjörn Granlund (coreutils)
23 François Pinard (coreutils)
24 Danilo Šegan (gettext)
28 A non-ASCII name. This causes trouble in the --version output. The simple
29 "solution" unfortunately mutilates the name.
31 $ du --version | grep Granlund
32 Écrit par Torbjorn Granlund, David MacKenzie, Paul Eggert et Jim Meyering.
34 $ ptx --version | grep Pinard
37 What is desirable, is to print the full name if the output character set
38 allows it, and the ASCIIfied name only as a fallback.
40 $ recode-sr-latin --version
42 Written by Danilo Šegan and Bruno Haible.
44 $ LC_ALL=C recode-sr-latin --version
46 Written by Danilo Segan and Bruno Haible.
48 The 'propername' module does exactly this. Plus, for languages that use
49 a different writing system than the Latin alphabet, it allows a translator
50 to write the name using that different writing system. In that case the
51 output will look like this:
52 <translated name> (<original name in English>)
54 To use the 'propername' module requires three simple steps:
56 1) Add it to the list of gnulib modules to import,
58 2) Change the arguments of version_etc(),
61 to proper_name ("Paul Eggert")
63 from "Torbjorn Granlund"
64 to proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund")
67 to proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard")
69 (Optionally, here you can also add / * TRANSLATORS: ... * / comments
70 explaining how the name is written or pronounced.)
72 3) If you are using GNU gettext version 0.16.1 or older, in po/Makevars,
73 in the definition of the XGETTEXT_OPTIONS variable, add:
75 --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."'
76 --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."'
78 This specifies automatic comments for the translator. (Requires
79 xgettext >= 0.15. The double-quotes inside the quoted string are on
80 purpose: they are part of the --keyword argument syntax.)
91 /* Return the localization of NAME. NAME is written in ASCII. */
92 extern const char * proper_name (const char *name
) /* NOT attribute const */;
94 /* Return the localization of a name whose original writing is not ASCII.
95 NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
96 escape sequences. NAME_ASCII is a fallback written only with ASCII
98 extern const char * proper_name_utf8 (const char *name_ascii
,
99 const char *name_utf8
);
106 #endif /* _PROPERNAME_H */