[Imps] i18n message discussion

Sam Ruby rubys at intertwingly.net
Mon Jan 15 00:39:26 PST 2007


Just tossing this out for discussion...

Typical error in html5lib:

   self.parser.parseError(_("Unexpected end of file. Expected end "
     u"tag (" + self.tree.openElements[1].name + u") first."))

Typical error in feedvalidator:

   self.log(UndefinedNamedEntity({'value':name}))

Discussion: in the feedvalidator, each class of error is mapped to a 
Python class, and a parameterizable.  The unit tests can verify that a 
specific error is (or is not) generated, and can even match on parameters.

At runtime, each error class is mapped to a sprintf type of string, 
which can be language specific.

The validator also uses the class name as the name of an html page which 
can contain more information and pointers to spec text or other information.

Obviously, the reason why I am bringing this up is that I prefer the 
feedvalidator approach (credit due to Mark Pilgrim).

- Sam Ruby



More information about the Implementors mailing list