forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <>
Subject Re: i18n switch
Date Wed, 27 Dec 2006 13:22:20 GMT
Hello Chris,

The basic i18n infrastructure is fine and working well, but there are  
a few known shortcomings, the major one being that the CLI crawler  
(used with forrest site) isn't i18n aware. Thus, running forrest as  
'forrest run' (with the bundled Jetty) is working ok, but generating  
static, multilingual pages isn't that straightforward. There is a  
cumbersome workaround documented somewhere.

Because of the i18n problems with the CLI, full support for i18n is  
by default turned off in the main forrest sitemap, thus forrest won't  
remember which locale you last used when requesting a new page. I  
have been planning to have a look at this, but haven't found the time  

Den 27. des. 2006 kl. 09.12 skrev C. Grobmeier:

> Hi all,
> i saw that i18n is quite easy with forrest. I just added  
> to my directory and everything went fine. With the  
> param ?locale=fr i can switch to the french version.
> When i have german locale on is it possible to click on something  
> and say:"from nowon use EN locale instead?". Maybe i can easily put  
> in a session or..?

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).

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').

> Btw: when i try:
> http://localhost:8888/samples/demo-i18n.html?locale=fr
> it wents to the french version, with
> http://localhost:8888/samples/demo-i18n.html
> i am at the german version, but with:
> http://localhost:8888/samples/demo-i18n.html?locale=en
> nothing happens. I think i must have an demo-i18n.en.html  
> somewhere, must i?

I think there should be one already (as the default language), but I  
can't find it. But yes, you need an English file, either as a default  
file, or as you have listed it above.

> Hope you had all great christmas :-)
> Regards
> Chris.

Thanks, the same to you:-)

Best regards,

View raw message