[PATCH 2 of 4] i18n: use plural forms in 'added N changesets' message

Andrei Polushin polushin at gmail.com
Mon Dec 19 17:02:35 CST 2011


# HG changeset patch
# User Andrei Polushin <polushin at gmail.com>
# Date 1324154024 -25200
# Node ID 0ea1c79ae748034287e2543467c7482a6c15e4ba
# Parent  38b5e0c738797907c7ef6724079bbe87c67ed3cc
i18n: use plural forms in 'added N changesets' message

diff -r 38b5e0c73879 -r 0ea1c79ae748 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Sun Dec 18 03:01:04 2011 +0700
+++ b/mercurial/localrepo.py	Sun Dec 18 03:33:44 2011 +0700
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 from node import bin, hex, nullid, nullrev, short
-from i18n import _
+from i18n import _, ngettext
 import repo, changegroup, subrepo, discovery, pushkey
 import changelog, dirstate, filelog, manifest, context, bookmarks, phases
 import lock, transaction, store, encoding
@@ -2032,11 +2032,20 @@
                         dh -= 1
             htext = ""
             if dh:
-                htext = _(" (%+d heads)") % dh
+                htext = ngettext(" (%+d head)",
+                                 " (%+d heads)", dh) % dh
 
-            self.ui.status(_("added %d changesets"
-                             " with %d changes to %d files%s\n")
-                             % (changesets, revisions, files, htext))
+            cstext = ngettext("added %d changeset",
+                              "added %d changesets", changesets) % changesets
+
+            rtext = ngettext("with %d change",
+                             "with %d changes", revisions) % revisions
+
+            ftext = ngettext("to %d file",
+                             "to %d files", files) % files
+
+            # i18n: added N changesets with M changes to X files (+Y heads)
+            self.ui.status(_("%s %s %s%s\n") % (cstext, rtext, ftext, htext))
 
             if changesets > 0:
                 p = lambda: cl.writepending() and self.root or ""


More information about the Mercurial-devel mailing list