[Home] [By Thread] [By Date] [Recent Entries]
Well, here is the approach used in the Internationalisation ('I18n')
transformer of the Apache Cocoon project.
It usually uses a namespace prefix of I18n: This 'transformer' is part of the Cocoon pipeline and works on the fly. See http://cocoon.apache.org/2.1/userdocs/i18nTransformer.html Stage One, you wrap up any fragments of text that you want translated in an <I18n:text> element, which has an optional attribute I18n:key. This is the hard part, and very difficult to automate. It needs a certain amount of judgement about how large to make the fragments, and whether to include punctuation, among other things. <I18n:text>Good morning</I18n>, <I18n:text I18n:key = "everyone" >Ladies and Gentlemen</I18n> Stage Two. Your translators, for whatever language, must create a catalog file, which is a kind of phrase book. The 'I18n:key' used here corresponds either to the content above ('Good morning') or the i18m:key already specified. <catalog xml:lang="fr"> <message key="Good morning">Bonjour</message> <message key="everyone">Monseiurs et Madames</message> </catalog> You would have a catalog file for kilingon and any other languages you want. The transformation system has other elements to help: translation of stock ... phrases with parameters, translation of dates. The various files also have to follow a naming convention and be saved in a specific location in the cocoon setup. Robert P. J. Day wrote: it's been a while since i've written anything in XSLT so i'm going to try to explain what a colleague is trying to do, assuming *i* understand it.
|

Cart



