Mercurial > hg
diff tests/test-i18n.t @ 20152:84939b728749 stable
i18n: add the tool to check Mercurial specific translation problems in *.po
Existing tool like "msgfmt --check" can check typical translation
problems (missing "%s" in msgstr, for example), but can't check
Mercurial specific ones.
For example, "msgfmt --check" can't check whether the translated
string given to "ui.promptchoice()" is correct or not, even though
problems like below cause run-time error or unexpected behavior:
- less or more choices than msgid,
- choices without '&', or
- choices with '&' followed by none
This patch adds the tool to check Mercurial specific translation
problems in *.po files.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 27 Nov 2013 22:47:32 +0900 |
parents | 73d20de5f30b |
children | b9e7af5bd5e5 |
line wrap: on
line diff
--- a/tests/test-i18n.t Wed Nov 27 22:32:01 2013 +0100 +++ b/tests/test-i18n.t Wed Nov 27 22:47:32 2013 +0900 @@ -38,3 +38,10 @@ pager Verwendet einen externen Pager zum Bl\xc3\xa4ttern in der Ausgabe von Befehlen (esc) +Check Mercurial specific translation problems in each *.po files, and +tool itself by doctest + + $ cd "$TESTDIR"/../i18n + $ python check-translation.py *.po + $ python check-translation.py --doctest + $ cd $TESTTMP