cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Patch for i18n bug in forms samples
Date Tue, 08 Nov 2005 10:10:11 GMT
Upayavira wrote:
> Paul Focke wrote:
>   
>> Hi,
>>
>> Here is a patch which fixes the i18n in the forms samples.  All it does
>> is add 2 lines to src/blocks/forms/samples/sitemap.xmap.
>>
>> Judging by the sheer weight of this patch, I'm supposing that a jira
>> issue is not necessary.
>>
>> ------------------------------------------------------------------------
>>
>> Index: src/blocks/forms/samples/sitemap.xmap
>> ===================================================================
>> --- src/blocks/forms/samples/sitemap.xmap	(revision 331290)
>> +++ src/blocks/forms/samples/sitemap.xmap	(working copy)
>> @@ -217,7 +217,9 @@
>>          | Show a form, using the jx template macros
>>          -->
>>       <map:match pattern="*-display-pipeline.jx">
>> -       <map:generate type="jx" src="forms/{1}_template.xml" label="content1"/>
>> +       <map:generate type="jx" src="forms/{1}_template.xml" label="content1">
>> +         <map:parameter name="locale" value="{flow-attribute:locale}"/>
>> +       </map:generate>
>>         <map:transform type="browser-update"/>
>>         <map:transform type="i18n">
>>           <map:parameter name="locale" value="{flow-attribute:locale}"/>
>>     
>
> A ver interesting patch. However, I can't see quite how it would work.
> It replaces the 'locale' attribute with, well, 'locale'. Hmm.
>
> Can you explain a bit more what the problem is that it is fixing? And
> how does this patch fix it? What am I misunderstanding?
>   

I more and more annoyed by the way i18n is handled (or not in Cocoon). 
IMO, we should unify the locale handling in one place: request.getLocale().

Since Cocoon uses its own wrappers to environment objects, we can 
implement request.getLocale() in the same way that LocaleAction does. 
This will avoid passing these "locale" parameters around everywhere.

The LocaleAction will only be of use when we want to handle language 
selection from the user (i.e. change the locale and store it in the 
session or in a cookie).

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message