[network-manager-openvpn] properties: make plural forms in error message translatable



commit 7579f5544648fc43f02a5c1714a0e1209ec3972f
Author: Thomas Haller <thaller redhat com>
Date:   Wed Mar 16 13:29:17 2016 +0100

    properties: make plural forms in error message translatable
    
    Based-on-patch-by: Marek Černocký <marek manet cz>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763742

 properties/import-export.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/properties/import-export.c b/properties/import-export.c
index c5cbdf6..03a6baf 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -208,14 +208,19 @@ args_params_check_nargs_minmax (const char **params, guint nargs_min, guint narg
        nargs = g_strv_length ((char **) params) - 1;
 
        if (nargs < nargs_min || nargs > nargs_max) {
-               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)
+               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 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);
+               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);
+               }
                return FALSE;
        }
        return TRUE;


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