]> Savannah Git Hosting - gnulib.git/commitdiff
unicodeio: Use the translation domain "gnulib".
authorBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2024 12:31:23 +0000 (13:31 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2024 12:31:23 +0000 (13:31 +0100)
* lib/unicodeio.h (unicode_to_mb): Clarify that the message passed to
the failure callback may already be localized.
* lib/unicodeio.c (unicode_to_mb): For the messages defined in this
file, use the translation domain "gnulib".

ChangeLog
lib/unicodeio.c
lib/unicodeio.h

index f05fb1e31538bc8308a82d4a2fb13daea574c892..64c1723734172a1e242cab67d47efd6079df14de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-12-09  Bruno Haible  <bruno@clisp.org>
 
+       unicodeio: Use the translation domain "gnulib".
+       * lib/unicodeio.h (unicode_to_mb): Clarify that the message passed to
+       the failure callback may already be localized.
+       * lib/unicodeio.c (unicode_to_mb): For the messages defined in this
+       file, use the translation domain "gnulib".
+
        file-type: Use the translation domain "gnulib".
        * lib/file-type.c (file_type): Use the translation domain "gnulib".
        * modules/file-type (Depends-on): Add gnulib-i18n.
index 1c7503ad583b61b7884860bd0d1a5b1294e2f3e4..876fb353d0e396401b6d0732cfc342e38f766231 100644 (file)
@@ -57,7 +57,7 @@
 /* Converts the Unicode character CODE to its multibyte representation
    in the current locale and calls the SUCCESS callback on the resulting
    byte sequence.  If an error occurs, invokes the FAILURE callback instead,
-   passing it CODE and an English error string.
+   passing it CODE and an English (or already localized) error string.
    Returns whatever the callback returned.
    Assumes that the locale doesn't change between two calls.  */
 long
@@ -99,16 +99,16 @@ unicode_to_mb (unsigned int code,
     {
 #if HAVE_ICONV
       if (utf8_to_local == (iconv_t)(-1))
-        return failure (code, N_("iconv function not usable"), callback_arg);
+        return failure (code, _("iconv function not usable"), callback_arg);
 #else
-      return failure (code, N_("iconv function not available"), callback_arg);
+      return failure (code, _("iconv function not available"), callback_arg);
 #endif
     }
 
   /* Convert the character to UTF-8.  */
   count = u8_uctomb ((unsigned char *) inbuf, code, sizeof (inbuf));
   if (count < 0)
-    return failure (code, N_("character out of range"), callback_arg);
+    return failure (code, _("character out of range"), callback_arg);
 
 #if HAVE_ICONV
   if (!is_utf8)
index 0db1d35f52b42ba7e102336cfe3e9a9b1de6ec5b..a5115885b62853dc195c4a4fb081d7ef42c0385a 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 /* Converts the Unicode character CODE to its multibyte representation
    in the current locale and calls the SUCCESS callback on the resulting
    byte sequence.  If an error occurs, invokes the FAILURE callback instead,
-   passing it CODE and an English error string.
+   passing it CODE and an English (or already localized) error string.
    Returns whatever the callback returned.
    Assumes that the locale doesn't change between two calls.  */
 extern long unicode_to_mb (unsigned int code,