Patchwork [2,of,2] cmdutil: remove HG: prefix from translation strings

login
register
mail settings
Submitter timeless@mozdev.org
Date Sept. 25, 2015, 8:02 a.m.
Message ID <10741746869ca6791eff.1443168156@waste.org>
Download mbox | patch
Permalink /patch/10632/
State Accepted
Headers show

Comments

timeless@mozdev.org - Sept. 25, 2015, 8:02 a.m.
# HG changeset patch
# User timeless@mozdev.org
# Date 1443167055 14400
#      Fri Sep 25 03:44:15 2015 -0400
# Node ID 10741746869ca6791eff04f333b996fa503e7c17
# Parent  4192dacd5bf78b0eb2097793c5755ec15e9a11c7
cmdutil: remove HG: prefix from translation strings
Pierre-Yves David - Sept. 28, 2015, 9:32 a.m.
On 09/25/2015 01:02 AM, timeless@mozdev.org wrote:
> # HG changeset patch
> # User timeless@mozdev.org
> # Date 1443167055 14400
> #      Fri Sep 25 03:44:15 2015 -0400
> # Node ID 10741746869ca6791eff04f333b996fa503e7c17
> # Parent  4192dacd5bf78b0eb2097793c5755ec15e9a11c7
> cmdutil: remove HG: prefix from translation strings

I've pushed that to the clowncopter. I'm marginally afraid of 
translation longer than a line. Could we garde ourself against that.
timeless - Sept. 30, 2015, 8:24 p.m.
I sent feeea04e2d0f to guard against that.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2742,23 +2742,23 @@ 
         edittext.append(ctx.description())
     edittext.append("")
     edittext.append("") # Empty line between message and comments.
-    edittext.append(_("HG: Enter commit message."
+    edittext.append("HG: %s" % _("Enter commit message."
                       "  Lines beginning with 'HG:' are removed."))
     edittext.append("HG: %s" % extramsg)
     edittext.append("HG: --")
-    edittext.append(_("HG: user: %s") % ctx.user())
+    edittext.append("HG: %s" % (_("user: %s") % ctx.user()))
     if ctx.p2():
-        edittext.append(_("HG: branch merge"))
+        edittext.append("HG: %s" % _("branch merge"))
     if ctx.branch():
-        edittext.append(_("HG: branch '%s'") % ctx.branch())
+        edittext.append("HG: %s" % (_("branch '%s'") % ctx.branch()))
     if bookmarks.isactivewdirparent(repo):
-        edittext.append(_("HG: bookmark '%s'") % repo._activebookmark)
-    edittext.extend([_("HG: subrepo %s") % s for s in subs])
-    edittext.extend([_("HG: added %s") % f for f in added])
-    edittext.extend([_("HG: changed %s") % f for f in modified])
-    edittext.extend([_("HG: removed %s") % f for f in removed])
+        edittext.append("HG: %s" % (_("bookmark '%s'") % repo._activebookmark))
+    edittext.extend(["HG: %s" % (_("subrepo %s") % s) for s in subs])
+    edittext.extend(["HG: %s" % (_("added %s") % f) for f in added])
+    edittext.extend(["HG: %s" % (_("changed %s") % f) for f in modified])
+    edittext.extend(["HG: %s" % (_("removed %s") % f) for f in removed])
     if not added and not modified and not removed:
-        edittext.append(_("HG: no files changed"))
+        edittext.append("HG: %s" % _("no files changed"))
     edittext.append("")
 
     return "\n".join(edittext)