Blame lib/propername.h

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