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]>

Reply via email to