Patchwork templater: tell hggettext to collect help of template functions

login
register
mail settings
Submitter Yuya Nishihara
Date April 3, 2015, 1:38 p.m.
Message ID <c02f87bdcca13189ddc4.1428068328@mimosa>
Download mbox | patch
Permalink /patch/8477/
State Accepted
Commit ba5dcc448f914d1fc24a98422460a57024cb02a2
Headers show

Comments

Yuya Nishihara - April 3, 2015, 1:38 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1428064599 -32400
#      Fri Apr 03 21:36:39 2015 +0900
# Node ID c02f87bdcca13189ddc4b7ffe3c9c1d3495f84ea
# Parent  916dd2c469982d3254caceb30ee8fe2d67813cac
templater: tell hggettext to collect help of template functions
Augie Fackler - April 3, 2015, 3:04 p.m.
On Fri, Apr 03, 2015 at 10:38:48PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1428064599 -32400
> #      Fri Apr 03 21:36:39 2015 +0900
> # Node ID c02f87bdcca13189ddc4b7ffe3c9c1d3495f84ea
> # Parent  916dd2c469982d3254caceb30ee8fe2d67813cac
> templater: tell hggettext to collect help of template functions

Queued, thanks.

>
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -118,6 +118,7 @@ i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n
>         hgext/*.py hgext/*/__init__.py \
>         mercurial/fileset.py mercurial/revset.py \
>         mercurial/templatefilters.py mercurial/templatekw.py \
> +       mercurial/templater.py \
>         mercurial/filemerge.py \
>         $(DOCFILES) > i18n/hg.pot.tmp
>          # All strings marked for translation in Mercurial contain
> diff --git a/mercurial/templater.py b/mercurial/templater.py
> --- a/mercurial/templater.py
> +++ b/mercurial/templater.py
> @@ -793,3 +793,6 @@ def stylemap(styles, paths=None):
>                      return style, mapfile
>
>      raise RuntimeError("No hgweb templates found in %r" % paths)
> +
> +# tell hggettext to extract docstrings from these functions:
> +i18nfunctions = funcs.values()
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -118,6 +118,7 @@  i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n
 	  hgext/*.py hgext/*/__init__.py \
 	  mercurial/fileset.py mercurial/revset.py \
 	  mercurial/templatefilters.py mercurial/templatekw.py \
+	  mercurial/templater.py \
 	  mercurial/filemerge.py \
 	  $(DOCFILES) > i18n/hg.pot.tmp
         # All strings marked for translation in Mercurial contain
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -793,3 +793,6 @@  def stylemap(styles, paths=None):
                     return style, mapfile
 
     raise RuntimeError("No hgweb templates found in %r" % paths)
+
+# tell hggettext to extract docstrings from these functions:
+i18nfunctions = funcs.values()