forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Nørstebø Moshagen <>
Subject Re: Q: Further i18n and ISO 639-2 support
Date Wed, 10 Mar 2004 07:18:05 GMT

> I have just update the CVS to have i18n support for a single language
> file i.e index_es.xml and index_en.xml


> I am not sure about this question. Up to now. "forrest run" supports
> some i18n, but I think that needs more work, like default language 
> setting.


>> 2) One thing is still missing: a div with language selections for the
>> user. Selecting a language should set a session language and/or 
>> cookie,
>> thus overriding any browser/httpd negotiation selection. As is
>> mentioned in the #FOR-18 discussion, this is needed for users that 
>> does
>> not know how to set browser languages (or in cases where it is not
>> possible to set the wanted language), or when using a "foreign"
>> computer at a cafe or similar. This div should be on/off by a
>> forrest/site setting, thus available for users needing it.
> Agree. If you feel strong enough, give it a try.

Hm, feel strong enough, but I'm lacking the skills :-(

But let's see how far I can get with some help... ;)

There are basically three issues:

0) Defining the site languages

1) Getting the list of available versions for a document

2) Building a selection list based on the 1) list, and present it to 
the user

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

(ok, four issues, then;)

In detail:

0) We need a place to store a list of available languages for a given 
site, in an attribute-value type of structure, where the attribute 
would be ISO 639 language codes (or strings corresponding to the set of 
recognised language_country_encoding_variation extensions), and the 
value of the actual name of the language in the language itself (to be 
used in the generation of the user interface part). This list could 
also be used to filter/check that no versions of a page exist that is 
not covered by this list - an error here would indicate either a typo, 
or that the language list needs to be updated.

There are (at least) three points to discuss:
- where to store such a list
- the exact format of this list
- is such a list the best way of doing what I'm describing?

1) Since we can't know for sure that every file in the whole site will 
always be available in all and only the languages defined for the site, 
we have to check which versions are available for a given page to build 
a language menu for that page. That is, if the request is for:


and we have


we should get back a list containing [en, de, es, nn, sma].

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

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.

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.

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

>> 3) ... only three-letter ISO
>> 639-2 codes. Will such codes be handled equally well, ...?
> It works fine. I have just try. If your setting language is esp then It
> looks for index_esp.xml menu_esp.xml and tabs_esp.xml

Thanks for testing & reporting!


View raw message