Blame lib/propername.h

Packit Service fdd496
/* Localization of proper names.  -*- coding: utf-8 -*-
Packit Service fdd496
   Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
Packit Service fdd496
   Written by Bruno Haible <bruno@clisp.org>, 2006.
Packit Service fdd496
Packit Service fdd496
   This program is free software: you can redistribute it and/or modify
Packit Service fdd496
   it under the terms of the GNU General Public License as published by
Packit Service fdd496
   the Free Software Foundation; either version 3 of the License, or
Packit Service fdd496
   (at your option) any later version.
Packit Service fdd496
Packit Service fdd496
   This program is distributed in the hope that it will be useful,
Packit Service fdd496
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fdd496
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service fdd496
   GNU General Public License for more details.
Packit Service fdd496
Packit Service fdd496
   You should have received a copy of the GNU General Public License
Packit Service fdd496
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Service fdd496
Packit Service fdd496
/* INTRODUCTION
Packit Service fdd496
Packit Service fdd496
   What do
Packit Service fdd496
Packit Service fdd496
      Torbjörn Granlund    (coreutils)
Packit Service fdd496
      François Pinard      (coreutils)
Packit Service fdd496
      Danilo Šegan         (gettext)
Packit Service fdd496
Packit Service fdd496
   have in common?
Packit Service fdd496
Packit Service fdd496
   A non-ASCII name. This causes trouble in the --version output. The simple
Packit Service fdd496
   "solution" unfortunately mutilates the name.
Packit Service fdd496
Packit Service fdd496
     $ du --version | grep Granlund
Packit Service fdd496
     Écrit par Torbjorn Granlund, David MacKenzie, Paul Eggert et Jim Meyering.
Packit Service fdd496
Packit Service fdd496
     $ ptx --version | grep Pinard
Packit Service fdd496
     Écrit par F. Pinard.
Packit Service fdd496
Packit Service fdd496
   What is desirable, is to print the full name if the output character set
Packit Service fdd496
   allows it, and the ASCIIfied name only as a fallback.
Packit Service fdd496
Packit Service fdd496
     $ recode-sr-latin --version
Packit Service fdd496
     ...
Packit Service fdd496
     Written by Danilo Šegan and Bruno Haible.
Packit Service fdd496
Packit Service fdd496
     $ LC_ALL=C recode-sr-latin --version
Packit Service fdd496
     ...
Packit Service fdd496
     Written by Danilo Segan and Bruno Haible.
Packit Service fdd496
Packit Service fdd496
   The 'propername' module does exactly this. Plus, for languages that use
Packit Service fdd496
   a different writing system than the Latin alphabet, it allows a translator
Packit Service fdd496
   to write the name using that different writing system. In that case the
Packit Service fdd496
   output will look like this:
Packit Service fdd496
      <translated name> (<original name in English>)
Packit Service fdd496
Packit Service fdd496
   To use the 'propername' module requires three simple steps:
Packit Service fdd496
Packit Service fdd496
     1) Add it to the list of gnulib modules to import,
Packit Service fdd496
Packit Service fdd496
     2) Change the arguments of version_etc(),
Packit Service fdd496
Packit Service fdd496
          from "Paul Eggert"
Packit Service fdd496
          to   proper_name ("Paul Eggert")
Packit Service fdd496
Packit Service fdd496
          from "Torbjorn Granlund"
Packit Service fdd496
          to   proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund")
Packit Service fdd496
Packit Service fdd496
          from "F. Pinard"
Packit Service fdd496
          to   proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard")
Packit Service fdd496
Packit Service fdd496
        (Optionally, here you can also add / * TRANSLATORS: ... * / comments
Packit Service fdd496
        explaining how the name is written or pronounced.)
Packit Service fdd496
Packit Service fdd496
     3) If you are using GNU gettext version 0.16.1 or older, in po/Makevars,
Packit Service fdd496
        in the definition of the XGETTEXT_OPTIONS variable, add:
Packit Service fdd496
Packit Service fdd496
           --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."'
Packit Service fdd496
           --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."'
Packit Service fdd496
Packit Service fdd496
        This specifies automatic comments for the translator. (Requires
Packit Service fdd496
        xgettext >= 0.15. The double-quotes inside the quoted string are on
Packit Service fdd496
        purpose: they are part of the --keyword argument syntax.)
Packit Service fdd496
 */
Packit Service fdd496
Packit Service fdd496
#ifndef _PROPERNAME_H
Packit Service fdd496
#define _PROPERNAME_H
Packit Service fdd496
Packit Service fdd496
Packit Service fdd496
#ifdef __cplusplus
Packit Service fdd496
extern "C" {
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
/* Return the localization of NAME.  NAME is written in ASCII.  */
Packit Service fdd496
extern const char * proper_name (const char *name) /* NOT attribute const */;
Packit Service fdd496
Packit Service fdd496
/* Return the localization of a name whose original writing is not ASCII.
Packit Service fdd496
   NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
Packit Service fdd496
   escape sequences.  NAME_ASCII is a fallback written only with ASCII
Packit Service fdd496
   characters.  */
Packit Service fdd496
extern const char * proper_name_utf8 (const char *name_ascii,
Packit Service fdd496
                                      const char *name_utf8);
Packit Service fdd496
Packit Service fdd496
#ifdef __cplusplus
Packit Service fdd496
}
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
Packit Service fdd496
#endif /* _PROPERNAME_H */