[HEAD PATCH] Use ngettext where appropriate

Ineiev ineiev at gnu.org
Wed Dec 2 18:37:46 CET 2015


On Wed, Dec 02, 2015 at 06:12:51PM +0100, Werner Koch wrote:
> On Tue, 20 Oct 2015 09:08, ineiev at gnu.org said:
> > I attach a patch against current HEAD to make use
> > of ngettext in some places; it also marks two more messages
> > localizable.
> 
> At the cost of translating a lot more and quite similar strings.

The string is the same (it's single msgid); what would be needed
is filling different forms of the words (when the number of plural
forms is more then one, which is not the case for some languages).

> This breaks too many other translations.

To be precise, it makes them 'fuzzy'.

> Although not being correct, it is
> better to not apply your patch.  Sorry.

In cases like

-              if (n_uids == 1 )
-                log_info( _("key %s: \"%s\" 1 new user ID\n"),
-                          keystr(keyid),p);
-              else if (n_uids )
-                log_info( _("key %s: \"%s\" %d new user IDs\n"),
-                          keystr(keyid),p,n_uids);
...
+              if (n_uids)
+                log_info( ngettext ("key %s: \"%s\" %d new user ID\n",
+                                    "key %s: \"%s\" %d new user IDs\n", n_uids),
+                          keystr(keyid),p, n_uids);

the number of messages decreases. will you accept the patch
if I pick such cases?

> Where possible I try to use a table format to avoid plural issues.  BTW,
> for that reason this hunk would be wrong:
> 
> > -  log_info (_("permanently loaded certificates: %u\n"),
> > +  log_info (ngettext(" permanently loaded certificate: %u\n",
> > +                     "permanently loaded certificates: %u\n",
> > +                     total_loaded_certificates),

I'm not sure this method always works very well.

Thank you!



More information about the Gnupg-i18n mailing list