Patchwork [STABLE] i18n: extract doc string of each web commands as translatable one

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 27, 2015, 3:41 p.m.
Message ID <9d7e122ffda3a8deff61.1430149269@feefifofum>
Download mbox | patch
Permalink /patch/8795/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - April 27, 2015, 3:41 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1430149096 -32400
#      Tue Apr 28 00:38:16 2015 +0900
# Branch stable
# Node ID 9d7e122ffda3a8deff618c80d9d413e043fc48c6
# Parent  8015a3cf13805a307b43f22d821cad4824d094ea
i18n: extract doc string of each web commands as translatable one

Before this patch, doc string of each web commands isn't extracted as
translatable one, even though web commands are listed up in "hg help
hgweb".

This patch adds "mercurial/hgweb/webcommands.py" on to arguments of
"i18n/hggettext". "i18nfunctions" added into "webcommands.py" is used
by "i18n/hggettext" to get the list of functions having translatable
doc string.
Matt Mackall - April 27, 2015, 4:34 p.m.
On Tue, 2015-04-28 at 00:41 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1430149096 -32400
> #      Tue Apr 28 00:38:16 2015 +0900
> # Branch stable
> # Node ID 9d7e122ffda3a8deff618c80d9d413e043fc48c6
> # Parent  8015a3cf13805a307b43f22d821cad4824d094ea
> i18n: extract doc string of each web commands as translatable one

Queued for stable, thanks.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -120,6 +120,7 @@ 
 	  mercurial/templatefilters.py mercurial/templatekw.py \
 	  mercurial/templater.py \
 	  mercurial/filemerge.py \
+	  mercurial/hgweb/webcommands.py \
 	  $(DOCFILES) > i18n/hg.pot.tmp
         # All strings marked for translation in Mercurial contain
         # ASCII characters only. But some files contain string
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1318,3 +1318,6 @@ 
     except error.UnknownCommand:
         raise ErrorResponse(HTTP_NOT_FOUND)
     return tmpl('help', topic=topicname, doc=doc)
+
+# tell hggettext to extract docstrings from these functions:
+i18nfunctions = commands.values()