Pluralize "Cannot not read %d bytes from key file %s.\n" message. (ppisar)
authorMilan Broz <gmazyland@gmail.com>
Wed, 11 May 2011 10:27:33 +0000 (10:27 +0000)
committerMilan Broz <gmazyland@gmail.com>
Wed, 11 May 2011 10:27:33 +0000 (10:27 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@521 36d66b0a-2a48-0410-832c-cd162a569da5

lib/nls.h
lib/setup.c

index d7a9d9b..7ef8a93 100644 (file)
--- a/lib/nls.h
+++ b/lib/nls.h
@@ -27,6 +27,8 @@
 # define textdomain(Domain) /* empty */
 # define _(Text) (Text)
 # define N_(Text) (Text)
+# define ngettext(Singular, Plural, Count) \
+    ( (Count) == 1 ? (Singular) : (Plural) )
 #endif
 
 #endif /* CRYPTSETUP_H */
index 6d4b554..d4ad063 100644 (file)
@@ -159,7 +159,8 @@ static char *process_key(struct crypt_device *cd, const char *hash_name,
        /* key is coming from binary file */
        if (key_file && strcmp(key_file, "-")) {
                if(passLen < key_size) {
-                       log_err(cd, _("Cannot not read %d bytes from key file %s.\n"),
+                       log_err(cd, ngettext("Cannot read %d byte from key file %s.\n",
+                               "Cannot read %d bytes from key file %s.\n", key_size),
                                (int)key_size, key_file);
                        crypt_safe_free(key);
                        return NULL;