Patchwork [1,of,9,STABLE?,V2] gendoc: make commnd __doc__ and extension __doc__ as translatable

login
register
mail settings
Submitter Takumi IINO
Date May 15, 2013, 7:14 a.m.
Message ID <911aa900c65f42efb5c6.1368602058@iino-no-MacBook-Air.local>
Download mbox | patch
Permalink /patch/1642/
State Accepted
Commit 814291b5e79cb5f8e8cf0687fd306bf1fbcfb0b6
Headers show

Comments

Takumi IINO - May 15, 2013, 7:14 a.m.
# HG changeset patch
# User Takumi IINO <trot.thunder@gmail.com>
# Date 1368600295 -32400
#      Wed May 15 15:44:55 2013 +0900
# Branch stable
# Node ID 911aa900c65f42efb5c609c502d038f3acb8cc07
# Parent  12dbdd348bb0977366200bf96cb6d2afa85faf13
gendoc: make commnd __doc__ and extension __doc__ as translatable

Before this patch, commnd __doc__ and extension __doc__ are not translatable.
But other messages, like doc of helptalbe, section headers, are translatable.

This patch makes commnd __doc__ and extension __doc__ translatable.

Patch

diff --git a/doc/gendoc.py b/doc/gendoc.py
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -7,7 +7,7 @@ 
 from mercurial import encoding
 from mercurial import minirst
 from mercurial.commands import table, globalopts
-from mercurial.i18n import _
+from mercurial.i18n import gettext, _
 from mercurial.help import helptable
 from mercurial import extensions
 from mercurial import util
@@ -51,7 +51,7 @@ 
 
     d['cmd'] = cmds[0]
     d['aliases'] = cmd.split("|")[1:]
-    d['desc'] = get_desc(attr[0].__doc__)
+    d['desc'] = get_desc(gettext(attr[0].__doc__))
     d['opts'] = list(get_opts(attr[1]))
 
     s = 'hg ' + cmds[0]
@@ -102,7 +102,7 @@ 
     for extensionname in sorted(allextensionnames()):
         mod = extensions.load(None, extensionname, None)
         ui.write(minirst.subsection(extensionname))
-        ui.write("%s\n\n" % mod.__doc__)
+        ui.write("%s\n\n" % gettext(mod.__doc__))
         cmdtable = getattr(mod, 'cmdtable', None)
         if cmdtable:
             ui.write(minirst.subsubsection(_('Commands')))