[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: multilingual web site

Subject: Re: multilingual web site
From: "B. Dexheimer" <benjamin.dexheimer@xxxxxxxxxxxxxxxxxx>
Date: Tue, 06 Mar 2001 10:05:18 +0100
xml multilingual website
I had to deal with the same issue.
Here's what I designed as a multi-language xml structure : 

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<?xml-stylesheet type="text/xml"?>

<PAGE name="the_html_page" content="shtml">
  <TEXT xml:lang='en'>
    <LABEL NEW="no" label_id="1">the first english label of the
page</LABEL>
    ...
  </TEXT>
  <TEXT xml:lang='fr'>
    <LABEL NEW="no" label_id="1">the same first label but in
french</LABEL>
    ...
  </TEXT>
  ...
</PAGE>

and the following piece of xsl processing code :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:xt="http://www.jclark.com/xt"
		extension-element-prefixes="xt">
<xsl:output method="html"/>

<xsl:template match="PAGE">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="TEXTE">
  <xt:document method="html" href="{$page}.{$extension}.{@xml:lang}">
  // the HTML code of the page with
   <xsl:apply-templates select="LABEL[@label_id='1']"/>
  // for inserting labels at the good place
  </xt:document>
</xsl:template>

<xsl:template match="LABEL">
  <xsl:value-of select="."/>
</xsl:template>

You get all the languages packed in only one xml file. the "xt:document"
command allows you to generate physically an html file per language.

I'm already interested by a tool which could automate the work of 
separating labels and html code. I haven't still found no other solution
than writing a perl script or doing it by hand (sigh!).

hope this helps, 

BeNj


> Hi,
> 
> I'm a software engineer and am looking
> for ways to make the internationalization of our web site
> more managable. Currently we maintain seperate html
> documents for each lanaguage. Since the layout of the documents
> is very similar (just the displayed text
> differs in language) I figured there must be a mechanism
> for maintaining a single html document and generating the
> translated html documents from this single document. I'm
> thinking of using xml & xslt as a possible solution. Has
> anyone used similar solutions ?
> I would greatly appreciate any suggestions on this issue
> or if someone could point me to other resources.
> Something with examples would be great.
> 
> I'm envisioning a solution such as:
> 
> an xml file with the following:
> <pagetitle>MY PAGE TITLE IN ENGLISH<pagetitle>
> 
> which would be translated into:
> <pagetitle>MY PAGE TITLE IN ANOTHER LANGUAGE<pagetitle>
> 
> and an XSL (or XSLT) file which would take this XML file and translate
> it into and HTML page.
> 
> We have hundreds of HTML pages and it would be awsome if there
> was a tool out there that could make something like this easier for us.
> 
> Thanks in advance :-)
> -Sher
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.