texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Always use installed translated messages


From: Gavin D. Smith
Subject: branch master updated: Always use installed translated messages
Date: Tue, 22 Feb 2022 14:47:29 -0500

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

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 3f8603d170 Always use installed translated messages
3f8603d170 is described below

commit 3f8603d170a0688fd660e0d808c8dc86619f3d8e
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Feb 22 19:47:20 2022 +0000

    Always use installed translated messages
    
    * tp/Texinfo/XS/parsetexi/api.c (init),
    * tp/texi2any.pl: Unconditionally use installed messages regardless
    of whether the program is installed or not.  Although it would be
    better to use uninstalled messages for this, this hasn't been
    implemented, and having access to translated messages when uninstalled
    will make testing the translations easier.  Remove reference to
    a non-existent 'maintain/regenerate_perl_module_files.sh' script.
---
 ChangeLog                     | 12 ++++++++++++
 tp/Texinfo/XS/parsetexi/api.c | 16 ++++++----------
 tp/texi2any.pl                |  9 ++++-----
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3d3790554f..af081c0541 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2022-02-22  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Always use installed translated messages
+
+       * tp/Texinfo/XS/parsetexi/api.c (init),
+       * tp/texi2any.pl: Unconditionally use installed messages regardless
+       of whether the program is installed or not.  Although it would be
+       better to use uninstalled messages for this, this hasn't been
+       implemented, and having access to translated messages when uninstalled
+       will make testing the translations easier.  Remove reference to
+       a non-existent 'maintain/regenerate_perl_module_files.sh' script.
+
 2022-02-22  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/ModulePath.pm.in: Add a comment warning against
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 240481f8be..9711eb1c7e 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -44,11 +44,9 @@ ELEMENT *Root;
 
 #define LOCALEDIR DATADIR "/locale"
 
-/* Use the uninstalled locales dir.
-   NB the texinfo.mo files are not actually created here, only the
-   texinfo_document.mo files, which aren't used by parsetexi.
-   Hence, error messages will be translated only when the program is 
-   installed. */
+/* Use the uninstalled locales dir.  Currently unused.
+   The texinfo.mo files are not actually created here, only the
+   texinfo_document.mo files, which aren't used by parsetexi. */
 static void
 find_locales_dir (char *builddir)
 {
@@ -83,11 +81,9 @@ init (int texinfo_uninstalled, char *builddir)
 {
   setlocale (LC_ALL, "");
 
-  /* Use installed or uninstalled translation files for gettext. */
-  if (texinfo_uninstalled)
-    find_locales_dir (builddir);
-  else
-    bindtextdomain (PACKAGE, LOCALEDIR);
+  /* Note: this uses the installed translations even when running an
+     uninstalled program. */
+  bindtextdomain (PACKAGE, LOCALEDIR);
 
   textdomain (PACKAGE);
 
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index c803d79561..67a7dca142 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -184,19 +184,18 @@ if ($Texinfo::ModulePath::texinfo_uninstalled) {
                                        'LocaleData');
   if (-d $locales_dir) {
     Locale::Messages::bindtextdomain ($strings_textdomain, $locales_dir);
-    # the messages in this domain are not regenerated automatically, 
-    # only when calling ./maintain/regenerate_perl_module_files.sh
-    Locale::Messages::bindtextdomain ($messages_textdomain, $locales_dir);
   } else {
     warn "Locales dir for document strings not found\n";
   }
 } else {
   Locale::Messages::bindtextdomain ($strings_textdomain, 
                                     File::Spec->catdir($datadir, 'locale'));
-  Locale::Messages::bindtextdomain ($messages_textdomain,
-                                    File::Spec->catdir($datadir, 'locale'));
 }
 
+# Note: this uses installed messages even when the program is uninstalled
+Locale::Messages::bindtextdomain ($messages_textdomain,
+                                File::Spec->catdir($datadir, 'locale'));
+
 
 # Version setting is complicated, because we cope with 
 # * script with configure values substituted or not



reply via email to

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