diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-06-09 12:46:00 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-06-09 12:46:00 +0000 |
commit | 595f51cb223503280349b0eb4c4826241ab1402d (patch) | |
tree | b750949270a718c000f7a4fac88e72975d6f612b /src/po | |
parent | 847abc274795104eea3c3345caa45f63b75ca232 (diff) | |
download | vim-git-595f51cb223503280349b0eb4c4826241ab1402d.tar.gz |
updated for version 7.1-312v7.1.312
Diffstat (limited to 'src/po')
-rw-r--r-- | src/po/check.vim | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/po/check.vim b/src/po/check.vim index 50ed9a40f..abe999a4f 100644 --- a/src/po/check.vim +++ b/src/po/check.vim @@ -1,7 +1,8 @@ " Vim script for checking .po files. " -" Go through the file and verify that all %...s items in "msgid" are identical -" to the ones in "msgstr". +" Go through the file and verify that: +" - All %...s items in "msgid" are identical to the ones in "msgstr". +" - An error or warning code in "msgid" matches the one in "msgstr". if 1 " Only execute this if the eval feature is available. @@ -56,6 +57,20 @@ while 1 endif endwhile +" Check that error code in msgid matches the one in msgstr. +" +" Examples of mismatches found with msgid "E123: ..." +" - msgstr "E321: ..." error code mismatch +" - msgstr "W123: ..." warning instead of error +" - msgstr "E123 ..." missing colon +" - msgstr "..." missing error code +" +1 +if search('msgid "\("\n"\)\?\([EW][0-9]\+:\).*\nmsgstr "\("\n"\)\?[^"]\@=\2\@!') > 0 + echo 'Mismatching error/warning code in line ' . line('.') + let error = 1 +endif + if error == 0 echo "OK" endif |