Mismatched c-format specifiers
friedel at translate.org.za
Wed Sep 9 13:09:37 EDT 2009
Op Ma, 2009-09-07 om 18:29 -0700 skryf Mark Doliner:
> Elliott 'QuLogic' Sales de Andrade noticed that a few of our
> translations had mismatched format specifiers (the %s and %d bits in
> some strings). This can cause a crash when the string is formatted.
> For example, if you simply change the order of %s and %d then Pidgin
> will try to print a number as a string, which is bad. This email is a
> friendly reminder to please be careful with c-format strings.
> You can run the check_po.pl script to detect these problems. This
> script can be found in the po/ subdirectory of the Pidgin source code.
> > check_po.pl <your_language.po>
What does this do differently than msgfmt -cv? All translators should
be checking that before submitting translations. To my best knowledge,
in the GNOME project there is a pre-commit hook to disallow commits
of .po files that don't pass msgfmt -cv.
Apart from avoiding crashing situations, I would encourage translators
to also look at pofilter which allows for testing several other issues
that might help to improve quality:
Recently on my blog:
More information about the Translators