XML and Internationalization...

Deke Smith deke at tallent.com
Mon Nov 9 14:38:11 GMT 1998


Sebastien Sahuc, ssahuc at 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="fact">
>
>    <description lang="english">The factorial method</description>
>    <description lang="french">La méthode factorielle</description>
>    <description lang="spanish">La operacíon factorial</description>
>
>    <param id="Nbr" mode="in" type="int">
>        <description lang="english">The number to pass in</description>
>        <description lang="french">Le nombre à passer</description>
>        <description lang="spanish">El número 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="fact">

    <description xml:lang ="en">The factorial method</description>
    <description xml:lang ="fr">La méthode factorielle</description>
    <description xml:lang ="es">La operacíon factorial</description>

    <param id="Nbr" mode="in" type="int">
        <description xml:lang ="en">The number to pass in</description>
        <description xml:lang ="fr">Le nombre à passer</description>
        <description xml:lang ="es">El número 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 at tallent.com, 615-661-9878
-----------------------------------------------------------------
" The best way to predict the future is to invent it. " 
       - Alan Kay 



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list