You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mario Brust <mb...@virbus.de> on 2001/09/11 13:02:41 UTC
Locale-Action
hi,
I'm using cocoon2b2 and want to use the Locale-Action. But I did not found
any way to extract the language out of the uri.
I want to have a uri like
http://bla.bla/cocoon/bla/sitemaproot/de_DE/site.html.
If I extract the locale I don't know what to do with.
<map:match pattern="*_*/**">
<map:act type="locale">
<!-- This way don't work -->
<map:parameter name="language" value="{1}"/>
<map:parameter name="country" value="{2}"/>
<!-- But how to set the locale here without using
the CGI-Parameter ?locale={1}_{2} -->
<map:redirect-to uri="{3}" uri-prefix="{1}_{2}/"/>
</map:act>
</map:match>
thx in advance
Mario Brust
---
System Development
VIRBUS AG
ICQ 24139151
mario.brust@virbus.de
www.virbus.de
---------------------------------------------------------------------
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>
AW: Locale-Action
Posted by Mario Brust <mb...@virbus.de>.
hi,
this is not the problem. The values are correct but they don't work in this
case.
This values don't work, too.
<map:parameter name="language" value="en"/>
<map:parameter name="country" value="UK"/>
thx,
cu Mario Brust
---
System Development
VIRBUS AG
ICQ 24139151
mario.brust@virbus.de
www.virbus.de
# -----Ursprüngliche Nachricht-----
#
# Use ../1 instead of 1:
#
# <map:match pattern="*_*/**">
# <map:act type="locale">
# <!-- This way don't work -->
# <map:parameter name="language" value="{../1}"/>
# <map:parameter name="country" value="{../2}"/>
# <!-- But how to set the locale here without using
# the CGI-Parameter ?locale={1}_{2} -->
# <map:redirect-to uri="{../3}" uri-prefix="{../1}_{../2}/"/>
# </map:act>
# </map:match>
---------------------------------------------------------------------
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>
AW: Locale-Action
Posted by Jörn Heid <he...@fh-heilbronn.de>.
Use ../1 instead of 1:
<map:match pattern="*_*/**">
<map:act type="locale">
<!-- This way don't work -->
<map:parameter name="language" value="{../1}"/>
<map:parameter name="country" value="{../2}"/>
<!-- But how to set the locale here without using
the CGI-Parameter ?locale={1}_{2} -->
<map:redirect-to uri="{../3}" uri-prefix="{../1}_{../2}/"/>
</map:act>
</map:match>
-----Ursprüngliche Nachricht-----
Von: Mario Brust [mailto:mbrust@virbus.de]
Gesendet: Dienstag, 11. September 2001 13:03
An: Cocoon-Users (E-Mail)
Betreff: Locale-Action
hi,
I'm using cocoon2b2 and want to use the Locale-Action. But I did not found
any way to extract the language out of the uri.
I want to have a uri like
http://bla.bla/cocoon/bla/sitemaproot/de_DE/site.html.
If I extract the locale I don't know what to do with.
<map:match pattern="*_*/**">
<map:act type="locale">
<!-- This way don't work -->
<map:parameter name="language" value="{1}"/>
<map:parameter name="country" value="{2}"/>
<!-- But how to set the locale here without using
the CGI-Parameter ?locale={1}_{2} -->
<map:redirect-to uri="{3}" uri-prefix="{1}_{2}/"/>
</map:act>
</map:match>
thx in advance
Mario Brust
---
System Development
VIRBUS AG
ICQ 24139151
mario.brust@virbus.de
www.virbus.de
---------------------------------------------------------------------
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>
---------------------------------------------------------------------
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>
AW: Locale-Action
Posted by Mario Brust <mb...@virbus.de>.
hi,
no I get the language and want to set it (anywhere). Later I will access the
locale - this part is working now.
The Question is:
How can I set the locale in the sitemap?
thx Mario Brust
---
System Development
VIRBUS AG
ICQ 24139151
mario.brust@virbus.de
www.virbus.de
# > I'm using cocoon2b2 and want to use the Locale-Action. But
# I did not found
# > any way to extract the language out of the uri.
# > I want to have a uri like
# > http://bla.bla/cocoon/bla/sitemaproot/de_DE/site.html.
# >
# > If I extract the locale I don't know what to do with.
# > <map:match pattern="*_*/**">
# > <map:act type="locale">
# > <!-- This way don't work -->
# > <map:parameter name="language" value="{1}"/>
# > <map:parameter name="country" value="{2}"/>
# > <!-- But how to set the locale here without using
# > the CGI-Parameter ?locale={1}_{2} -->
# > <map:redirect-to uri="{3}" uri-prefix="{1}_{2}/"/>
# > </map:act>
# > </map:match>
#
# I'm not 100% sure what you're trying to do there, but
# is this what
# you're trying to achieve ? :
#
# <map:match pattern="site.html">
# <map:act type="locale">
# <map:generate type="file"
# src="sitemaproot/{language}_{country}/site.xml"/>
# <map:serialize type="html"/>
# </map:act>
# </map:match>
#
# The only issue this the generate line above is that the
# 'country'
# field might not be set (eg. if the user has only 'de'
# specified as
# their preferred langauge, and not de_DE). An
# alternative would be to
# use {locale} instead, but make sure you have some technique for
# handling locales you do not yet support.
#
# For more complete internationalization have a look at the
# I18nTransformer. It's been recently added to the
# cocoon2.0 branch, and
# is also in trunk.
#
# Hope that helps.
---------------------------------------------------------------------
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: Locale-Action
Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Mario,
On Tue, 11 Sep 2001, Mario Brust wrote:
> I'm using cocoon2b2 and want to use the Locale-Action. But I did not found
> any way to extract the language out of the uri.
> I want to have a uri like
> http://bla.bla/cocoon/bla/sitemaproot/de_DE/site.html.
>
> If I extract the locale I don't know what to do with.
> <map:match pattern="*_*/**">
> <map:act type="locale">
> <!-- This way don't work -->
> <map:parameter name="language" value="{1}"/>
> <map:parameter name="country" value="{2}"/>
> <!-- But how to set the locale here without using
> the CGI-Parameter ?locale={1}_{2} -->
> <map:redirect-to uri="{3}" uri-prefix="{1}_{2}/"/>
> </map:act>
> </map:match>
I'm not 100% sure what you're trying to do there, but is this what
you're trying to achieve ? :
<map:match pattern="site.html">
<map:act type="locale">
<map:generate type="file"
src="sitemaproot/{language}_{country}/site.xml"/>
<map:serialize type="html"/>
</map:act>
</map:match>
The only issue this the generate line above is that the 'country'
field might not be set (eg. if the user has only 'de' specified as
their preferred langauge, and not de_DE). An alternative would be to
use {locale} instead, but make sure you have some technique for
handling locales you do not yet support.
For more complete internationalization have a look at the
I18nTransformer. It's been recently added to the cocoon2.0 branch, and
is also in trunk.
Hope that helps.
Cheers,
Marcus
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: Open Software Associates GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&' Email : Marcus.Crafter@osa.de
&&&&. Business Hours : +49 69 9757 200
&&&&&&&:
---------------------------------------------------------------------
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>