Blame lib/propername.h

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