emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#18054: closed (Problematic translation strings in


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18054: closed (Problematic translation strings in coreutils 8.22‏ )
Date: Sat, 19 Jul 2014 14:59:02 +0000

Your message dated Sat, 19 Jul 2014 07:57:56 -0700
with message-id <address@hidden>
and subject line Re: bug#18054: Problematic translation strings in coreutils 
8.22‏
has caused the debbugs.gnu.org bug report #18054,
regarding Problematic translation strings in coreutils 8.22‏ 
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
18054: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18054
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Problematic translation strings in coreutils 8.22‏ Date: Fri, 18 Jul 2014 23:48:10 +0200
Hi!
 
When reviewing the Swedish translation of coreutils I noticed the pecular string
"failed to %s supplemental groups" which (because the contents of %s were
unclear) prompted me to look at the source of coreutils. The %s used in this 
string
is expanded to either "set" or "clear" but neither of those strings are 
enclosed by
the _() translation macro.
 
Once saw this I looked for further instances where the translation macro was
used in a strange way and I found the instance in gl/lib/randread.c. In the
.pot-file only "%s: end of file" is present and "%s: read error" is left 
untranslated.
The reason for this is that the translation macro _() in this instance contains
a ternary expression and only the first string will be parsed and offered for
translation. To fix this I propose to first evaluate the expression and only
then apply the translation macro.
 
Below I provide you with a proposed patch (applying on top of git HEAD).
Applying this patch makes the strings "set" and "clear" appear in the .pot-file
and "%s: read error" be mentioned for lib/randread.c too. I hope the patch
will help you in sorting out this minor issue. Thanks for an excellent set of 
utilities!
 
 / Sebastian
 
 
 
From 1333c446baefe31ebe25a1c18cd8f64a0c122516 Mon Sep 17 00:00:00 2001
From: Sebastian Rasmussen <address@hidden>
Date: Wed, 16 Jul 2014 20:58:12 +0200
Subject: [PATCH] maint: fix two translation message issues
 
* gl/lib/randread.c (randread_error): xgettext can not handle translation
  strings containing C-expressions, so use the translation macro _() only
  for the real strings after the ternary expression has been evaluated.
* src/chroot.c (main): Two condtional error strings were untranslated.
---
 gl/lib/randread.c | 2 +-
 src/chroot.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 
diff --git a/gl/lib/randread.c b/gl/lib/randread.c
index a073cab..af85653 100644
--- a/gl/lib/randread.c
+++ b/gl/lib/randread.c
@@ -125,7 +125,7 @@ randread_error (void const *file_name)
 {
   if (file_name)
     error (exit_failure, errno,
-           _(errno == 0 ? "%s: end of file" : "%s: read error"),
+           errno == 0 ? _("%s: end of file") : _("%s: read error"),
            quotearg_colon (file_name));
   abort ();
 }
diff --git a/src/chroot.c b/src/chroot.c
index fff0b53..963f66b 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -393,7 +393,7 @@ main (int argc, char **argv)
 
   if ((uid_set (uid) || groups) && setgroups (n_gids, gids) != 0)
     error (EXIT_CANCELED, errno, _("failed to %s supplemental groups"),
-           gids ? "set" : "clear");
+           gids ? _("set") : _("clear"));
 
   free (in_gids);
   free (out_gids);
-- 
2.0.1                                     

--- End Message ---
--- Begin Message --- Subject: Re: bug#18054: Problematic translation strings in coreutils 8.22‏ Date: Sat, 19 Jul 2014 07:57:56 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
Thanks, I pushed the attached slightly-simpler patch.

Attachment: 0001-maint-fix-message-translation-glitches.patch
Description: Text document


--- End Message ---

reply via email to

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