[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: status: EDUML v0.6
> <locale> // internationalization (optional)
> <school fr="ecole" es="escuela" eo="lernejo"/>
...
I'm not sure my original comments on this subject made it out, or maybe
I just got overruled, but I'll say it again in case. If you want to go
this way, and assign the languages as attributes, then you lock yourself
into a set of languages for good. If in the above example somebody
wanted to add "it" for "Italian", then the DTD would have to be recoded,
as well as all the software that reads it.
More flexible, though perhaps more work as well, would be to create a
dictionary something like this:
<dictionary>
<word lang="en"> <!-- "language the base is coded in" -->
<base>name</base>
<alternate lang="fr">nom</alternate>
<alternate lang="es">nombre</alternate>
<alternate lang="eo">nomo</alternate>
</word>
<word>
<base>school</base>
</word>
...
</dictionary>
That way your dtd is language independent, and translating the tags is a
relatively straightforward algorithm:
if (tagname IN getDictionary().getBaseWords()):
for a in getDictionary().getWord(tagName).getAlternates:
if (a.lang == desiredLanguage): return a.getText()
or something like that. It also encapsulates all the translation info
in one spot, so if you don't want to internationalize, just don't add a
dictionary element.
Duane
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com