[prev in list] [next in list] [prev in thread] [next in thread] 

List:       forrest-dev
Subject:    Re: Q: Further i18n and ISO 639-2 support
From:       Juan Jose Pablos <cheche () che-che ! com>
Date:       2002-01-01 14:01:47
Message-ID: 3C31C14B.6030803 () che-che ! com
[Download RAW message or body]

Sjur Nørstebø Moshagen wrote:
> 
> 
> Hm, feel strong enough, but I'm lacking the skills :-(
> 
That's fine, maybe you can help wih the testing & documentation :-)

> 
> There are basically three issues:
> 
possibly more :-)

> 0) Defining the site languages
> 
I am not sure about this one.

IMO, language is another representation of the same "foo". So if you 
request foo.{format} forrest should look for foo.{lang}.{source}. But 
this is on resource level not for the whole site.


> 
> 3) Store/use the selection to serve the intended version
> 

I do not see the need to store that selection. We do not store menus or 
trails.

> 
> *First problem*: I don't know how to do this, I assume I would need to 
> do this in Java, which is beyond me.
> 



We can use the directory generator for this:
<map:match pattern="*.xml">
   <action type="locale">
     <map:generate type="directory" src="{project:content.xdocs}{1}_{lang}">
   </action>
</map:match>

> 2) Building a selection list for the user
> 
> Given 0) and 1), this step should not be too complicated (similar to 
> building the site menu?), but I'm rather new to both cocoon and forrest, 
> so any help would be appreciated.
> 

Check on the code used to create the menu.

> 3) store the selection/take action
> 
> There are a couple of options here. The simplest solution is to just 
> serve the language version "as is": the selection "deutsch" based on the 
> above list would be a link to the file index_de.html. With this 
> approach, no info is stored, and no further action is taken. Thus, the 
> user most likely will have to click on "deutsch" again for the next 
> page, unless forrest, upon serving index_de.html, appends _de to all 
> links on that page.
> 

Well, I understand, what you meant about store. Actually this is the 
first problem to resolve. When you make a request "foo.html" Forrest 
display the correct content, but the file name is the same so if you 
saved, it does not containt the language information on the uri.

You need to modify the filename to get apache negociation content support.

Anyone can give a hand on this? I am not sure about the best approach.

1) move foo.{format} to foo.{format}.{lang}
2) move foo.{format} to foo.{land}.{format} and create var files with 
this info:

URI: foo.{lang}.{format}
Content-type: text/{format};charset=iso-8859-1
Content-language: {lang}


> A better approach would be to set the session language based on the user 
> selection, and optionally also a cookie for later perusal. But I'm 
> clueless (more or less) as to how this should be done. Again, any 
> help/cooperation would be appreciated;)

But that information get lost when you saved the file. Forrest is used 
mainly to get static content. Dinamic content is to allow faster 
development, and it should be consistency.


Cheers,
Cheche

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic