Message ID | 55BFB7DC.3090403@redhat.com |
---|---|
State | New |
Headers | show |
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.
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.
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 --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,