Hi,
The basic i18n infrastructure is fine and working well, but there are a
...
been planning to have a look at this, but haven't found the time yet.
thank you for making this clear to me.
You can by editing the main forrest sitemap
($FORREST_HOME/main/webapp/sitemap.xmap - change all i18n config options
to 'true'), but that will make forrest incompatible with the command
line crawler (the CLI). The changes I describe will store the current
chosen locale in the session, and use that one if nothing else is
specified/requested (it will take presedence over browser locales, of
course).
I changed the following lines:
...
<map:matchers default="wildcard">
<map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"/>
<map:matcher name="regexp"
src="org.apache.cocoon.matching.RegexpURIMatcher"/>
<map:matcher name="i18n"
src="org.apache.cocoon.matching.LocaleMatcher">
<default-locale language="en" country="US"/>
<negotiate>true</negotiate>
<use-locale>true</use-locale>
<use-locales>true</use-locales>
<use-blank-locale>true</use-blank-locale>
<locale-attribute>locale</locale-attribute>
</map:matcher>
</map:matchers>
<map:actions>
<map:action name="locale"
src="org.apache.cocoon.acting.LocaleAction">
<default-locale language="en" country="US"/>
<use-locale>true</use-locale>
<store-in-request>true</store-in-request>
<create-session>true</create-session>
<store-in-session>true</store-in-session>
<store-in-cookie>true</store-in-cookie>
<locale-attribute>locale</locale-attribute>
</map:action>
</map:actions>
...
My first request gets an jsessid, but my locale seems to switch back
whenever i delete the "locale=EN" from the url. However, i found some
exceptions in my log. I am not sure if they are important for this case.
WARN (2006-12-28) 07:48.44:231 [core.manager] (Unknown-URI)
Unknown-Thread/CoreServiceManager: ComponentLocator exception fro
m parent SM during lookup.
org.apache.avalon.framework.service.ServiceException: Component for key
'org.apache.excalibur.source.SourceResolver' not found. (K
ey='Cocoon')
at
org.apache.cocoon.core.container.SingleComponentServiceManager.lookup(SingleComponentServiceManager.java:68)
at
org.apache.cocoon.core.container.CoreServiceManager.lookup(CoreServiceManager.java:355)
....
WARN (2006-12-28) 07:48.57:628 [core.manager] (/index.html)
PoolThread-4/CoreServiceManager: ComponentLocator exception from
parent SM during lookup.
org.apache.avalon.framework.service.ServiceException: Component for key
'org.apache.cocoon.generation.Generator/<aggregator>' not
found. (Key='Cocoon')
at
org.apache.cocoon.core.container.SingleComponentServiceManager.lookup(SingleComponentServiceManager.java:68)
at
org.apache.cocoon.core.container.CoreServiceManager.lookup(CoreServiceManager.java:355)
at
org.apache.cocoon.core.container.CoreServiceManager.lookup(CoreServiceManager.java:355)
I use the dispatcher with latest svn update.
In addition, I have made a dispatcher contract (dispatcher is 0.8-dev
stuff - if you have more questions, we should probably continue on the
dev list), but I haven't commited that contract, because it presently
relies on features that are incompatible with the CLI. And that is of
course unacceptable. The contract provides a list of avaliable language
versions of a given page, looking at filenames - and in some cases
inside files - to identify the locale of the source. It is a very useful
tool, but it only works in jetty mode (that is, 'forrest run').
Well, full i18n works in jetty mode only too, so maybe one can enable
and disable this contract simply by using or not?
Thanks for your help.
Chris