Peter Donald wrote: > On Wed, 28 Aug 2002 22:53, Nicola Ken Barozzi wrote: > >>Ok, I understand the need, but then, why under the attributes? >>Why not a <description> taga ala Ant, it doesn't seem like a generic >>attribut to me... > > > The problem is when you want to do i18n of the description. Currently it is > done via > > <!-- use the following if you dont care about i18n --> > <attribute name="doc:description" value="Some description" /> > > <!-- use the following if you do care about i18n. --> > <attribute name="doc:description-key" value="my.key" /> > > <!-- > Note that you would have to include a resources > file side-by-side the info file with the name > MyClassNameInfo.*. However you could overide > the location of the Info file via > --> > <attribute name="doc:i18n-bundle" value="MyClassNameInfo2" /> > > I think I would prefer a description element, but how would you deal with the > above?
There are various options, here are the most relevant: XML language identification ----------------------------- http://www.w3.org/TR/REC-xml#sec-lang-tag <description> <p xml:lang="en">The quick brown fox jumps over the lazy dog.</p> <p xml:lang="en-GB">What colour is it?</p> <p xml:lang="en-US">What color is it?</p> <sp who="Faust" desc='leise' xml:lang="de"> <l>Habe nun, ach! Philosophie,</l> <l>Juristerei, und Medizin</l> <l>und leider auch Theologie</l> <l>durchaus studiert mit hei�em Bem�h'n.</l> </sp> </description> Comment: standard, but not flexible enough. Cocoon i18n tags: ------------------ http://xml.apache.org/cocoon/userdocs/transformers/i18n-transformer.html <description> <para title="first" name="article" i18n:attr="title name"> <i18n:text>This text will be translated.</i18n:text> </para> <i18n:text i18n:key="key_text">Default value</i18n:text> <i18n:translate> <i18n:text>Some {0} was inserted {1}.</i18n:text> <i18n:param>text</i18n:param> <i18n:param>here</i18n:param> </i18n:translate> </description> Comment: important features are: - Attribute translation - Param substitution It's more flexible and already has a Transformer to do the work, also from an i18n file Since Morphos can easily be made to use Cocoon Components, it can easily be used as a MorpherAntTask to do the transformations. I would go with the Cocoon stuff, since it can make us comment also with attributes and translate it, and use an external resource bundle. We could just use a standard name for the bundle, keep english stuff in the descriptor and a key for external translations. -- Nicola Ken Barozzi [EMAIL PROTECTED] - verba volant, scripta manent - (discussions get forgotten, just code remains) --------------------------------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
