]> Dogcows Code - chaz/tar/commitdiff
Use ngettext where appropriate.
authorSergey Poznyakoff <gray@gnu.org.ua>
Fri, 5 Sep 2003 13:24:15 +0000 (13:24 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Fri, 5 Sep 2003 13:24:15 +0000 (13:24 +0000)
src/buffer.c
src/compare.c
src/create.c
src/misc.c
src/tar.c
src/update.c

index ab067520f54f9ef5cc05c876e3df3d0b22e14a4d..fd16b6f1e39d4f42d34c8ba0ad761ea3c7a08f60 100644 (file)
@@ -1055,8 +1055,15 @@ short_read (ssize_t status)
        break;
 
       if (! read_full_records_option)
-       FATAL_ERROR ((0, 0, _("Unaligned block (%lu bytes) in archive"),
-                     (unsigned long) (record_size - left)));
+       {
+         unsigned long rest = record_size - left;
+         
+         FATAL_ERROR ((0, 0,
+                       ngettext ("Unaligned block (%lu byte) in archive",
+                                 "Unaligned block (%lu bytes) in archive",
+                                 rest),
+                       rest));
+       }
 
       /* User warned us about this.  Fix up.  */
 
@@ -1069,8 +1076,14 @@ short_read (ssize_t status)
 
   if (!read_full_records_option && verbose_option
       && record_start_block == 0 && status > 0)
-    WARN ((0, 0, _("Record size = %lu blocks"),
-          (unsigned long) ((record_size - left) / BLOCKSIZE)));
+    {
+      unsigned long rsize = (record_size - left) / BLOCKSIZE;
+      WARN ((0, 0,
+            ngettext ("Record size = %lu block",
+                      "Record size = %lu blocks",
+                      rsize),
+            rsize));
+    }
 
   record_end = record_start + (record_size - left) / BLOCKSIZE;
   records_read++;
index 2c3a21d2a5317c89c5e01d488067b76589939d67..4ae3392878decfaa9728c292f3a0549656dfdc17 100644 (file)
@@ -97,7 +97,10 @@ process_rawdata (size_t bytes, char *buffer)
        }
       else
        {
-         sprintf (message, _("Could only read %lu of %lu bytes"),
+         sprintf (message,
+                  ngettext ("Could only read %lu of %lu byte",
+                            "Could only read %lu of %lu bytes",
+                            bytes),
                   (unsigned long) status, (unsigned long) bytes);
          report_difference (message);
        }
@@ -236,7 +239,10 @@ diff_sparse_files (void)
                {
                  char message[MESSAGE_BUFFER_SIZE];
 
-                 sprintf (message, _("Could only read %lu of %lu bytes"),
+                 sprintf (message,
+                          ngettext ("Could only read %lu of %lu byte",
+                                    "Could only read %lu of %lu bytes",
+                                    chunk_size),
                           (unsigned long) status, (unsigned long) chunk_size);
                  report_difference (message);
                }
@@ -268,7 +274,10 @@ diff_sparse_files (void)
            {
              char message[MESSAGE_BUFFER_SIZE];
 
-             sprintf (message, _("Could only read %lu of %lu bytes"),
+             sprintf (message,
+                      ngettext ("Could only read %lu of %lu byte",
+                                "Could only read %lu of %lu bytes",
+                                chunk_size),
                       (unsigned long) status, (unsigned long) chunk_size);
              report_difference (message);
            }
@@ -714,7 +723,9 @@ verify_volume (void)
          while (status == HEADER_FAILURE);
 
          ERROR ((0, 0,
-                 _("VERIFY FAILURE: %d invalid header(s) detected"), counter));
+                 ngettext ("VERIFY FAILURE: %d invalid header detected",
+                           "VERIFY FAILURE: %d invalid headers detected",
+                           counter), counter));
        }
       if (status == HEADER_ZERO_BLOCK || status == HEADER_END_OF_FILE)
        break;
index b0fa1e88facdf16e8ebe5b9d10bda4e71d6fc580..910b4a239d684180b0ebeb4c4132495331737935 100644 (file)
@@ -1497,7 +1497,9 @@ dump_file (char *p, int top_level, dev_t parent_device)
                    char buf[UINTMAX_STRSIZE_BOUND];
                    memset (start->buffer + count, 0, bufsize - count);
                    WARN ((0, 0,
-                          _("%s: File shrank by %s bytes; padding with zeros"),
+                          ngettext ("%s: File shrank by %s byte; padding with zeros",
+                                    "%s: File shrank by %s bytes; padding with zeros",
+                                    sizeleft),
                           quotearg_colon (p),
                           STRINGIFY_BIGINT (sizeleft, buf)));
                    if (! ignore_failed_read_option)
index 8112ee8698dc8ba1e327aa96b94240db712b566b..678976e2751fb815b51f47a9de15288fd5e01ffd 100644 (file)
@@ -660,7 +660,9 @@ read_error_details (char const *name, off_t offset, size_t size)
   char buf[UINTMAX_STRSIZE_BOUND];
   int e = errno;
   ERROR ((0, e,
-         _("%s: Read error at byte %s, reading %lu bytes"),
+         ngettext ("%s: Read error at byte %s, reading %lu byte",
+                   "%s: Read error at byte %s, reading %lu bytes",
+                   size),
          quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
          (unsigned long) size));
 }
@@ -671,7 +673,9 @@ read_warn_details (char const *name, off_t offset, size_t size)
   char buf[UINTMAX_STRSIZE_BOUND];
   int e = errno;
   WARN ((0, e,
-        _("%s: Warning: Read error at byte %s, reading %lu bytes"),
+        ngettext ("%s: Warning: Read error at byte %s, reading %lu byte",
+                  "%s: Warning: Read error at byte %s, reading %lu bytes",
+                  size),
         quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
         (unsigned long) size));
 }
@@ -688,7 +692,9 @@ read_fatal_details (char const *name, off_t offset, size_t size)
   char buf[UINTMAX_STRSIZE_BOUND];
   int e = errno;
   FATAL_ERROR ((0, e,
-               _("%s: Read error at byte %s, reading %lu bytes"),
+               ngettext ("%s: Read error at byte %s, reading %lu byte",
+                         "%s: Read error at byte %s, reading %lu bytes",
+                         size),
                quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
                (unsigned long) size));
 }
@@ -811,7 +817,10 @@ write_error_details (char const *name, ssize_t status, size_t size)
   if (status < 0)
     write_error (name);
   else
-    ERROR ((0, 0, _("%s: Wrote only %lu of %lu bytes"),
+    ERROR ((0, 0,
+           ngettext ("%s: Wrote only %lu of %lu byte",
+                     "%s: Wrote only %lu of %lu bytes",
+                     record_size),
            name, (unsigned long) status, (unsigned long) record_size));
 }
 
index e0e731b1ec4d334f19af05d51062b25a209e0013..dcf6a3e3fb2a67bea96fcb6f8d0f282188fce7f9 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -1283,7 +1283,9 @@ see the file named COPYING for details."));
            : 0));
       if (volume_label_max_len < strlen (volume_label_option))
        USAGE_ERROR ((0, 0,
-                     _("%s: Volume label is too long (limit is %lu bytes)"),
+                     ngettext ("%s: Volume label is too long (limit is %lu byte)",
+                               "%s: Volume label is too long (limit is %lu bytes)",
+                               volume_label_max_len),
                      quotearg_colon (volume_label_option),
                      (unsigned long) volume_label_max_len));
     }
index 5363ece48d934911d6d10a7394c89d5ac1a73f01..c7e03192c5d9314687d26dcd4f3c4d9d1dac9539 100644 (file)
@@ -80,7 +80,10 @@ append_file (char *path)
            read_fatal_details (path, stat_data.st_size - bytes_left,
                                buffer_size);
          if (status == 0)
-           FATAL_ERROR ((0, 0, _("%s: File shrank by %s bytes"),
+           FATAL_ERROR ((0, 0,
+                         ngettext ("%s: File shrank by %s byte",
+                                   "%s: File shrank by %s bytes",
+                                   bytes_left),
                          quotearg_colon (path),
                          STRINGIFY_BIGINT (bytes_left, buf)));
 
This page took 0.025786 seconds and 4 git commands to generate.