You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kane <ka...@freebsd-uk.eu.org> on 2000/10/20 09:24:10 UTC

Cocoon-1.8's charset encoding problems

Hi,all:

   We are using Cocoon-1.8 with Tomcat-4.0 to implement XML tranlation to 
HTML, and there are many Chinese characters(GB2312), but cocoon can't process
them correctly, all Chinese characters become "??" chars. Could you give me
some advices on how to correct it? I have tried to set 
<?xml version="1.0" encoding="GB2312"?>, and it can't work too.

Thanks a lot.


Re: Cocoon-1.8's charset encoding problems

Posted by Konstantin Piroumian <KP...@flagship.ru>.
I am using Russian characters and to display them correctly I set the
content-type as this in my XSP file:
<xsp:logic>
// yourcharset = "windows-1251" or "GB2312"
   response.setContentType("text/html; charset=" + yourcharset);
</xsp:logic>

Regards,
  Kot.

----- Original Message -----
From: "Kane" <ka...@freebsd-uk.eu.org>
To: <co...@xml.apache.org>
Sent: 20 ������� 2000 �., ������� 11:24
Subject: Cocoon-1.8's charset encoding problems


> Hi,all:
>
>    We are using Cocoon-1.8 with Tomcat-4.0 to implement XML tranlation to
> HTML, and there are many Chinese characters(GB2312), but cocoon can't
process
> them correctly, all Chinese characters become "??" chars. Could you give
me
> some advices on how to correct it? I have tried to set
> <?xml version="1.0" encoding="GB2312"?>, and it can't work too.
>
> Thanks a lot.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: Internationalization and Cocoon

Posted by Conny Krappatsch <co...@smb-tec.com>.
Konstantin, thanks for your reply.

I forwarded your message to the Infozone users list, because the i18n processor
is part of the Infozone package.



The way we go is somewhat similar to how i18n is done during programming. The
programmer (or in case of web content, the web designer or content provider)
marks everthing that may be translated for localized versions.

The marked text can be extracted automatically (not yet implemented in the i18n
processor) and used to create the dictionaries. The created key table can be
given to an interpreter for translation. The interpreters (maybe one for every
language you want your application localize to) don't have to work on the
original application/web site, they get only the keys and translate them.

You may be right that in some cases it is inconvinient to have multiple
dictionaries (one for each language). But forcing to have only one dictionary
(containing the translations for all languages) could be even more
inconvinient if there are multiple interpreter translating to the different
languages. 

I would like to have something that's able to do both. A dictionary entry could
look like this:
<entry>
    <key>This is translated text.</key>
    <translation lang="de">Dies ist uebersetzter Text.</translation>
    <translation lang="es">Este es texto traducido.</translation>
    <translation lang="fr">C`est texte traduit.</translation>
</entry>

(I'm only sure about the german translation :-)

What we have to do is to configure, where to find the dictionaries for the
different languages. Maybe in the Cocoon properties?
Than one could create a dictionary for each language or put all translation in
one single dictionary.

regards,
Conny Krappatsch

Konstantin Piroumian wrote:
> Hi, Conny!
> 
> I took a look at your processor.
> I like the idea to use a processor for internationalization.
> But the structure of the dictionary is not very convenient to use with a
> large site:
> you have to create multiple dictionary files and duplicate the keys for
> every language.
> 
> I was using FP tag lib to read data from an XML dictionary and place it to
> the proper places.
> It's something like what you do in your XML files, but my dictionary is a
> little more structured, e.g.:
> 
> <!-- for english part -->
> <repository lang="en">
>     <login>
>         <title>Login to xABS system</title>
>         <username>User name</username>
>         <password>Password</password>
>         <button>Login</button>
>     </login>
>     <welcome>
>         <title>Welcome to xABS system</title>
>         <greeting>Hello, </greeting>
>         <infotext>
>             <para>
>                 <line>Here you can do everything and enjoy yourself.</line>
>                 <line>This is a really multilanguage system.</line>
>                 <line>It was designed by Piroumian K.</line>
>             </para>
>             <para>
>                 <line>This system is completely XML based.</line>
>                 <line>And it uses XSLT for presentation formatting.</line>
>                 <line>For any comments feel free to contact Konstantin
> Piroumian (<email>kpiroumian@flasghip.ru</email>)</line>
>             </para>
>         </infotext>
>         <menu title="Menu">
>             <subscribers>Your subscribers</subscribers>
>         </menu>
>     </welcome>
> </repository>
> 
> But, it has the same problem of duplicate key (XML tags in my case).
> I was thinking to change it to something like this:
> 
> <welcome>
>   <greeting lang="en">Hello</greeting>
>   <greeting lang="ru">������</greeting>
>   ...
> </welcome>
> 
> This will reduce a little the number of duplicate elements.
> 
> Also, it is a very good idea to make insertable params - this is what I
> could not do with FP!
> 
> Maybe I will use your processor in my project - I have to look at it more
> specifically.
> 
> Regards,
>   Kot.
> 
> 
> ----- Original Message -----
> From: "Conny Krappatsch" <co...@smb-tec.com>
> To: <KP...@flagship.ru>; <co...@xml.apache.org>
> Sent: 20 ������� 2000 �., ������� 14:09
> Subject: Re: Internationalization and Cocoon
> 
> 
> > Hi Konstantin,
> >
> > we are currently developing an i18n processor for Cocoon1. You can get a
> first
> > version from the online CVS at
> http://cvs.smb-tec.com/cgi-bin/cvsweb.cgi/infozone/
> > package org.infozone.ui.i18n. There are also documentation, example file
> and
> > example dictionaries.
> >
> > The language can be set using HTTP request parameter, cookies or HTTP
> session
> > parameters.
> >
> > Every feedback or contribution is welcome.
> >
> > Conny
> >
> > Konstantin Piroumian wrote:
> > > Hi, all!
> > > I am working on a multi-language project and investigating the best ways
> of
> > > implementing it.
> > > I would be very thankfull for any good ideas and opinions in this area.
> > > The site will consist of a lot of pages and every page must be displayed
> in
> > > 5 and more languages.
> > > The language can be changed at any moment.
> > >
> > > The tasks are:
> > > 1. To determine the current language (from session) on every page.
> > > 2. Set the correct language for XSL processing and correct encoding in
> the
> > > response.
> > > 3. To change the current language in accordance to the user request.
> > >
> > > To add this functionality to every page I decided to make my own Taglib
> and
> > > a stylesheet to add Java code to every page which will determine the
> current
> > > language (from the session) and add an attribute to my root element:
> > >
> > > <page>
> > >   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> > > ...
> > > <</page>
> > >
> > > Then the XSL will look at the attribute value and get international data
> > > from a xml file.
> > > Also I will need to set the response's Content Type to display the page
> > > correctly.
> > > For that I can also use my own tag lib's stylesheet.
> > >
> > > Anothar aproach can be to map all requests to a single page or a servlet
> > > which will redirect requests to the appropriate page (if I had a
> separate
> > > page for every language) or add a request param (lang=en).
> > >
> > > Are there any other possibilities to add a common functionality to all
> > > pages?
> > > Before Cocoon I was programming in pure Java (something like Cocoon, but
> > > less flexible) and I had a parent class for all pages which was
> providing
> > > all common functionality.
> > >
> > > I would like to hear your opinions on this subject.
> > > Thank you for your attention.
> > >
> > > Best regards,
> > > ----------------------------------------------------------------------
> > > Konstantin Piroumian
> > > Software engineer
> > >
> > > Protek Flagship LLC
> > > Phone: + 7 095 795 0520 (add. 1288)
> > > Fax: + 7 095 795 0525
> > > E-mail: kpiroumian@flagship.ru
> > > http://www.protek.com
> > > ----------------------------------------------------------------------
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> > --
> > ______________________________________________________________________
> > Conny Krappatsch                              mailto:conny@smb-tec.com
> > SMB GmbH                                        http://www.smb-tec.com
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: Internationalization and Cocoon

Posted by Konstantin Piroumian <KP...@flagship.ru>.
Hi, Conny!

I took a look at your processor.
I like the idea to use a processor for internationalization.
But the structure of the dictionary is not very convenient to use with a
large site:
you have to create multiple dictionary files and duplicate the keys for
every language.

I was using FP tag lib to read data from an XML dictionary and place it to
the proper places.
It's something like what you do in your XML files, but my dictionary is a
little more structured, e.g.:

<!-- for english part -->
<repository lang="en">
    <login>
        <title>Login to xABS system</title>
        <username>User name</username>
        <password>Password</password>
        <button>Login</button>
    </login>
    <welcome>
        <title>Welcome to xABS system</title>
        <greeting>Hello, </greeting>
        <infotext>
            <para>
                <line>Here you can do everything and enjoy yourself.</line>
                <line>This is a really multilanguage system.</line>
                <line>It was designed by Piroumian K.</line>
            </para>
            <para>
                <line>This system is completely XML based.</line>
                <line>And it uses XSLT for presentation formatting.</line>
                <line>For any comments feel free to contact Konstantin
Piroumian (<email>kpiroumian@flasghip.ru</email>)</line>
            </para>
        </infotext>
        <menu title="Menu">
            <subscribers>Your subscribers</subscribers>
        </menu>
    </welcome>
</repository>

But, it has the same problem of duplicate key (XML tags in my case).
I was thinking to change it to something like this:

<welcome>
  <greeting lang="en">Hello</greeting>
  <greeting lang="ru">Привет</greeting>
  ...
</welcome>

This will reduce a little the number of duplicate elements.

Also, it is a very good idea to make insertable params - this is what I
could not do with FP!

Maybe I will use your processor in my project - I have to look at it more
specifically.

Regards,
  Kot.


----- Original Message -----
From: "Conny Krappatsch" <co...@smb-tec.com>
To: <KP...@flagship.ru>; <co...@xml.apache.org>
Sent: 20 октября 2000 г., пятница 14:09
Subject: Re: Internationalization and Cocoon


> Hi Konstantin,
>
> we are currently developing an i18n processor for Cocoon1. You can get a
first
> version from the online CVS at
http://cvs.smb-tec.com/cgi-bin/cvsweb.cgi/infozone/
> package org.infozone.ui.i18n. There are also documentation, example file
and
> example dictionaries.
>
> The language can be set using HTTP request parameter, cookies or HTTP
session
> parameters.
>
> Every feedback or contribution is welcome.
>
> Conny
>
> Konstantin Piroumian wrote:
> > Hi, all!
> > I am working on a multi-language project and investigating the best ways
of
> > implementing it.
> > I would be very thankfull for any good ideas and opinions in this area.
> > The site will consist of a lot of pages and every page must be displayed
in
> > 5 and more languages.
> > The language can be changed at any moment.
> >
> > The tasks are:
> > 1. To determine the current language (from session) on every page.
> > 2. Set the correct language for XSL processing and correct encoding in
the
> > response.
> > 3. To change the current language in accordance to the user request.
> >
> > To add this functionality to every page I decided to make my own Taglib
and
> > a stylesheet to add Java code to every page which will determine the
current
> > language (from the session) and add an attribute to my root element:
> >
> > <page>
> >   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> > ...
> > <</page>
> >
> > Then the XSL will look at the attribute value and get international data
> > from a xml file.
> > Also I will need to set the response's Content Type to display the page
> > correctly.
> > For that I can also use my own tag lib's stylesheet.
> >
> > Anothar aproach can be to map all requests to a single page or a servlet
> > which will redirect requests to the appropriate page (if I had a
separate
> > page for every language) or add a request param (lang=en).
> >
> > Are there any other possibilities to add a common functionality to all
> > pages?
> > Before Cocoon I was programming in pure Java (something like Cocoon, but
> > less flexible) and I had a parent class for all pages which was
providing
> > all common functionality.
> >
> > I would like to hear your opinions on this subject.
> > Thank you for your attention.
> >
> > Best regards,
> > ----------------------------------------------------------------------
> > Konstantin Piroumian
> > Software engineer
> >
> > Protek Flagship LLC
> > Phone: + 7 095 795 0520 (add. 1288)
> > Fax: + 7 095 795 0525
> > E-mail: kpiroumian@flagship.ru
> > http://www.protek.com
> > ----------------------------------------------------------------------
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> --
> ______________________________________________________________________
> Conny Krappatsch                              mailto:conny@smb-tec.com
> SMB GmbH                                        http://www.smb-tec.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: Internationalization and Cocoon

Posted by Conny Krappatsch <co...@smb-tec.com>.
Hi Konstantin,

we are currently developing an i18n processor for Cocoon1. You can get a first
version from the online CVS at http://cvs.smb-tec.com/cgi-bin/cvsweb.cgi/infozone/
package org.infozone.ui.i18n. There are also documentation, example file and
example dictionaries.

The language can be set using HTTP request parameter, cookies or HTTP session
parameters.

Every feedback or contribution is welcome.

Conny

Konstantin Piroumian wrote:
> Hi, all!
> I am working on a multi-language project and investigating the best ways of
> implementing it.
> I would be very thankfull for any good ideas and opinions in this area.
> The site will consist of a lot of pages and every page must be displayed in
> 5 and more languages.
> The language can be changed at any moment.
> 
> The tasks are:
> 1. To determine the current language (from session) on every page.
> 2. Set the correct language for XSL processing and correct encoding in the
> response.
> 3. To change the current language in accordance to the user request.
> 
> To add this functionality to every page I decided to make my own Taglib and
> a stylesheet to add Java code to every page which will determine the current
> language (from the session) and add an attribute to my root element:
> 
> <page>
>   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> ...
> <</page>
> 
> Then the XSL will look at the attribute value and get international data
> from a xml file.
> Also I will need to set the response's Content Type to display the page
> correctly.
> For that I can also use my own tag lib's stylesheet.
> 
> Anothar aproach can be to map all requests to a single page or a servlet
> which will redirect requests to the appropriate page (if I had a separate
> page for every language) or add a request param (lang=en).
> 
> Are there any other possibilities to add a common functionality to all
> pages?
> Before Cocoon I was programming in pure Java (something like Cocoon, but
> less flexible) and I had a parent class for all pages which was providing
> all common functionality.
> 
> I would like to hear your opinions on this subject.
> Thank you for your attention.
> 
> Best regards,
> ----------------------------------------------------------------------
> Konstantin Piroumian
> Software engineer
> 
> Protek Flagship LLC
> Phone: + 7 095 795 0520 (add. 1288)
> Fax: + 7 095 795 0525
> E-mail: kpiroumian@flagship.ru
> http://www.protek.com
> ----------------------------------------------------------------------
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: Internationalization and Cocoon

Posted by Konstantin Piroumian <KP...@flagship.ru>.
Thank you for all your links, taglibs, opinions and ideas.
I will look at them very carefully.

Regards,
  Kot.




Re: Internationalization and Cocoon

Posted by Konstantin Piroumian <KP...@flagship.ru>.
I was thinking of using different stylesheets for different languages.
But the work to be done if modifications are needed multyplied to the number
of languages.

Now I use another approach - all international data I store in an XML file
(some kind of a repository) and
get needed data with a logicsheet (XSP) then I use a single stylesheet to
format the page.
But I think that for some "extravagant" languages (locales) a separate
stylesheet will be needed:
for right-to-left languages (Arabic, some Hebrew langs), Chinese, Japanese,
etc.

In any case, I am agree with you, this is a complex problem.

----- Original Message -----
From: "Eric SCHAEFFER" <es...@posterconseil.com>
To: <co...@xml.apache.org>
Sent: 20 ??????? 2000 ?., ??????? 14:29
Subject: Re: Internationalization and Cocoon


> For internationalization, I use a different (formatting stylesheet, not a
> logicsheet) stylesheet for every language (that is set dynamically), and
> data is the same (from database).
>
> Number formatting, and other language specific formatting operations are
> performed by Xalan extensions.
>
> The problem of internationalization is maybe more complex than translating
> some data. The page aspect can also change: you don't use the same colors
or
> organize the page content the same way for US people or european ones.
>
> Internationalization is really a great problem, and I'd really like to
know
> how others have solved it.
>
> Eric.
>
> ----- Original Message -----
> From: "Konstantin Piroumian" <KP...@flagship.ru>
> To: <co...@xml.apache.org>
> Sent: Friday, October 20, 2000 10:48 AM
> Subject: Internationalization and Cocoon
>
>
> > Hi, all!
> > I am working on a multi-language project and investigating the best ways
> of
> > implementing it.
> > I would be very thankfull for any good ideas and opinions in this area.
> > The site will consist of a lot of pages and every page must be displayed
> in
> > 5 and more languages.
> > The language can be changed at any moment.
> >
> > The tasks are:
> > 1. To determine the current language (from session) on every page.
> > 2. Set the correct language for XSL processing and correct encoding in
the
> > response.
> > 3. To change the current language in accordance to the user request.
> >
> > To add this functionality to every page I decided to make my own Taglib
> and
> > a stylesheet to add Java code to every page which will determine the
> current
> > language (from the session) and add an attribute to my root element:
> >
> > <page>
> >   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> > ...
> > </page>
> >
> > Then the XSL will look at the attribute value and get international data
> > from a xml file.
> > Also I will need to set the response's Content Type to display the page
> > correctly.
> > For that I can also use my own tag lib's stylesheet.
> >
> > Anothar aproach can be to map all requests to a single page or a servlet
> > which will redirect requests to the appropriate page (if I had a
separate
> > page for every language) or add a request param (lang=en).
> >
> > Are there any other possibilities to add a common functionality to all
> > pages?
> > Before Cocoon I was programming in pure Java (something like Cocoon, but
> > less flexible) and I had a parent class for all pages which was
providing
> > all common functionality.
> >
> > I would like to hear your opinions on this subject.
> > Thank you for your attention.
> >
> > Best regards,
> > ----------------------------------------------------------------------
> > Konstantin Piroumian
> > Software engineer
> >
> > Protek Flagship LLC
> > Phone: + 7 095 795 0520 (add. 1288)
> > Fax: + 7 095 795 0525
> > E-mail: kpiroumian@flagship.ru
> > http://www.protek.com
> > ----------------------------------------------------------------------
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: Internationalization and Cocoon

Posted by Frederic Alluin <fr...@webmedia.es>.
I make like this:
a xsl file to manage all my international labels, images, etc.... In this file I
have a tag such as :
<xsl:param name="language">fr</xsl:param>
I include this xsl in every xsl files of my site and use the typical attribut
xml:lang="fr" in my international tags....
More: To manage the language selection I use wn own lang library (see previous
mail) and the language parameter become : <xsl:param
name="language"><webmedia:get-lang/></xsl:param>.
I made it there is a week ago and it's only a test...... maybe it helps you.
Regards
Fred

Eric SCHAEFFER wrote:

> For internationalization, I use a different (formatting stylesheet, not a
> logicsheet) stylesheet for every language (that is set dynamically), and
> data is the same (from database).
>
> Number formatting, and other language specific formatting operations are
> performed by Xalan extensions.
>
> The problem of internationalization is maybe more complex than translating
> some data. The page aspect can also change: you don't use the same colors or
> organize the page content the same way for US people or european ones.
>
> Internationalization is really a great problem, and I'd really like to know
> how others have solved it.
>
> Eric.
>
> ----- Original Message -----
> From: "Konstantin Piroumian" <KP...@flagship.ru>
> To: <co...@xml.apache.org>
> Sent: Friday, October 20, 2000 10:48 AM
> Subject: Internationalization and Cocoon
>
> > Hi, all!
> > I am working on a multi-language project and investigating the best ways
> of
> > implementing it.
> > I would be very thankfull for any good ideas and opinions in this area.
> > The site will consist of a lot of pages and every page must be displayed
> in
> > 5 and more languages.
> > The language can be changed at any moment.
> >
> > The tasks are:
> > 1. To determine the current language (from session) on every page.
> > 2. Set the correct language for XSL processing and correct encoding in the
> > response.
> > 3. To change the current language in accordance to the user request.
> >
> > To add this functionality to every page I decided to make my own Taglib
> and
> > a stylesheet to add Java code to every page which will determine the
> current
> > language (from the session) and add an attribute to my root element:
> >
> > <page>
> >   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> > ...
> > </page>
> >
> > Then the XSL will look at the attribute value and get international data
> > from a xml file.
> > Also I will need to set the response's Content Type to display the page
> > correctly.
> > For that I can also use my own tag lib's stylesheet.
> >
> > Anothar aproach can be to map all requests to a single page or a servlet
> > which will redirect requests to the appropriate page (if I had a separate
> > page for every language) or add a request param (lang=en).
> >
> > Are there any other possibilities to add a common functionality to all
> > pages?
> > Before Cocoon I was programming in pure Java (something like Cocoon, but
> > less flexible) and I had a parent class for all pages which was providing
> > all common functionality.
> >
> > I would like to hear your opinions on this subject.
> > Thank you for your attention.
> >
> > Best regards,
> > ----------------------------------------------------------------------
> > Konstantin Piroumian
> > Software engineer
> >
> > Protek Flagship LLC
> > Phone: + 7 095 795 0520 (add. 1288)
> > Fax: + 7 095 795 0525
> > E-mail: kpiroumian@flagship.ru
> > http://www.protek.com
> > ----------------------------------------------------------------------
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Internationalization and Cocoon

Posted by Eric SCHAEFFER <es...@posterconseil.com>.
For internationalization, I use a different (formatting stylesheet, not a
logicsheet) stylesheet for every language (that is set dynamically), and
data is the same (from database).

Number formatting, and other language specific formatting operations are
performed by Xalan extensions.

The problem of internationalization is maybe more complex than translating
some data. The page aspect can also change: you don't use the same colors or
organize the page content the same way for US people or european ones.

Internationalization is really a great problem, and I'd really like to know
how others have solved it.

Eric.

----- Original Message -----
From: "Konstantin Piroumian" <KP...@flagship.ru>
To: <co...@xml.apache.org>
Sent: Friday, October 20, 2000 10:48 AM
Subject: Internationalization and Cocoon


> Hi, all!
> I am working on a multi-language project and investigating the best ways
of
> implementing it.
> I would be very thankfull for any good ideas and opinions in this area.
> The site will consist of a lot of pages and every page must be displayed
in
> 5 and more languages.
> The language can be changed at any moment.
>
> The tasks are:
> 1. To determine the current language (from session) on every page.
> 2. Set the correct language for XSL processing and correct encoding in the
> response.
> 3. To change the current language in accordance to the user request.
>
> To add this functionality to every page I decided to make my own Taglib
and
> a stylesheet to add Java code to every page which will determine the
current
> language (from the session) and add an attribute to my root element:
>
> <page>
>   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> ...
> </page>
>
> Then the XSL will look at the attribute value and get international data
> from a xml file.
> Also I will need to set the response's Content Type to display the page
> correctly.
> For that I can also use my own tag lib's stylesheet.
>
> Anothar aproach can be to map all requests to a single page or a servlet
> which will redirect requests to the appropriate page (if I had a separate
> page for every language) or add a request param (lang=en).
>
> Are there any other possibilities to add a common functionality to all
> pages?
> Before Cocoon I was programming in pure Java (something like Cocoon, but
> less flexible) and I had a parent class for all pages which was providing
> all common functionality.
>
> I would like to hear your opinions on this subject.
> Thank you for your attention.
>
> Best regards,
> ----------------------------------------------------------------------
> Konstantin Piroumian
> Software engineer
>
> Protek Flagship LLC
> Phone: + 7 095 795 0520 (add. 1288)
> Fax: + 7 095 795 0525
> E-mail: kpiroumian@flagship.ru
> http://www.protek.com
> ----------------------------------------------------------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: Internationalization and Cocoon

Posted by Frederic Alluin <fr...@webmedia.es>.
sorry but it miss a private classes to work......(see attachment)

Frederic Alluin wrote:

> I already made my own lang library, you can find it and a page of example in the
> attachment.
> It's a beta version for a demo so you can improve it ... but it works of course.
>
> If you want more info tell me in private
> Fred
>
> Konstantin Piroumian wrote:
>
> > Hi, all!
> > I am working on a multi-language project and investigating the best ways of
> > implementing it.
> > I would be very thankfull for any good ideas and opinions in this area.
> > The site will consist of a lot of pages and every page must be displayed in
> > 5 and more languages.
> > The language can be changed at any moment.
> >
> > The tasks are:
> > 1. To determine the current language (from session) on every page.
> > 2. Set the correct language for XSL processing and correct encoding in the
> > response.
> > 3. To change the current language in accordance to the user request.
> >
> > To add this functionality to every page I decided to make my own Taglib and
> > a stylesheet to add Java code to every page which will determine the current
> > language (from the session) and add an attribute to my root element:
> >
> > <page>
> >   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> > ...
> > </page>
> >
> > Then the XSL will look at the attribute value and get international data
> > from a xml file.
> > Also I will need to set the response's Content Type to display the page
> > correctly.
> > For that I can also use my own tag lib's stylesheet.
> >
> > Anothar aproach can be to map all requests to a single page or a servlet
> > which will redirect requests to the appropriate page (if I had a separate
> > page for every language) or add a request param (lang=en).
> >
> > Are there any other possibilities to add a common functionality to all
> > pages?
> > Before Cocoon I was programming in pure Java (something like Cocoon, but
> > less flexible) and I had a parent class for all pages which was providing
> > all common functionality.
> >
> > I would like to hear your opinions on this subject.
> > Thank you for your attention.
> >
> > Best regards,
> > ----------------------------------------------------------------------
> > Konstantin Piroumian
> > Software engineer
> >
> > Protek Flagship LLC
> > Phone: + 7 095 795 0520 (add. 1288)
> > Fax: + 7 095 795 0525
> > E-mail: kpiroumian@flagship.ru
> > http://www.protek.com
> > ----------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>   ------------------------------------------------------------------------
>                    Name: webmedia.jar
>    webmedia.jar    Type: Java Archive (application/java-archive)
>                Encoding: base64
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Re: Internationalization and Cocoon

Posted by Frederic Alluin <fr...@webmedia.es>.
I already made my own lang library, you can find it and a page of example in the
attachment.
It's a beta version for a demo so you can improve it ... but it works of course.

If you want more info tell me in private
Fred

Konstantin Piroumian wrote:

> Hi, all!
> I am working on a multi-language project and investigating the best ways of
> implementing it.
> I would be very thankfull for any good ideas and opinions in this area.
> The site will consist of a lot of pages and every page must be displayed in
> 5 and more languages.
> The language can be changed at any moment.
>
> The tasks are:
> 1. To determine the current language (from session) on every page.
> 2. Set the correct language for XSL processing and correct encoding in the
> response.
> 3. To change the current language in accordance to the user request.
>
> To add this functionality to every page I decided to make my own Taglib and
> a stylesheet to add Java code to every page which will determine the current
> language (from the session) and add an attribute to my root element:
>
> <page>
>   <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
> ...
> </page>
>
> Then the XSL will look at the attribute value and get international data
> from a xml file.
> Also I will need to set the response's Content Type to display the page
> correctly.
> For that I can also use my own tag lib's stylesheet.
>
> Anothar aproach can be to map all requests to a single page or a servlet
> which will redirect requests to the appropriate page (if I had a separate
> page for every language) or add a request param (lang=en).
>
> Are there any other possibilities to add a common functionality to all
> pages?
> Before Cocoon I was programming in pure Java (something like Cocoon, but
> less flexible) and I had a parent class for all pages which was providing
> all common functionality.
>
> I would like to hear your opinions on this subject.
> Thank you for your attention.
>
> Best regards,
> ----------------------------------------------------------------------
> Konstantin Piroumian
> Software engineer
>
> Protek Flagship LLC
> Phone: + 7 095 795 0520 (add. 1288)
> Fax: + 7 095 795 0525
> E-mail: kpiroumian@flagship.ru
> http://www.protek.com
> ----------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Internationalization and Cocoon

Posted by Konstantin Piroumian <KP...@flagship.ru>.
Hi, all!
I am working on a multi-language project and investigating the best ways of
implementing it.
I would be very thankfull for any good ideas and opinions in this area.
The site will consist of a lot of pages and every page must be displayed in
5 and more languages.
The language can be changed at any moment.

The tasks are:
1. To determine the current language (from session) on every page.
2. Set the correct language for XSL processing and correct encoding in the
response.
3. To change the current language in accordance to the user request.

To add this functionality to every page I decided to make my own Taglib and
a stylesheet to add Java code to every page which will determine the current
language (from the session) and add an attribute to my root element:

<page>
  <xsp:attribute name="lang"><xabs:get-current-lang/></xsp:attribute>
...
</page>

Then the XSL will look at the attribute value and get international data
from a xml file.
Also I will need to set the response's Content Type to display the page
correctly.
For that I can also use my own tag lib's stylesheet.

Anothar aproach can be to map all requests to a single page or a servlet
which will redirect requests to the appropriate page (if I had a separate
page for every language) or add a request param (lang=en).

Are there any other possibilities to add a common functionality to all
pages?
Before Cocoon I was programming in pure Java (something like Cocoon, but
less flexible) and I had a parent class for all pages which was providing
all common functionality.

I would like to hear your opinions on this subject.
Thank you for your attention.

Best regards,
----------------------------------------------------------------------
Konstantin Piroumian
Software engineer

Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525
E-mail: kpiroumian@flagship.ru
http://www.protek.com
----------------------------------------------------------------------



Re: Cocoon-1.8's charset encoding problems

Posted by Konstantin Piroumian <KP...@flagship.ru>.
Hi, Donald!


----- Original Message -----
From: "Donald Ball" <ba...@webslingerZ.com>
To: <co...@xml.apache.org>
Sent: 20 ??????? 2000 ?., ??????? 11:32
Subject: Re: Cocoon-1.8's charset encoding problems


> yOn Fri, 20 Oct 2000, Kane wrote:
>>...

> you can set the output encoding in the cocoon.properties file. it's a
> little coarse right now but that should be fixed up in c2.
>
> - donald

But what if we need more than one encoding on our pages?

I use UTF8 as Cocoon encoding. And set the content type for every page
depending on the user language.
Will it be improved in C2? And how?

Regards,
  Kot.


Re: Cocoon-1.8's charset encoding problems

Posted by Donald Ball <ba...@webslingerZ.com>.
yOn Fri, 20 Oct 2000, Kane wrote:

>    We are using Cocoon-1.8 with Tomcat-4.0 to implement XML tranlation to 
> HTML, and there are many Chinese characters(GB2312), but cocoon can't process
> them correctly, all Chinese characters become "??" chars. Could you give me
> some advices on how to correct it? I have tried to set 
> <?xml version="1.0" encoding="GB2312"?>, and it can't work too.

you can set the output encoding in the cocoon.properties file. it's a
little coarse right now but that should be fixed up in c2.

- donald