Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] xslt and i18n

From: Andrew Welch <andrew.j.welch@--------->
To:
Date: 2/16/2009 6:13:00 PM
Hi Ken,

> I'm supporting fourteen languages for the United Nations Layout Key for
> Invoice, using 14 differently-named top-level stylesheets:
...
> Of course everything is modular and I use the stylesheet importation to
> override the English base strings with whatever strings are available in the
> given language

It's the fallback behaviour that I'm looking for.  For example, given
the key "page.title" and the locale "fr_BE" (Belgian French) then it
should return the value for "fr_BE".  If one doesn't exist it should
return less specific French one (fr_FR... I think) and if that doesn't
exist then a default value (usually the English translation or even
the key itself)

We almost get that using a specific stylesheet and import precedence,
but you need either a) a specific stylesheet for every locale or b)
the host language to pick the appropriate specific stylesheet for any
given locale.  I really want to avoid relying on the host language and
have a pure xslt solution.


> What benefit are you looking for by which improvement could be measured?

Usability improvements.  For example, in Java there are "Resource
Bundles" - to support a new language you just drop an appropriately
named properties files into the right place and that's it.

In JavaFX, it's the same but inbuilt into the syntax itself.

In XSLT we should be able to implement localisation support without
relying on extensions (and keeping the 1 file per locale approach)...
With the template matching example I posted, it gives us the the
fallback mechanism, but (assuming the templates are suitably separated
into files and then included) relies on all the includes being
explicitly included in the primary stylesheet.  This means adding
support for a new locale requires modification of the primary
stylesheet as well dropping the locale specific file into the right
place.... not awful but not great either.



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent