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 : [xsl] switching between multiple languages in XSL
Newsgroups: gmane.text.xml.xsl.general.mulberrytech
Date: Tuesday 27th June 2006 21:42:42 UTC (over 11 years ago)
Jason Viers wrote:

  Hi

> We're transforming a XML file to HTML via XSL, and we'd
> like the XSL to be usable across multiple languages.  The
> XML file being transformed does _not_ have the text we'd
> like to select between, just an indication as to what
> language should be used.  There are things like static

  If I understand right your problem, you can use external
XML files, dictionnaries, containing the actual translated
sentences.  You'll access them via document(), for example
document(concat('i18n/dico-', $i18n-lang, '.xml')) where
$i18n-lang is the language name, for example 'EN', selected
in your input document, and the 'i18n' directory having a
file named 'dico-.xml', a dictionnary, for each
supported languages.

  Depending on your problem, the dictionnaries can be a flat
set of named entries, or a highly structured XML document
organizing the entries.  From my little experience, I
recommend a flat dictionnary, where structure can instead be
introduced in the entry names.  But it depends on a lot of
things we don't know here IMHO.

  So to be a little more concrete:

    
    
    
    
    
      
      
    

    
    
      The actual text.
      Other text.
      ...
    

  But a common problem with I18N is the placement in
variable text, as dates and other numbers extracted from
your input tree for example.  So you'll need a way to
parametrize the entries.  You can put named place holders in
the entries, with empty elements:

    This page was last
      modified on .

and in XSLT:

    

    
      
      
        
      
    

  These are basic ideas I use each day in my work.  All that
depends on your specific needs.  I think I already post a
message on XSL List describing all that.  You can search the
archives.

  Regards,

--drkm


































	

	
		
___________________________________________________________________________

Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son
interface révolutionnaire.
http://fr.mail.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: 69ms