texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/main/replace_perl_api_call.c (cal


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/replace_perl_api_call.c (call_translations_translate_string), tp/Texinfo/XS/main/translations.c (translate_string): have call_translations_translate_string return 0 if there is no external translate_string. In translate_string, even if use_external_translate_string is > 0, continue with C gettext if there is no external translate_string.
Date: Tue, 24 Dec 2024 03:33:21 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new e477307a81 * tp/Texinfo/XS/main/replace_perl_api_call.c 
(call_translations_translate_string), tp/Texinfo/XS/main/translations.c 
(translate_string): have call_translations_translate_string return 0 if there 
is no external translate_string. In translate_string, even if 
use_external_translate_string is > 0, continue with C gettext if there is no 
external translate_string.
e477307a81 is described below

commit e477307a8196525bee5131867d056e5182221028
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Dec 23 12:54:48 2024 +0100

    * tp/Texinfo/XS/main/replace_perl_api_call.c
    (call_translations_translate_string),
    tp/Texinfo/XS/main/translations.c (translate_string): have
    call_translations_translate_string return 0 if there is no external
    translate_string.
    In translate_string, even if use_external_translate_string is > 0,
    continue with C gettext if there is no external translate_string.
---
 ChangeLog                                  | 10 ++++++++++
 tp/Texinfo/XS/main/replace_perl_api_call.c |  2 +-
 tp/Texinfo/XS/main/translations.c          | 17 ++++++++++++++---
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5a137c9daa..adf8ef3653 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-12-23  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/replace_perl_api_call.c
+       (call_translations_translate_string),
+       tp/Texinfo/XS/main/translations.c (translate_string): have
+       call_translations_translate_string return 0 if there is no external
+       translate_string.
+       In translate_string, even if use_external_translate_string is > 0,
+       continue with C gettext if there is no external translate_string.
+
 2024-12-23  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/converter.c
diff --git a/tp/Texinfo/XS/main/replace_perl_api_call.c 
b/tp/Texinfo/XS/main/replace_perl_api_call.c
index 063d7738d0..a7006afa2f 100644
--- a/tp/Texinfo/XS/main/replace_perl_api_call.c
+++ b/tp/Texinfo/XS/main/replace_perl_api_call.c
@@ -66,7 +66,7 @@ char *
 call_translations_translate_string (const char *string, const char *in_lang,
                                     const char *translation_context)
 {
-  return strdup (string);
+  return 0;
 }
 
 /* happens if not linked against Perl and a collation locale was specified
diff --git a/tp/Texinfo/XS/main/translations.c 
b/tp/Texinfo/XS/main/translations.c
index 2aa439f30e..aae481e587 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -181,6 +181,7 @@ switch_messages_locale (void)
     }
 }
 
+/* STRING in input must never be NULL */
 char *
 translate_string (const char *string, const char *in_lang,
                   const char *translation_context)
@@ -192,7 +193,7 @@ translate_string (const char *string, const char *in_lang,
   char *saved_LC_MESSAGES;
   char *langs[2] = {0, 0};
   char *main_lang = 0;
-  char *translated_string;
+  char *translated_string = 0;
   char *p;
   static TEXT language_locales;
   int i;
@@ -209,12 +210,22 @@ translate_string (const char *string, const char *in_lang,
       return translated_string;
     }
   else
-    return call_translations_translate_string (string, in_lang,
+    {
+      translated_string = call_translations_translate_string (string, in_lang,
                                                translation_context);
+      if (!translated_string)
+        return strdup (string);
+      else
+        return translated_string;
+    }
 #else
   if (use_external_translate_string > 0)
-    return call_translations_translate_string (string, in_lang,
+    {
+      translated_string = call_translations_translate_string (string, in_lang,
                                                translation_context);
+      if (translated_string)
+        return translated_string;
+    }
 
   /* with the following code valgrind reports issues in perl memory */
 



reply via email to

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