Commit Graph

6 Commits

Author SHA1 Message Date
Mads Kiilerich
ecd224f8a0 cleanup: rename check-translation.py checker function - don't hide global var 2014-08-15 16:20:47 +02:00
FUJIWARA Katsunori
8190c758e5 i18n: check equality of initial indentation between msgid and msgstr
Document generation by runrst in "doc" directory may succeed silently,
even though initial indentation is different between msgid and msgstr:
for example, it may be unexpected or missing indentation.

This patch adds the checker to check equality of initial indentation
between msgid and msgstr.

This checker is categorized as "warning" level, because problem
detected by this is not so serious for usual Mercurial usage.
2014-02-15 18:40:39 +09:00
FUJIWARA Katsunori
baee6a2c0f i18n: check equality of tail '::'-ness between msgid and msgstr
Document generation by runrst in "doc" directory may succeed silently,
even though there is the translated message missing tail '::'. In this
case, it uses "<blockquote>" instead of "<pre>" to surround succeeding
text block unexpectedly in generated HTML file.

This patch adds the checker to check equality of tail '::'-ness
between msgid and msgstr.

To detect also msgstr unexpectedly ending with '::', this checker
doesn't have matching regexp against msgid, and is applied on all
msgid/msgstr pairs.

This checker is categorized as "warning" level, because problem
detected by this is not so serious for usual Mercurial usage.
2014-02-15 18:40:39 +09:00
Matt Mackall
68554e4b42 tests: fix missing import in check-translations 2013-12-01 21:24:26 -06:00
Matt Mackall
a7756031f0 tests: fix Mac doctest escape code garbage for check-translations 2013-12-01 20:39:11 -06:00
FUJIWARA Katsunori
3535aee6e1 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.
2013-11-27 22:47:32 +09:00