to, 2009-11-12 kello 11:48 -0500, Jeremy Katz kirjoitti:
> Does msgfmt -c do the right thing to ensure that the format strings
> given in the translated versions match with the expected format
> strings now?  The last time I looked, it didn't do so for python which
> (to me) was a strong reason _against_ using any of the format string
> methods for string substitution.  If msgfmt -c doesn't catch it[1],
> then the outcome of a typo in a po file is a crash for users of that
> language :-/

I did a quick test:

msgid "%(title)s %(lastname)s %(firstname)s"
msgstr "%(titl)s %(lastname)s %(firstname)s"

msgfmt -c says "a format specification for argument 'titl', as in
'msgstr', doesn't exist in 'msgid'"

msgid "%(title)s %(lastname)s %(firstname)s"
msgstr "%s %(lastname)s %(firstname)s"

msgfmt -c says "'msgstr' is not a valid Python format string, unlike
'msgid'. Reason: The string refers to arguments both through argument
names and through unnamed argument specifications."

msgid "%(title)s %(lastname)s %(firstname)s"
msgstr "%s %s %s"

msgfmt -c says "format specifications in 'msgid' expect a mapping, those
in 'msgstr' expect a tuple"

This is on gettext-0.17-15.fc12. I guess we could start using format
strings now?

-- 
Ville-Pekka Vainio

_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to