Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Florent Georges <darkman_spam <at> yahoo.fr>
Subject: Re: Multilanguage help
Newsgroups: gmane.text.xml.xsl.general.mulberrytech
Date: Wednesday 22nd February 2006 20:49:44 UTC (over 11 years ago)
António Mota wrote:

> Extremely easy to do with the document() function. I
> don't have my XML tools here but from the top of my
> head it's something like this:

> Supose you have a XML like this

> xml_pt.xml

> 
>     Descrição
>    (...)
> 

> then, in your xsl you should have something that tell
> what the language to translate to, a param for instance.
> Supose you pass 'pt' to it.

> 
>  select="concat('/filepath/xml_',$lang,'.xml') />

  It's a way of doing this, sure.  And it works quite well for very
simple cases.  But the problem with I18N and L10N is the order of the
variable pieces of text, like amounts, numbers of chapter, nouns, etc.
(and it unfortunately always occurs while the L10N step).

  What I did here is the following.  I have such variables in my XSLT
script (the script is generated, but you can use doc() if you want,
this doens't matter):

    
      
        Un peu de texte.
        Chapitre 
      
      
        Some text.
        Chapter 
      
    

    

  The example doesn't show the order problem, but I trust your
imagination.  In the document, I have elements like these:

    
      <param name="num" select="..."/>
    
    

  With the help of a few functions for retrieving the right entry and
resolve the parameters, you get a more robust system, IMHO.  And you
can easily extend the parameters system.  I have for example 'choice'
elements (sort of hashtables):

    ... 
      ...

    
      
    

as well as more specific formating elements:

    
      
I'm sure other improvements can be done. Like putting the format string for an address in the placeholder in the entry, for example: ... ... Regards, --drkm ___________________________________________________________________________ Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez sur http://fr.messenger.yahoo.com --~------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: --~--
 
CD: 18ms