Patchwork [5,of,7,STABLE] i18n: add i18n comment to error messages of template functions

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 31, 2014, 5:46 p.m.
Message ID <8a243c5a3a168c21f349.1414777605@feefifofum>
Download mbox | patch
Permalink /patch/6498/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Oct. 31, 2014, 5:46 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1414777388 -32400
#      Sat Nov 01 02:43:08 2014 +0900
# Branch stable
# Node ID 8a243c5a3a168c21f349371698403da634a83e79
# Parent  0dae9147c3b6bd1a854734cdadc13910e6b9b85e
i18n: add i18n comment to error messages of template functions
Martin Schröder - Oct. 31, 2014, 7:46 p.m.
On 31. Oktober 2014 18:46:45 MEZ, FUJIWARA Katsunori <foozy@lares.dti.ne.jp> wrote:
># HG changeset patch
># User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
># Date 1414777388 -32400
>#      Sat Nov 01 02:43:08 2014 +0900
># Branch stable
># Node ID 8a243c5a3a168c21f349371698403da634a83e79
># Parent  0dae9147c3b6bd1a854734cdadc13910e6b9b85e
>i18n: add i18n comment to error messages of template functions
>
>diff --git a/mercurial/templater.py b/mercurial/templater.py
>--- a/mercurial/templater.py
>+++ b/mercurial/templater.py
>@@ -217,6 +217,7 @@
> 
> def date(context, mapping, args):
>     if not (1 <= len(args) <= 2):
>+        # i18n: "date" is a keyword
>         raise error.ParseError(_("date expects one or two arguments"))
> 
>     date = args[0][0](context, mapping, args[0][1])
>@@ -244,6 +245,7 @@
> 
> def fill(context, mapping, args):
>     if not (1 <= len(args) <= 4):
>+        # i18n: "fill" is a keyword
>        raise error.ParseError(_("fill expects one to four arguments"))
> 
>     text = stringify(args[0][0](context, mapping, args[0][1]))
>@@ -254,6 +256,7 @@
>         try:
>       width = int(stringify(args[1][0](context, mapping, args[1][1])))
>         except ValueError:
>+            # i18n: "fil" is a keyword

Here is a typo.

>             raise error.ParseError(_("fill expects an integer width"))
>         try:
>      initindent = stringify(_evalifliteral(args[2], context, mapping))
>@@ -267,6 +270,7 @@
>     """usage: pad(text, width, fillchar=' ', right=False)
>     """
>     if not (2 <= len(args) <= 4):
>+        # i18n: "pad" is a keyword
>       raise error.ParseError(_("pad() expects two to four arguments"))
> 
>     width = int(args[1][1])
>@@ -422,6 +426,7 @@
>     """usage: shortest(node, minlength=4)
>     """
>     if not (1 <= len(args) <= 2):
>+        # i18n: "shortest" is a keyword
>   raise error.ParseError(_("shortest() expects one or two arguments"))
> 
>     node = stringify(args[0][0](context, mapping, args[0][1]))
>@@ -471,6 +476,7 @@
> 
> def strip(context, mapping, args):
>     if not (1 <= len(args) <= 2):
>+        # i18n: "strip" is a keyword
>        raise error.ParseError(_("strip expects one or two arguments"))
> 
>     text = stringify(args[0][0](context, mapping, args[0][1]))
>_______________________________________________
>Mercurial-devel mailing list
>Mercurial-devel@selenic.com
>http://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - Oct. 31, 2014, 8:42 p.m.
On Fri, 2014-10-31 at 20:46 +0100, Martin Schröder wrote:
> 
> On 31. Oktober 2014 18:46:45 MEZ, FUJIWARA Katsunori <foozy@lares.dti.ne.jp> wrote:
> ># HG changeset patch
> ># User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> ># Date 1414777388 -32400
> >#      Sat Nov 01 02:43:08 2014 +0900
> ># Branch stable
> ># Node ID 8a243c5a3a168c21f349371698403da634a83e79
> ># Parent  0dae9147c3b6bd1a854734cdadc13910e6b9b85e
> >i18n: add i18n comment to error messages of template functions

Fixed in flight, thanks.

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -217,6 +217,7 @@ 
 
 def date(context, mapping, args):
     if not (1 <= len(args) <= 2):
+        # i18n: "date" is a keyword
         raise error.ParseError(_("date expects one or two arguments"))
 
     date = args[0][0](context, mapping, args[0][1])
@@ -244,6 +245,7 @@ 
 
 def fill(context, mapping, args):
     if not (1 <= len(args) <= 4):
+        # i18n: "fill" is a keyword
         raise error.ParseError(_("fill expects one to four arguments"))
 
     text = stringify(args[0][0](context, mapping, args[0][1]))
@@ -254,6 +256,7 @@ 
         try:
             width = int(stringify(args[1][0](context, mapping, args[1][1])))
         except ValueError:
+            # i18n: "fil" is a keyword
             raise error.ParseError(_("fill expects an integer width"))
         try:
             initindent = stringify(_evalifliteral(args[2], context, mapping))
@@ -267,6 +270,7 @@ 
     """usage: pad(text, width, fillchar=' ', right=False)
     """
     if not (2 <= len(args) <= 4):
+        # i18n: "pad" is a keyword
         raise error.ParseError(_("pad() expects two to four arguments"))
 
     width = int(args[1][1])
@@ -422,6 +426,7 @@ 
     """usage: shortest(node, minlength=4)
     """
     if not (1 <= len(args) <= 2):
+        # i18n: "shortest" is a keyword
         raise error.ParseError(_("shortest() expects one or two arguments"))
 
     node = stringify(args[0][0](context, mapping, args[0][1]))
@@ -471,6 +476,7 @@ 
 
 def strip(context, mapping, args):
     if not (1 <= len(args) <= 2):
+        # i18n: "strip" is a keyword
         raise error.ParseError(_("strip expects one or two arguments"))
 
     text = stringify(args[0][0](context, mapping, args[0][1]))