Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
3226ed45
Commit
3226ed45
authored
10 years ago
by
Katsunori FUJIWARA
Browse files
Options
Downloads
Patches
Plain Diff
i18n: add i18n comment to error messages of template functions
parent
0dae9147
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mercurial/templater.py
+6
-0
6 additions, 0 deletions
mercurial/templater.py
with
6 additions
and
0 deletions
mercurial/templater.py
+
6
−
0
View file @
3226ed45
...
...
@@ -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: "fill" 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
]))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment