cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simeon Walker <sim...@sbs.bangor.ac.uk>
Subject Re: i18n locale and web browser (IE, Mozilla)
Date Sat, 01 Nov 2003 12:55:52 GMT
On Sat, 2003-11-01 at 11:52, gounis@osmosis.gr wrote:
> On Sat, 1 Nov 2003, Joerg Heinicke wrote:
> 
> > On 01.11.2003 12:32, gounis@osmosis.gr wrote:
> > 
> > > hi people
> > > 
> > > i use locale action to select the dir where my content files are 
> > > i give the visitor the ability to select the locale 
> > > (?locale=el or ?locale=en) but the first time u visit the site the locale 
> > > is selected automatically.
> > > 
> > > the problem is  that when i use IE, localeAction set locale as "en" or 
> > > "el" or ... 
> > > but using mozilla localeAction set locale as "en_US" instead "en" 
> > > is this a cocoon problem or not 
> > 
> > In mozilla you can play around with the preferences, i.e. you can set 
> > the value for the locale. So it's either possible to use en_US or en.
> > 
> > > i use locale content to create the path where the files are /xml/c_en (and

> > > not /xml_/c_en_US)
> > 
> > Don't you use i18n transformer? It handles exactly this: It tries to 
> > select en_US first, en afterwards.
> > 
> > Joerg
> > 
> 
> i use i18n transformer to translate my .xml but to select the path i use 
> just {locale} in sitemap
> 
> ..
> 	<map:generate src="c_{../locale}/{1}.xml"/>
> ..
> 
> so when the browser is mozilla the generator try to find the .xml in 
> c_en_US/filename.xml 
> 
> but this path dont exist !!! (c_en/filename.xml) 
> 
> is something i missed?
> 
> --stavros
> 
This is how I do it:
(in Cocoon 2.1.2, you don't say what you're using)

<map:match pattern="**.xml">
  <map:act type="locale">
    <map:act type="resource-exists">
      <map:parameter name="url" value="{../1}_{lang}.xml"/>
      <map:generate src="documents/{../../1}_{../lang}.xml"/>
      <map:serialize type="xml"/>
    </map:act>
  </map:act>
  <map:generate src="{1}_en.xml"/>
  <map:serialize type="xml"/>
</map:match>

The locale Action provides the {lang} derived from the full locale that
the browser send.

Regards,
Sim

> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message