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

Matt Mackall mpm at selenic.com
Mon Dec 19 17:50:42 CST 2011


On Tue, 2011-12-20 at 06:02 +0700, Andrei Polushin wrote:
> # 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))

No thanks.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list