[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSL and localization
Hi all,
I want to introduce localization possibilities in my xsl transformations. To do that, I created a directory "locale" with a subdirectory for each lang "en", "es", "fr", "de" where I put xml files with translated text. The information of the lang to use is in my data xml file. To retrieve the good translation file, I use something like : <xsl:variable name="labels" select="document(concat('locale/', /*/@lang,'/test_locale.xml'))//label" /> To retrieve a label I use : <xsl:value-of select="$labels[@id='ALabelId']"/> My problem is when the translation file doesn't exist. I'd like to choose a default file in this case : If in my data file the "lang" parameter = "fr" then use the labels in file locale/fr/test_locale.xml. If this file doesn't exist, I want to use the file locale/en/test_locale.xml. Is this possible and how ? Is there a better way to implement localization ?
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|