> From: Volker Schneider [mailto:[EMAIL PROTECTED]] > > Hi colleagues, > > I need the i18n transformer and tried a simple sample: > > first.xml: > > <route xmlns:i18n="http://apache.org/cocoon/i18n/2.0"> > <start> > <i18n:translate> > <i18n:text>Startpunkt</i18n:text> > </i18n:translate> > </start>
It's enough to use <i18n:text>Startpunkt</i18n:text>. <i18n:translate > is used when you need param substitution. > > <ziel>Endpunkt:</ziel> > <abschnitte> > </abschnitte> > </route> > > dictionary.xml: > > <?xml version="1.0" encoding="UTF-8" ?> > <translations> > <entry> > <key>Startpunkt</key> > <translation lang="en">Starting point</translation> > <translation lang="de">Startpunkt</translation> > </entry> > </translations> Dictionary syntax had changed a lot of time ago, but for unknown reason userdocs got lost their updates about the new format. See i18n samples to get the idea. Next week I'll update docs and hopefully will provide a DTD or XSD for i18n markup. > > sitemap.xmap: > > <map:match pattern="test"> > <map:generate src="prototyp/first.xml"/> > <map:transform type="i18n" src="prototyp/dictionary.xml"/> > <map:serialize type="xml"/> > </map:match> > > When running the example I got the message: > > The org.apache.cocoon.www.sitemap_xmap notifies that > org.apache.cocoon.ProcessingException says: > > Unable to locate resource: messages > > Does anybody know what this means and what could be wrong. I > took the syntax from the userdoc. How does i18n know which > language I want to have? Language is choosen using LocaleAction's getLocaleAttribute() method. See LocaleAction javadocs to see how it's performed. As soon as I've had a little free time I'll add also a sitemap parameter support for i18n transformer. In that case you would be able to select the locale in any way you like, e.g. from the URL like this '/host/en_US/page.xml'. > > Please help me. The best help you'll get from the samples, see i18n/ directory in cocoon webapp. Regards, Konstantin Piroumian > > Regards > - Volker - > > > --------------------------------------------------------------------- > Please check that your question has not already been answered > in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>