[PATCH 1 of 3 STABLE] i18n: fix "% inside _()" problems
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Mon Apr 14 09:11:17 CDT 2014
On 04/13/2014 09:32 AM, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1397394948 -32400
> # Sun Apr 13 22:15:48 2014 +0900
> # Branch stable
> # Node ID 6c252c9898beaedcf3230741445310b0071e5cb4
> # Parent 469d949a7cb8d20e0fee7464c3b12dcac1e55d4c
> i18n: fix "% inside _()" problems
I started to reviewing this series, but my brain started digging an
escape tunnel in the back of my head.
Here are a few things that would prevent brain melt down when reading it:
1. split the actual fix in core from the checkcode addition: The flow
would be:
a. Fixing this silly issue easy to understand
b. Adding a new brain melting regexp to catch it
c. Fixing another silly issue
d. Another crazy regexp
e. Fixing a third silly issue
f. Introduce the mother of all regexp
2. includes examples of undetected bad behavior. Typical message I would
expect:
check-code: detect blablabla when % are aligned with pluto and alpha
centaury
This changeset add regexp to catch these errors:
_("lks;kgfd;lksgklds" % ";ldfklgskgf;lkds")
_("lks;kgfd;lksgklds" % (";ldfklgskgf;lkds", 56))
New need to add this insane regexp because the previous crazy regexp
did not take in accout … (rest of the brain melting explanation)
3. add a corresponding test when adding the check code rules (missing in
patches 1)
Those patch are however much welcome. Looking forward to challenge my
mind again with V2)
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list