bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] propername-lite: new module


From: Bruno Haible
Subject: Re: [PATCH] propername-lite: new module
Date: Sat, 03 Jun 2023 12:36:27 +0200

Paul Eggert wrote:
> +/* Return the localization of the name spelled NAME_ASCII in ASCII,
> +   and NAME_UTF8 in UTF-8.  This function needs less infrastructure
> +   than proper_name and proper_name_utf8.  */
> +extern const char *proper_name_lite (const char *name_ascii,
> +                                     const char *name_utf8);

What are the functional differences between proper_name_lite and
proper_name_utf8 ? This comment does not tell it. I'm therefore
adding these comments:


2023-06-03  Bruno Haible  <bruno@clisp.org>

        propername-lite: Improve documentation.
        * lib/propername.h: Describe functional differences between
        proper_name_lite and proper_name_utf8.

diff --git a/lib/propername.h b/lib/propername.h
index eced2e86da..7bd57b24a4 100644
--- a/lib/propername.h
+++ b/lib/propername.h
@@ -45,7 +45,7 @@
      ...
      Written by Danilo Segan and Bruno Haible.
 
-   The 'propername' and 'propername-lite’ modules do this. Plus, for
+   The 'propername' and 'propername-lite' modules do this. Plus, for
    languages that do not use the Latin alphabet, they allow a translator
    to write the name using that different writing system. In that case the
    propername and propername_utf8 output will look like this:
@@ -75,7 +75,7 @@
         proper_name_utf8 should use octal escapes, not UTF-8 - e.g.,
         "Fran\303\247ois Pinard", not "François Pinard".  Doing it
         this way can avoid mishandling non-ASCII characters if the
-        source is recoded to non-UTF8, or if the compiler does not
+        source is recoded to non-UTF-8, or if the compiler does not
         treat UTF-8 as-is in character string contents.
 
         (Optionally, here you can also add / * TRANSLATORS: ... * / comments
@@ -88,6 +88,17 @@
                     In the original Cyrillic it is "Данило Шеган".  * /
                 proper_name_utf8 ("Danilo Segan", "Danilo \305\240egan"),
                 proper_name ("Bruno Haible"));
+
+   Differences between proper_name_utf8 and proper_name_lite:
+   * proper_name_lite uses the localization provided by the translator.
+     If there is no localization, it uses the name with Unicode characters
+     only in UTF-8 locales, otherwise it uses the original name in English.
+   * proper_name_utf8 is more elaborate:
+     - It uses the name with Unicode characters also when the locale encoding
+       is not UTF-8 but contains the necessary characters (e.g. ISO-8859-x or
+       GB18030).
+     - If there is a localization, it produces a better result when the
+       translator has given a poor localization.
  */
 
 #ifndef _PROPERNAME_H






reply via email to

[Prev in Thread] Current Thread [Next in Thread]