forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: i18n suggestion
Date Tue, 16 Mar 2004 11:18:23 GMT
Sjur Nørstebø Moshagen wrote:

> På 16. mar. 2004 kl. 12.48 skrev Upayavira:
>
>> cheche@che-che.com wrote:
>>
>>>>     <map:select type="resource-exists">
>>>>       <map:when test="{../1}/{../2}.{lang}-{country}.xml">
>>>>           <map:generate src="{../1}/{../2}.{lang}-{country}.xml"/>
>>>>        </map:when>
>>>>        <map:when test="{../1}/{../2}.{lang}.xml">
>>>>           <map:generate src="{../1}/{../2}.{lang}.xml"/>
>>>>        </map:when>
>>>>        <map:otherwise>
>>>>          <map:generate src="{../1}/{../2}.{global:default-lang}.xml"/>
>>>>        </map:otherwise>
>>>>      </map:select>
>>>
>>>
>>> But on forrest there are txt,ehtml,ihtml,sxw,cwiki extensions, not 
>>> only xml .
>>>
>> Okay. So you're saying that the above method becomes too complex when 
>> you've got multiple formats (four tests per resouce, six source file 
>> types, gives 24 different <map:when> clauses, which certainly is 
>> clunky.)
>
>
> And won't you have to repeat the above on every other sitemap you 
> might have defined? No, I don't like the idea too much, even though it 
> does the job. Your previous suggestion actually looked much better - a 
> slightly more complex generator (than standard) that you can use where 
> and when it's needed.

Yes, it was better, but currently you can't nest input modules, so 
{locale:{1}} isn't possible :-(

Therefore, we've got to come up with something else.

> One more thing to remember: before (or after?) trying the default 
> language, one should also try the exact requested filename (except for 
> the .xml suffix). This way it is easy to override whatever locale 
> preferences are set, to be used for simple locale override cases, and 
> for debugging (as I mentioned earlier).

Look up the LocaleAction, and where it looks for locale information. It 
allows you to specify the locale as a request parameter. Does that get 
you what you want?

Regards, Upayavira


Mime
View raw message