Patchwork [2,of,4] filemerge: avoid putting translated text into docstring

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Aug. 24, 2018, 6:20 p.m.
Message ID <222400828ff78e0a44cd.1535134843@blacknile>
Download mbox | patch
Permalink /patch/34030/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Aug. 24, 2018, 6:20 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1534914507 -32400
#      Wed Aug 22 14:08:27 2018 +0900
# Node ID 222400828ff78e0a44cdf20a57cba679304ca913
# Parent  612d99ed365e4865f682a9483f70d525cfd85d1d
# Available At https://bitbucket.org/foozy/mercurial-wip
#              hg pull https://bitbucket.org/foozy/mercurial-wip -r 222400828ff7
# EXP-Topic filemerge-followup
filemerge: avoid putting translated text into docstring

This is follow up of my mistake in e09fad982ef5.

There is no merge tool, which has only one of binary or symlink
capabilities, but this patch lists up all combinations of them for
safety in the future. Maybe, it is too paranoid, though.
Yuya Nishihara - Aug. 25, 2018, 8:16 a.m.
On Sat, 25 Aug 2018 03:20:43 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1534914507 -32400
> #      Wed Aug 22 14:08:27 2018 +0900
> # Node ID 222400828ff78e0a44cdf20a57cba679304ca913
> # Parent  612d99ed365e4865f682a9483f70d525cfd85d1d
> # Available At https://bitbucket.org/foozy/mercurial-wip
> #              hg pull https://bitbucket.org/foozy/mercurial-wip -r 222400828ff7
> # EXP-Topic filemerge-followup
> filemerge: avoid putting translated text into docstring

Queued the series, thanks.

> +    # to put i18n comments into hg.pot for automatically generated texts
> +
> +    # i18n: "binary" and "symlik" are keywords
> +    # i18n: this text is added automatically
> +    _("    (actual capabilities: binary, symlink)")
> +    # i18n: "binary" is keyword
> +    # i18n: this text is added automatically
> +    _("    (actual capabilities: binary)")
> +    # i18n: "symlink" is keyword
> +    # i18n: this text is added automatically
> +    _("    (actual capabilities: symlink)")

Moved these under "if False:" to clarify that they are unnecessary at run time.
Yuya Nishihara - Aug. 25, 2018, 8:36 a.m.
On Sat, 25 Aug 2018 17:16:44 +0900, Yuya Nishihara wrote:
> On Sat, 25 Aug 2018 03:20:43 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> > # Date 1534914507 -32400
> > #      Wed Aug 22 14:08:27 2018 +0900
> > # Node ID 222400828ff78e0a44cdf20a57cba679304ca913
> > # Parent  612d99ed365e4865f682a9483f70d525cfd85d1d
> > # Available At https://bitbucket.org/foozy/mercurial-wip
> > #              hg pull https://bitbucket.org/foozy/mercurial-wip -r 222400828ff7
> > # EXP-Topic filemerge-followup
> > filemerge: avoid putting translated text into docstring
> 
> Queued the series, thanks.
> 
> > +    # to put i18n comments into hg.pot for automatically generated texts
> > +
> > +    # i18n: "binary" and "symlik" are keywords
> > +    # i18n: this text is added automatically
> > +    _("    (actual capabilities: binary, symlink)")
> > +    # i18n: "binary" is keyword
> > +    # i18n: this text is added automatically
> > +    _("    (actual capabilities: binary)")
> > +    # i18n: "symlink" is keyword
> > +    # i18n: this text is added automatically
> > +    _("    (actual capabilities: symlink)")
> 
> Moved these under "if False:" to clarify that they are unnecessary at run time.

Never mind. check-code complains about that.

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -990,9 +990,21 @@  def loadinternalmerge(ui, extname, regis
 
         capabilities = sorted([k for k, v in func.capabilities.items() if v])
         if capabilities:
-            capdesc = _("(actual capabilities: %s)") % ', '.join(capabilities)
+            capdesc = "    (actual capabilities: %s)" % ', '.join(capabilities)
             func.__doc__ = (func.__doc__ +
-                            pycompat.sysstr("\n\n    %s" % capdesc))
+                            pycompat.sysstr("\n\n%s" % capdesc))
+
+    # to put i18n comments into hg.pot for automatically generated texts
+
+    # i18n: "binary" and "symlik" are keywords
+    # i18n: this text is added automatically
+    _("    (actual capabilities: binary, symlink)")
+    # i18n: "binary" is keyword
+    # i18n: this text is added automatically
+    _("    (actual capabilities: binary)")
+    # i18n: "symlink" is keyword
+    # i18n: this text is added automatically
+    _("    (actual capabilities: symlink)")
 
 # load built-in merge tools explicitly to setup internalsdoc
 loadinternalmerge(None, None, internaltool)