From: Bjoern V. <bj...@cs...> - 2006-02-14 11:43:18
|
Richard Laager wrote: > What is it that check_po.pl does that msgfmt -c doesn't? > =20 I think "msgfmt -c" only finds hard errors in .po files. In most cases,=20 the "msgfmt -c" errors prevent the compilation, if they are not fixed: An example: #: ../src/ft.c:442 #, c-format msgid "%s is not a valid filename.\n" msgstr "%s ist kein g=FCltiger Dateiname." Because of the missing line ending ("\n") the file can not be compiled. $ msgfmt -c de.po de.po:2121: `msgid' and `msgstr' entries do not both end with '\n' msgfmt: found 1 fatal error $ make file=3D`echo de | sed 's,.*/,,'`.gmo && rm -f $file && /usr/bin/msgfmt -o $file de.po de.po:2121: `msgid' and `msgstr' entries do not both end with '\n' /usr/bin/msgfmt: found 1 fatal error *** Error code 1 check_po.pl is more a "lint" tool for gettext. It finds very much=20 possible problems in .po files (from check_po.pl): # Various checks on po file translations: # - printf-style format strings; # - differences in trailing newlines; # - empty (non-fuzzy) msgid; # - likely whitespace errors on joining multi-line entries # Ignores all fuzzy entries. # # Options: # -x Don't do standard checks above (eg, just check one of below). # -n Check newlines within strings; ie, that have equal numbers # of newlines in msgstr and msgid. (Optional because this may # happen legitimately.) # -w Check leading whitespace. Sometimes whitespace is simply # spacing (eg, for widget labels etc), or punctuation difference= s, # so this may be ok. # -W Check trailing whitespace. See -w above. # -p Check trailing punctuation. # -c Check capitalization of first non-whitespace character # (only if [a-zA-Z]). # -e Check on empty (c.q. new) msgstr I use both tools with the following options: msgfmt: $ LANG=3DC msgfmt --check --check-accelerators=3D_ -c de.po This does the standard checks (-c|--check) and also checks presence of=20 keyboard accelerators for menu items. check_po.pl: ./check_po.pl -xnwWpce de.po This does not do the standard checks (because I don't want to see all=20 the "*** Possible non-whitespace line-join problem in msgstr" warnings - = I think this are false-positives). But it checks for other problems like = different trailung punctuations. See above for the meanings of the other = switches. Dear translators: Please use both tools. Especially check_po.pl shows=20 many false-positives. But in most cases, this tools also find "real"=20 problems. Regards, Bj=F6rn |