Hi all, to have a default language which is called automatically if you choose no locale in the URL, I had to modify the source file, e.g I added my default language to the root element, which does the trick. <page xml:lang="fr" xmlns:i18n="http://apache.org/cocoon/i18n/2.0"> Of course, if there's a way I can achieve this without actually writing it to the source files, I would be happy to know about.
-----Message d'origine----- De: Volker Schneider [mailto:[EMAIL PROTECTED]] Date: mercredi, 17. avril 2002 12:57 À: 'Hahn Kurt (CHA)' Objet: RE: i18n problem Hi Kurt, my experience was, that if I don't use the "locale" parameter, I get the content from "messages_de.xml", because I don't have a messages.xml file. But I don't know where the default value "de" comes from. Regards - Volker - -----Original Message----- From: Hahn Kurt (CHA) [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 17. April 2002 08:59 To: '[EMAIL PROTECTED]' Subject: RE: i18n problem Hi Volker, thanks for your hints, I'm about to try it out. Just one question: As in the example , I also created a file "messages.xml", which will contain the default language. Am I right in thinking that if I don't specify any locale in the URL, Cocoon is supposed to use the translations in this file? Kurt -----Message d'origine----- De: Volker Schneider [mailto:[EMAIL PROTECTED]] Date: lundi, 15. avril 2002 12:40 À: [EMAIL PROTECTED] Objet: RE: i18n problem Hi Kurt, please see the mails of last friday talking with Konstantin Piroumian about this topic. The documentation is old. You have to do the following: Create 2 Files "messages_en" and "messages_fr". Each file has to look like this: <?xml version="1.0" encoding="UTF-8"?> <!-- CVS $Id: messages_en.xml,v 1.2 2002/01/30 14:56:12 sylvain Exp $ --> <!-- English message catalogue file --> <catalogue xml:lang="en"> <message key="Deutschland">Germany</message> <message key="Schweiz">Switzerland</message> ... </catalogue> and the same for french. Make sure the you have defined the filename prefix and the location in the sitemap: <map:transformer logger="sitemap.transformer.i18n" name="i18n" src="org.apache.cocoon.transformation.I18nTransformer"> <catalogue-name>messages</catalogue-name> <catalogue-location>translation</catalogue-location> </map:transformer> Then you can use the tags: ... <i18n:text>Deutschland</i18n:text> ... if you have defined the i18n-namespace. If you want to translate the output of a stylesheet, put it inside the body-tag to avoid syntax errors: <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink"> <xsl:template match="/"> <html xmlns:i18n="http://apache.org/cocoon/i18n/2.0"> <body> ... </body> </html> </xsl:template match="/"> If you have further questions, feel free to ask. Maybe I can help you. Best regards, - Volker - -----Original Message----- From: Hahn Kurt (CHA) [mailto:[EMAIL PROTECTED]] Sent: Montag, 15. April 2002 12:05 To: '[EMAIL PROTECTED]' Subject: i18n problem I'm trying to reproduce the i18n sample in my application, and can't get it to work. I think I missed one step during setup, maybe someone can help: 1. I created a folder "translations", with the files messages.xml and messages_en.xml (this way I didn't have to change the entry in the main Cocoon sitemap) 2. I added a line : <i18n:text>Hello</i18n:text> to my .xml-file I want to display, this text should be resolved in my messages.xml file, which contains: <entry> <key>Hello</key> <translation lang="en">Hello, internationalization!</translation> <translation lang="fr">Bonjour, internationalization!</translation> <translation lang="de">Herzlich willkommen, Internationalisierung!</translation> </entry>. 3. The match in my sitemap goes like this: <map:generate src="enter.xml"/> <map:transform type="i18n"/> <map:transform src="Stylesheets/choices.xsl"/> <map:serialize type="html"/> This gives me as result the line "untranslated-text". I tried to add parameters to add to "transform type...", as in the documentation: <map:transform type="i18n"> <parameter name="available_lang_1" value="en"/> <parameter name="available_lang_2" value="fr"/> </map:transform> but this gave a me general sitemap error (Cocoon wouldn't start up anymore). Any ideas? --------------------------------------------------------------------- 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]> --------------------------------------------------------------------- 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]>