You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by tony <to...@employer.com.br> on 2001/03/14 18:06:20 UTC

Multilingual site

Hi.

I wish to use XSLT and cocoon to privide a multilingual page content. That
is:

page.xml
-------
<page>
	<lamer> bob </lamer>
</page>


generic.xsl
---------
<xsl:tamplate match="lamer">
	<Mytagset:Translate>
		<xsl:attribute name="lang" value="en"/>
		<xsl:attribute name="tag" value="name()"/>
	</Mytagset:Translate>
	<xsl:value-of select="name">
</xsl:tamplate>

mytagset.xsl
-------
<xsl:tamplate match="Mytagset:Translate">
	<xsp:Translate>
	<!-- database query -->
	...
	<xsp>
</xsl:tamplate>

The pipe will then be ---->  mytagset.xsl(generic.xsl(page.xml))) = html
multilingual!!!

The question is:
Is XML/XSL a good idea to implement multilingual site capabilities and is
there someone who did/saw this being done already to give my some URL or
tips to help me on the design.

Thanks,


Tony.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Multilingual site

Posted by Arnaud Vandyck <ar...@ressource-toi.org>.
On Wed, 14 Mar 2001, tony wrote:

> Thanks all for the feedback!!
> 
> ------------------
> Arnaud wrote:
> >I did this but it was static! I did a site where I got english and
> >french pages with an attribute refer to the lang
> >Well, the "living example" is here:
> >http://www.portoheredias.com/
> 
> I seems to me you did two version of HTML each pages put in a different
> directory. That's not what we want...

The result is two versions of html because the provider do not support Cocoon! The engine is XML->Java App<- XSL =>HTML. This experience is maybe more relevant on general@xml.apache.org than here ;)

Best regards.

--
Arnaud Vandyck
[ http://www.ressource-toi.org/ ]




---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Multilingual site

Posted by tony <to...@employer.com.br>.
Thanks all for the feedback!!

------------------
Peter Wrote:
> Check the XML and XSLT specification for xml:lang, maybe that's all you
> need, and it should be supported by every, XML/XSLT processor :)).

<DESCRIPTION xml:lang="en">
Caesar begins by describing the geography of Gaul.
</DESCRIPTION>

Ok and then ?
This must be useful to describe the language of a tag... unless you've got
an translator programme it dosen't do much more! And to use a translation
programe isn't what we want since their translations are often comic and
unprofessional.
:)

----------------------
Arnaud wrote:
>I did this but it was static! I did a site where I got english and
>french pages with an attribute refer to the lang
>Well, the "living example" is here:
>http://www.portoheredias.com/

I seems to me you did two version of HTML each pages put in a different
directory. That's not what we want...

-------------
Anthony Wrote:
>Doing the same thing (http://www.gowap.ru/english, there's a small
>icon with russia flag to switch languages) and
>http://wap.mavica.ru (wap)

I liked your site and especially the Gelon-like simulator.. :)
I did the same in mine http://wap.bne.com.br ( use only with Internet
Explorer... Netscape is a pain in the...)
http://www.redeemprego.com.br Is a international site I made in ASP...
before discovering Cocoon and XML. :)

Your solution has many o relevant points that I will consider in my design.

Thanks for sharing it.

Tony





---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Multilingual site

Posted by Tagunov Anthony <at...@nnt.ru>.
On Wed, 14 Mar 2001 21:40:33 +0100, Peter C. Verhage wrote:

>Check the XML and XSLT specification for xml:lang, maybe that's all you
>need, and it should be supported by every, XML/XSLT processor :)).
>
>Peter
>
Well, the only use I've found to that is doing language-specfic sorting.
Yes! It does it!
For example in Russian it sorts letter e with two dots above it
after d but before zhe!

And even more:

aea
ae:a
aeb

So it works :-)) (but not sure how else to apply it except for sortin.
For sortin you do put the lang="ru" somewhere -- see the specs.
Also if the nodes being sorted bear lang= on 'em looks like the
sorting goes well even without an extra lang="ru" in the <xsl:sort>
(Haven't tested the second variant though!)

Best regards, Tagunov Anthony




---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Multilingual site

Posted by "Peter C. Verhage" <pe...@zeelandnet.nl>.
Check the XML and XSLT specification for xml:lang, maybe that's all you
need, and it should be supported by every, XML/XSLT processor :)).

Peter


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Multilingual site

Posted by Arnaud Vandyck <ar...@ressource-toi.org>.
On Thu, 15 Mar 2001, Tagunov Anthony wrote:

> How do handle being multilingual?
> Do you have two .xml-s  one in french other in english?

Yes.

> Do you have one .xml where you have both french and english?
> Do you have language-dependent things in your .xsl?
> Do you load language-specific stuff with xalan "document()" function
> in your .xsl?
> 
> Intrested indeed in your solution!
> Doing the same thing (http://www.gowap.ru/english, there's a small
> icon with russia flag to switch languages) and
> http://wap.mavica.ru (wap)

Well, I repeate, I do not know if it's a good solution, yours seems to
be a  little more sophisticated ;),  but remember I do  not use Cocoon
for this site!  The directories are like:

/fr/vins/index.xml
/fr/vins/vintage.xml
...
/en/vins/index.xml
/en/vins/vintage.xml
...

Each  page has  these  attributes in  the  root element:  lang="en|fr"
dirname="vins|sales|.."  main="true|false" pagename="index|vintage|.."
The parser saves these pages in  the same directory with the same name
except it replaces .xml by .html.

I have  _one_ XSL that is only  for presentation and there  is not any
text in it except the link "English version" if lang="fr" and "Version
Française" if lang="fr". With the dirname and pagename, I can make the
link to the right page but in an other language. The main attribute is
there because... well I don't know, I could test the pagename="index"!
:)

If I would do that site again,  I think I'll force (don't know if it's
the good word!) the provider installing Cocoon! ;)

> We do it in the following way: 
> 
> if we're  a publishing a multlingual  article, then we  put into the
> source   xml   versions   for   both  languages:   <item   code="11"
> lang="ru">..</item><item code="11" lang="en">..</item>
> 
> for commonly used words ('Back', 'Next') we put em in a special .xml
> with  it's own dtd  and first  process our  .xml with  xinclude thus
> getting  this  new   file  merged  with  our  source,   so  we  have
> <page><resources>...this  is  the  result of  xinclude..</resources>
> .. other  page data </page> and in  the xsl that forms  our pages we
> have something like
> <xsl:call-template name="res">
>   <xsl:with-param name="group">a11</xsl:with-param>
>   <xsl:with-param name="code">12</xsl:with-param>
> </xsl:call-template>
> 
> this                        template                        searches
> "/page/resources/...some-other-XPath.to.get.the.string" and our .xsp
> pages accept  ..?lang=ru param to make  the urls look  better we use
> Apache    mod_rewrite   to    convert   from    /english/friend   to
> /some-mount-path/smth/page.xml?lang=en   (unfortunantly   this   way
> mod_rewrite kills  all other GET  parameters from the query,  but we
> live with that and pass all the params we want by POST)

Well! I save this message and will  read it the next time I'll have to
do this kind of thing! Congratulations!

> Guys, please, share, how do you do multi-lang support with XML/XSL?
> 
> >I did an application with Xalan that parses all the xml pages to html 
> >(the provider does not support Cocoon :( ).
> >(The layout will be changed soon... just one XSL page to change! arrr 
> >XML is so good! ;) )
> 
> Yup!!! It is!!!! :-)))))
> 
> >I do not know if it's the best solution but it works for me.
> Neither do i if my is good enough, that's why i want to see
> yours :-)
> 
> Best regards, Tagunov Anthony

Thank you for sharing your experience, I hope you'll be satisfied with
mine ;) Do not  hesitate to contact me in private (I  hope this is not
completely off topic  but I don't know if  the discussion interest the
list).

--
Arnaud Vandyck
[ http://www.ressource-toi.org/ ]




---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Multilingual site

Posted by Tagunov Anthony <at...@nnt.ru>.
On Wed, 14 Mar 2001 19:17:57 +0100, Arnaud Vandyck wrote:

>tony wrote:
>
>> Hi.
>> 
>> The question is:
>> Is XML/XSL a good idea to implement multilingual site capabilities and is
>> there someone who did/saw this being done already to give my some URL or
>> tips to help me on the design.
>
>I did this but it was static! I did a site where I got english and 
>french pages with an attribute refer to the lang
>(<page lang="fr|en"...>)
>and the XSL page make a switch to the other language (refering to the 
>/fr or /en page). Well, the "living example" is here:
>http://www.portoheredias.com/

How do handle being multilingual?
Do you have two .xml-s  one in french other in english?
Do you have one .xml where you have both french and english?
Do you have language-dependent things in your .xsl?
Do you load language-specific stuff with xalan "document()" function
in your .xsl?

Intrested indeed in your solution!
Doing the same thing (http://www.gowap.ru/english, there's a small
icon with russia flag to switch languages) and
http://wap.mavica.ru (wap)

We do it in the following way: 

if we're a publishing a multlingual article, then we put into the source
xml versions for both languages: <item code="11" lang="ru">..</item><item code="11" lang="en">..</item>

for commonly used words ('Back', 'Next')
we put em in a special .xml with it's own dtd
and first process our .xml with xinclude thus
getting this new file merged with our source, so we
have <page><resources>...this is the result of xinclude..</resources> .. other page data </page>
and in the xsl that forms our pages we have something like
<xsl:call-template name="res">
  <xsl:with-param name="group">a11</xsl:with-param>
  <xsl:with-param name="code">12</xsl:with-param>
</xsl:call-template>

this template searches "/page/resources/...some-other-XPath.to.get.the.string"
and our .xsp pages accept ..?lang=ru param

to make the urls look better we use Apache mod_rewrite to convert from 
/english/friend to /some-mount-path/smth/page.xml?lang=en
(unfortunantly this way mod_rewrite kills all other GET parameters from the
query, but we live with that and pass all the params we want by POST)

Guys, please, share, how do you do multi-lang support with XML/XSL?

>I did an application with Xalan that parses all the xml pages to html 
>(the provider does not support Cocoon :( ).
>(The layout will be changed soon... just one XSL page to change! arrr 
>XML is so good! ;) )

Yup!!! It is!!!! :-)))))

>I do not know if it's the best solution but it works for me.
Neither do i if my is good enough, that's why i want to see
yours :-)
>Hope it helps.
>
>-- 
>Arnaud Vandyck <http://www.ressource-toi.org/>

Best regards, Tagunov Anthony




---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Multilingual site

Posted by Arnaud Vandyck <ar...@ressource-toi.org>.
tony wrote:

> Hi.
> 
> The question is:
> Is XML/XSL a good idea to implement multilingual site capabilities and is
> there someone who did/saw this being done already to give my some URL or
> tips to help me on the design.

I did this but it was static! I did a site where I got english and 
french pages with an attribute refer to the lang
(<page lang="fr|en"...>)
and the XSL page make a switch to the other language (refering to the 
/fr or /en page). Well, the "living example" is here:
http://www.portoheredias.com/

I did an application with Xalan that parses all the xml pages to html 
(the provider does not support Cocoon :( ).
(The layout will be changed soon... just one XSL page to change! arrr 
XML is so good! ;) )

I do not know if it's the best solution but it works for me.

Hope it helps.

-- 
Arnaud Vandyck <http://www.ressource-toi.org/>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Multilingual site

Posted by tony <to...@employer.com.br>.

You Wrote:
> 
> Hi!
> This is my two cents...
> 
> Look at the http://www.infozone-group.org
> They have an implemented i18n processor for Cocoon 1/2.
> It's quite a good solution. I attached files  where you can find the
> concepts and description of usage.
> I can find more info at the site in the Prowler section.

That's exactly what I am after! Really helpful.

Thanks again.


Tony.



---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Multilingual site

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Hi!
This is my two cents...

Look at the http://www.infozone-group.org
They have an implemented i18n processor for Cocoon 1/2.
It's quite a good solution. I attached files  where you can find the
concepts and description of usage.
I can find more info at the site in the Prowler section.

I, personally, use the FP taglib and an XML dictionary where I store all the
i18n data. In places where the i18n text must be placed I simply read it
from the dictionary, like this: <fp:read select="path/to/item"
from="dictionary.xml" />.

I don't like this solution and going to use the Infozone i18n processor,
because some features that I need (like params in the middle of a string,
multiple dictionaries etc) are not possible or not convenient with my
current approach.

Regards,
    Konstantin Piroumian.


> Hi.
>
> I wish to use XSLT and cocoon to privide a multilingual page content. That
> is:
>
> page.xml
> -------
> <page>
> <lamer> bob </lamer>
> </page>
>
>
> generic.xsl
> ---------
> <xsl:tamplate match="lamer">
> <Mytagset:Translate>
> <xsl:attribute name="lang" value="en"/>
> <xsl:attribute name="tag" value="name()"/>
> </Mytagset:Translate>
> <xsl:value-of select="name">
> </xsl:tamplate>
>
> mytagset.xsl
> -------
> <xsl:tamplate match="Mytagset:Translate">
> <xsp:Translate>
> <!-- database query -->
> ...
> <xsp>
> </xsl:tamplate>
>
> The pipe will then be ---->  mytagset.xsl(generic.xsl(page.xml))) = html
> multilingual!!!
>
> The question is:
> Is XML/XSL a good idea to implement multilingual site capabilities and is
> there someone who did/saw this being done already to give my some URL or
> tips to help me on the design.
>
> Thanks,
>
>
> Tony.
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>