After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763742 - Bad handle with plural forms
Bad handle with plural forms
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: VPN: openvpn
unspecified
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-03-16 11:09 UTC by Marek Černocký
Modified: 2016-03-16 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marek Černocký 2016-03-16 11:09:26 UTC
if (nargs_min != nargs_max)
  *out_error = g_strdup_printf (_("option %s expects between %u and %u arguments"), params[0], nargs_min, nargs_max);

else if (nargs_min == 0)
  *out_error = g_strdup_printf (_("option %s expects no arguments"), params[0]);

else if (nargs_min == 1)
  *out_error = g_strdup_printf (_("option %s expects exactly one argument"), params[0]);

else
  *out_error = g_strdup_printf (_("option %s expects exactly %u arguments"), params[0], nargs_min);


from properties/import-export.c is completely wrong in terms of translation. You need use ngettext function:

https://wiki.gnome.org/TranslationProject/DevGuidelines/Plurals
https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html

A right code would be e.g. this:


if (nargs_min != nargs_max)
  *out_error = g_strdup_printf (ngettext("option %s expects between %u and %u argument", "option %s expects between %u and %u arguments", nargs_max), params[0], nargs_min, nargs_max);

else if (nargs_min == 0)
  *out_error = g_strdup_printf (_("option %s expects no arguments"), params[0]);

else
  *out_error = g_strdup_printf (ngettext("option %s expects exactly one argument", "option %s expects exactly %u arguments", nargs_min), params[0], nargs_min);