Patchwork [3,of,3] check-po: test i18n/*.po

login
register
mail settings
Submitter timeless@mozdev.org
Date June 30, 2013, 8:03 a.m.
Message ID <3ed128d2cc754cdc0ee7.1372579423@timeless.localhost>
Download mbox | patch
Permalink /patch/1771/
State RFC, archived
Headers show

Comments

timeless@mozdev.org - June 30, 2013, 8:03 a.m.
# HG changeset patch
# User timeless@mozdev.org
# Date 1372578794 14400
#      Sun Jun 30 03:53:14 2013 -0400
# Node ID 3ed128d2cc754cdc0ee71fabb535972ee0434935
# Parent  1dd78724f4ee19fa047afc171e5380d01629f939
check-po: test i18n/*.po
timeless - July 3, 2013, 12:02 p.m.
On Tuesday, July 2, 2013, Kevin Bullock <kbullock+mercurial@ringworld.org>
wrote:
> This output doesn't strike me as particularly meaningful. Why would we
have it print stats instead of the actual warnings? Or, if these _are_ the
errors/warnings, why don't they look as such?

There is a mode where it will spit out the identifiers, but many of them
are multiple lines long. If I included the translation too (which is often
many screens long), then you risk encoding/font pain in addition.

You can try the other mode and see if it is more valuable.

Since we're talking about errors, and everyone can get them because they
are committed in the repository, a shorthand seemed reasonable - why bother
wasting repository space on the long form of what is essentially BAD data.

I should have flagged the whole set as RFC. This was my first patch bomb in
a long time.

Thanks for taking the time to read the patch.
Matt Mackall - July 19, 2013, 4:46 a.m.
On Wed, 2013-07-03 at 08:02 -0400, timeless wrote:
> On Tuesday, July 2, 2013, Kevin Bullock <kbullock+mercurial@ringworld.org>
> wrote:
> > This output doesn't strike me as particularly meaningful. Why would we
> have it print stats instead of the actual warnings? Or, if these _are_ the
> errors/warnings, why don't they look as such?
> 
> There is a mode where it will spit out the identifiers, but many of them
> are multiple lines long. If I included the translation too (which is often
> many screens long), then you risk encoding/font pain in addition.
> 
> You can try the other mode and see if it is more valuable.
> 
> Since we're talking about errors, and everyone can get them because they
> are committed in the repository, a shorthand seemed reasonable - why bother
> wasting repository space on the long form of what is essentially BAD data.
> 
> I should have flagged the whole set as RFC. This was my first patch bomb in
> a long time.

This all looks very promising. I'd like to see us fix most of the errors
before baking the numbers into a test though. Let's get the tool in
early in the next cycle.

Patch

diff -r 1dd78724f4ee -r 3ed128d2cc75 tests/test-check-po-hg.t
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-check-po-hg.t  Sun Jun 30 03:53:14 2013 -0400
@@ -0,0 +1,26 @@ 
+  $ check_po="$TESTDIR"/../i18n/check-po.py
+  $ cd "$TESTDIR"/..
+  $ if hg identify -q > /dev/null 2>&1; then :
+  > else
+  >     echo "skipped: not a Mercurial working dir" >&2
+  >     exit 80
+  > fi
+
+ New errors are not allowed. Warnings are strongly discouraged.
+
+  $ hg manifest 2>/dev/null \
+  >   | grep \\.po$ \
+  >   | xargs python $check_po \
+  >   || false
+  i18n/da.po errors: breakafter: 5, paragraphs: 1, replacements: 8, rstsection: 1
+  i18n/de.po errors: breakafter: 4, paragraphs: 1, replacements: 9, rstsection: 5
+  i18n/el.po errors: breakafter: 34, paragraphs: 35, replacements: 2
+  i18n/fr.po errors: breakafter: 6, paragraphs: 37, replacements: 5, rstsection: 11
+  i18n/it.po errors: breakafter: 2
+  i18n/ja.po errors: replacements: 1
+  i18n/pt_BR.po errors: replacements: 3, rstsection: 2
+  i18n/ro.po errors: breakafter: 1, replacements: 1, rstsection: 6
+  i18n/ru.po errors: paragraphs: 3, replacements: 1, rstsection: 5
+  i18n/sv.po errors: rstsection: 1
+  i18n/zh_CN.po errors: breakafter: 14, paragraphs: 48, replacements: 20, rstsection: 9
+  i18n/zh_TW.po errors: replacements: 2