Re: XML and Internationalization...

Deke Smith (deke@tallent.com)
Mon, 9 Nov 98 08:30:15 -0600


Sebastien Sahuc, ssahuc@netaway.com said on 11/9/98 4:57 AM:

>Hi there,
>
>I wonder if there is any specifications available in making XML documents
>multilingual.
>
>For instance, I have a xml document that specifies some operations =
available
>to the user (the selection of the operation to call is done through a =
GUI).
>As a small description is associated to each operation, it should be =
useful
>to give the user this description in the custom language.
>
>My first thought will be the following:
>...
><method id=3D"fact">
>
> <description lang=3D"english">The factorial method</description>
> <description lang=3D"french">La m=E9thode factorielle</description>
> <description lang=3D"spanish">La operac=EDon factorial</description>
>
> <param id=3D"Nbr" mode=3D"in" type=3D"int">
> <description lang=3D"english">The number to pass in</description>
> <description lang=3D"french">Le nombre =E0 passer</description>
> <description lang=3D"spanish">El n=FAmero a calcular</description>
> </param>
>
></method>
>...
>
>Does anybody has a suggestion auround the syntax ? Any comment would be
>greatly appreciate.
>

I would suggest one change to your syntax: there is a standard tag =
for language specification in XML. That tag is "xml:lang" and it uses =
ISO 639 language codes. You can find the language codes at < =
http://www.isoc.org:8080/langues/iso639.fr.htm>.

Your sample would look like:

...
<method id=3D"fact">

<description xml:lang =3D"en">The factorial method</description>
<description xml:lang =3D"fr">La m=E9thode =
factorielle</description>
<description xml:lang =3D"es">La operac=EDon =
factorial</description>

<param id=3D"Nbr" mode=3D"in" type=3D"int">
<description xml:lang =3D"en">The number to pass =
in</description>
<description xml:lang =3D"fr">Le nombre =E0 =
passer</description>
<description xml:lang =3D"es">El n=FAmero a =
calcular</description>
</param>

</method>
...

In the XML spec it talks a little bit more about language =
specification:
<http://www.w3.org/TR/1998/REC-xml-19980210#sec-lang-tag>

A MUCH more complicated translation format can be found from LISA at:
<http://www.lisa.org/tmx/index.html>. This may or may not be overkill =
for what you are doing.

Deke

-----------------------------------------------------------------
Deke Smith
Tallent Communications Group, Brentwood TN
deke@tallent.com, 615-661-9878
-----------------------------------------------------------------
" The best way to predict the future is to invent it. "
- Alan Kay