diff mbox

New template for 'libc' made available

Message ID 55BFB7DC.3090403@redhat.com
State New
Headers show

Commit Message

Carlos O'Donell Aug. 3, 2015, 6:50 p.m. UTC
On 08/03/2015 01:06 PM, Joseph Myers wrote:
> On Sun, 2 Aug 2015, Jochen Hein wrote:
> 
>> There are some new strings with `%s` instead of the usual `%s'. Is this
>> intentional?
> 
> That seems like a bug.  In fact, any use of ` as a quote in messages is a 
> bug that should be filed in Bugzilla (one bug covering all such cases); 
> the GNU Coding Standards now specify neutral quotes in the C locale.

This is my mistake. The quotes were intended to be `', as previously used
by most GNU programs. However, now we have:

https://www.gnu.org/prep/standards/html_node/Quote-Characters.html#Quote-Characters

Which recommends "", and I agree with this new recommendation. All such
quotes should therefore be handled by one cleanup bug.

>> There are some messages that are constructed dynamically, which may or
>> may not be possible to use in translations.  And the dynamic strings are
>> not marked for translation.  For example:
> 
> Those are also bugs that should be filed in Bugzilla.

That is a bug.

I believe there are 3 such instances and fixed by this patch.

I do not plan to hold the release for this. We'll fix it in 2.23, and the
translations will get updated in the next release.

2015-08-03  Carlos O'Donell  <carlos@redhat.com>

	* nscd/connections.c (inotify_check_files): Quote strings for
	translating.

---

Cheers,
Carlos.

Comments

Paul Eggert Aug. 3, 2015, 7:08 p.m. UTC | #1
Carlos O'Donell wrote:
>                dbg_log (_("monitored file `%s` was %s, removing watch"),
> +                      finfo->fname, moved ? _("moved") : _("deleted"));

This sort of thing really should be something like:

               dbg_log ((moved
                         ? _("monitored file '%s' was moved, removing watch")
                         : _("monitored file '%s' was deleted, removing watch")),
                        finfo->fname);

for the benefit of people trying to write translations.  One can't always 
disassemble and reassemble English sentences so easily in other languages.
Joseph Myers Aug. 3, 2015, 8:34 p.m. UTC | #2
On Mon, 3 Aug 2015, Carlos O'Donell wrote:

>               dbg_log (_("monitored file `%s` was %s, removing watch"),
> -                      finfo->fname, moved ? "moved" : "deleted");
> +                      finfo->fname, moved ? _("moved") : _("deleted"));

No, you need to have two completely separate format strings, one with 
"moved" and one with "deleted", each marked for translation, in case the 
translation of the word affects the rest of the sentence or the word needs 
translating differently in different calls to dbg_log.
Carlos O'Donell Aug. 4, 2015, 2:30 p.m. UTC | #3
On 08/03/2015 04:34 PM, Joseph Myers wrote:
> On Mon, 3 Aug 2015, Carlos O'Donell wrote:
> 
>>               dbg_log (_("monitored file `%s` was %s, removing watch"),
>> -                      finfo->fname, moved ? "moved" : "deleted");
>> +                      finfo->fname, moved ? _("moved") : _("deleted"));
> 
> No, you need to have two completely separate format strings, one with 
> "moved" and one with "deleted", each marked for translation, in case the 
> translation of the word affects the rest of the sentence or the word needs 
> translating differently in different calls to dbg_log.

Thanks. I'll fix this in 2.23 then.

Cheers,
Carlos.
diff mbox

Patch

diff --git a/nscd/connections.c b/nscd/connections.c
index cba5e6a..a6daeaa 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1966,7 +1966,7 @@  inotify_check_files (bool *to_clear, union __inev *inev)
                }
 
              dbg_log (_("monitored file `%s` was %s, removing watch"),
-                      finfo->fname, moved ? "moved" : "deleted");
+                      finfo->fname, moved ? _("moved") : _("deleted"));
              /* File was moved out, remove the watch.  Watches are
                 automatically removed when the file is deleted.  */
              if (moved)
@@ -2013,7 +2013,7 @@  inotify_check_files (bool *to_clear, union __inev *inev)
              if (finfo->inotify_descr[TRACED_FILE] != -1)
                {
                  dbg_log (_("monitored parent directory `%s` was %s, removing watch on `%s`"),
-                          finfo->dname, moved ? "moved" : "deleted", finfo->fname);
+                          finfo->dname, moved ? _("moved") : _("deleted"), finfo->fname);
                  if (inotify_rm_watch (inotify_fd, finfo->inotify_descr[TRACED_FILE]) < 0)
                    dbg_log (_("failed to remove file watch `%s`: %s"),
                             finfo->dname, strerror (errno));
@@ -2040,7 +2040,7 @@  inotify_check_files (bool *to_clear, union __inev *inev)
              int ret;
              dbg_log (_("monitored file `%s` was %s, adding watch"),
                       finfo->fname,
-                      inev->i.mask & IN_CREATE ? "created" : "moved into place");
+                      inev->i.mask & IN_CREATE ? _("created") : _("moved into place"));
              /* File was moved in or created.  Regenerate the watch.  */
              if (finfo->inotify_descr[TRACED_FILE] != -1)
                inotify_rm_watch (inotify_fd,