Quellcode durchsuchen

Add gettext messages for plural forms

Some of the singular forms are not currently used, but we keep them for
consistency, and to avoid confusing translators.

Closes: #594218
Guillem Jover vor 16 Jahren
Ursprung
Commit
cac9ac6694

+ 1 - 0
debian/changelog

@@ -9,6 +9,7 @@ dpkg (1.15.8.5) UNRELEASED; urgency=low
   * Clarify effect of “dpkg --purge” on homedir files in dpkg(1).
     Thanks to The Fungi <fungi@yuggoth.org>. Closes: #593628
   * Add gettext plurals infrastructure support.
+  * Add gettext messages for plural forms. Closes: #594218
 
   [ Raphaël Hertzog ]
   * Fix dpkg-genchanges to not split the short description in the middle of a

+ 4 - 1
dpkg-deb/build.c

@@ -376,7 +376,10 @@ void do_build(const char *const *argv) {
       ohshite(_("error opening conffiles file"));
     }
     if (warns)
-      warning(_("ignoring %d warnings about the control file(s)\n"), warns);
+      warning(P_("ignoring %d warning about the control file(s)\n",
+                 "ignoring %d warnings about the control file(s)\n", warns),
+              warns);
+
   }
   m_output(stdout, _("<standard output>"));
   

+ 3 - 4
dpkg-deb/info.c

@@ -117,10 +117,9 @@ static void info_spew(const char *debar, const char *directory,
   }
   varbuf_destroy(&controlfile);
 
-  if (re==1)
-    ohshit(_("One requested control component is missing"));
-  else if (re>1)
-    ohshit(_("%d requested control components are missing"), re);
+  if (re > 0)
+    ohshit(P_("%d requested control component is missing",
+              "%d requested control components are missing", re), re);
 }
 
 static void info_list(const char *debar, const char *directory) {

+ 3 - 1
dpkg-split/join.c

@@ -42,7 +42,9 @@ void reassemble(struct partinfo **partlist, const char *outputfile) {
   unsigned int i;
   size_t nr,buffersize;
 
-  printf(_("Putting package %s together from %d parts: "),
+  printf(P_("Putting package %s together from %d part: ",
+            "Putting package %s together from %d parts: ",
+            partlist[0]->maxpartn),
          partlist[0]->package,partlist[0]->maxpartn);
   
   buffersize= partlist[0]->maxpartlen;

+ 6 - 3
scripts/Dpkg/Source/Package/V2.pm

@@ -414,9 +414,12 @@ sub do_build {
     };
     find({ wanted => $check_binary, preprocess => $filter_ignore,
            no_chdir => 1 }, File::Spec->catdir($dir, "debian"));
-    error(_g("detected %d unwanted binary file(s) " .
-        "(add them in debian/source/include-binaries to allow their " .
-        "inclusion)."), $unwanted_binaries) if $unwanted_binaries;
+    error(P_("detected %d unwanted binary file (add it in " .
+             "debian/source/include-binaries to allow its inclusion).",
+             "detected %d unwanted binary files (add them in " .
+             "debian/source/include-binaries to allow their inclusion).",
+             $unwanted_binaries), $unwanted_binaries)
+         if $unwanted_binaries;
 
     # Create a patch
     my $autopatch = File::Spec->catfile($dir, "debian", "patches",

+ 4 - 2
scripts/dpkg-shlibdeps.pl

@@ -376,8 +376,10 @@ foreach my $file (keys %exec) {
 	    }
 	}
     }
-    warning(_g("%d other similar warnings have been skipped (use -v to see " .
-	    "them all)."), $nb_skipped_warnings) if $nb_skipped_warnings;
+    warning(P_("%d similar warning has been skipped (use -v to see it).",
+               "%d other similar warnings have been skipped (use -v to see " .
+               "them all).", $nb_skipped_warnings), $nb_skipped_warnings)
+        if $nb_skipped_warnings;
     foreach my $soname (@sonames) {
 	# Adjust minimal version of dependencies with information
 	# extracted from build-dependencies

+ 3 - 1
src/enquiry.c

@@ -254,7 +254,9 @@ void unpackchk(const char *const *argv) {
       putchar('\n');
     }
   } else {
-    printf(_(" %d packages, from the following sections:"),totalcount);
+    printf(P_(" %d package, from the following section:",
+              " %d packages, from the following sections:", totalcount),
+           totalcount);
     width= 0;
     for (se= sectionentries; se; se= se->next) {
       sprintf(buf,"%d",se->count);

+ 3 - 1
src/filesdb.c

@@ -443,7 +443,9 @@ void ensure_allinstfiles_available(void) {
 
   if (saidread==1) {
     progress_done(&progress);
-    printf(_("%d files and directories currently installed.)\n"),nfiles);
+    printf(P_("%d file or directory currently installed.)\n",
+              "%d files and directories currently installed.)\n", nfiles),
+           nfiles);
     saidread=2;
   }
 }

+ 7 - 4
src/help.c

@@ -133,10 +133,13 @@ void checkpath(void) {
   varbuf_destroy(&filename);
 
   if (warned)
-    forcibleerr(fc_badpath, _("%d expected program(s) not found in PATH "
-                "or not executable.\nNB: root's PATH should usually contain "
-                "/usr/local/sbin, /usr/sbin and /sbin."),
-                warned);
+    forcibleerr(fc_badpath,
+                P_("%d expected program not found in PATH or not executable.\n"
+                   "NB: root's PATH should usually contain "
+                   "/usr/local/sbin, /usr/sbin and /sbin.",
+                   "%d expected programs not found in PATH or not executable.\n"
+                   "NB: root's PATH should usually contain "
+                   "/usr/local/sbin, /usr/sbin and /sbin.", warned), warned);
 }
 
 bool

+ 2 - 1
src/update.c

@@ -93,7 +93,8 @@ void updateavailable(const char *const *argv) {
   }
 
   if (cipaction->arg != act_avclear)
-    printf(_("Information about %d package(s) was updated.\n"),count);
+    printf(P_("Information about %d package was updated.\n",
+              "Information about %d packages was updated.\n", count), count);
 }
 
 void forgetold(const char *const *argv) {

+ 6 - 3
utils/update-alternatives.c

@@ -1428,10 +1428,13 @@ alternative_select_choice(struct alternative *a)
 
 	for (;;) {
 		const char *mark;
+		int n_choices;
 
-		pr(_("There are %d choices for the alternative %s (providing "
-		     "%s)."), alternative_choices_count(a), a->master_name,
-		     a->master_link);
+		n_choices = alternative_choices_count(a);
+
+		pr(P_("There is %d choice for the alternative %s (providing %s).",
+		      "There are %d choices for the alternative %s (providing %s).",
+		      n_choices), n_choices, a->master_name, a->master_link);
 		printf("\n");
 		len = 15;
 		for (fs = a->choices; fs; fs = fs->next)