Re: [xml] Localizing the validation messages

On Thu, Nov 08, 2012 at 02:16:52PM -0500, Patrick wrote:
Our technical customers do not want to see English messages when the
documents they tag do not conform to the XSD schema defined. The
tool uses lxml which I understand is a pythonic binding to libxml2.

They want the XML validation messages in their language.

So, not

Element 'b': Element content is not allowed, because the type
definition is simple.

but, for instance,

Élément 'b' : Pas de contenu d'élément permis, parce que la
définition de type est simple.
Elemento 'b': Elemento de contenido no está permitido, ya que la
definición de tipo es simple.

I believe localization of libxml2 has not been implemented, is that
still true? How hard would it be to do?

 You can localize on top of libxml2.
The structured error handler should give you everything you need
to implement your own localization.
I'm not sure I want to do this in libxml2, due to dependencies,
portability and the fact that it's a developper toolkit, not the
right level to emit user level messages.


Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]