W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > May 2007

ACTION: implement the XSLT-based solution for I18N

From: Roland Gülle <roland@7val.com>
Date: Wed, 23 May 2007 16:37:43 +0200
Message-Id: <725E8CF1-2F58-4411-9879-3D817A0F89F3@7val.com>
To: public-mobileok-checker@w3.org

A XSLT-based solution (only for one test) for I18N is in CVS [1] now.

How it works:
There is a default XML document 'messages.properties.xml' [2] and a  
file for each language.

To use a text/message in XSLT, you have to add the namespace  
xmlns:moki="http://moki.mobi/2007/v0.1" and the include <xsl:include  
href="functions.xsl"/>.
Now use the new XPath function "moki:msgI18n(KEY, LANGUAGE)".

If the language file is not available, or the key is not defined in  
the language file, the function selects the key from the default  
document 'messages.properties.xml'.
If the key is there also not available, an error message is returned.

You can test it with the ImageMapsTest [4].
One value is returned from the language file, one from the default  
XML and one error message.

  Roland

[1] http://dev.w3.org/cvsweb/2007/mobileok-ref/src/org/w3c/mwi/ 
mobileok/basic/xslt/ImageMapsTest.xsl
[2] http://dev.w3.org/cvsweb/2007/mobileok-ref/src/org/w3c/mwi/ 
mobileok/basic/xslt/messages.properties.xml
[3] http://dev.w3.org/cvsweb/2007/mobileok-ref/src/org/w3c/mwi/ 
mobileok/basic/xslt/functions.xsl
[4] cvs/mobileok-ref/src/org/w3c/mwi/mobileok/basic/xslt$ java - 
jar ../../../../../../../lib/saxon8.jar ../../../../../../../test/ 
data/ROOT/ImageMapsTest/2/moki.xml ImageMapsTest.xsl language=de
Received on Wednesday, 23 May 2007 14:38:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:13:03 GMT