You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Rolf Kulemann <ro...@apache.org> on 2004/02/21 09:05:06 UTC

DateInputModule sucks

Hello,

as mentioned in further postings the DateInputModule gets configured on
xconf level, which is not very flexible.

I tried to convert the servertime via the i18n tranformer which works
great. BUT, one problem is that the DateInputModule returns a string
like "Thu Jan" etc. Thus the i18n tranformer needs to know the servers
locale or better the source locale at all, if I want to translate to
german. Otherwise the tranfomrer expects the src locale to be the dest
locale. Question: From where to abtain the servers locale?

To avoid this, I will patch the DateInputModule so that one can specify
the format on xmap level. I.e. like this:

{date:currentDate/format/yyyy-mm-dd hh:mm z}

This would prevent any locale specific formats which make trouble when
converting them with the i18nTranformer.

wdyt?

(Its really easy to convert dates with the i18ntransformer)

-- 
Regards,

    Rolf Kulemann


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: DateInputModule sucks

Posted by Rolf Kulemann <ro...@apache.org>.
On Sat, 2004-02-21 at 12:10, Andreas Hartmann wrote:
> Rolf Kulemann wrote:
> 
> > 
> > 
> > Yes you are right. But what if another "application" within Lenya needs
> > another format?
> 
> Then we should declare a specific instance of the date input
> module for I18n:
> 
> <!-- date input module used by Lenya for I18n -->
> 
> <component-instance name="date-i18n"
>      logger="core.modules.input"
>      class="....modules.input.DateInputModule">
>    <format>yyyy-M-dd HH:mm:ss Z</format>
> </component-instance>

I have thought again about the DateInputModule stuff.
I think the cocoon.xconf way is the one to go.

+1 to use above describe format in cocoon.xconf.


-- 
Regards,

    Rolf Kulemann


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: DateInputModule sucks

Posted by Andreas Hartmann <an...@apache.org>.
Rolf Kulemann wrote:

> 
> 
> Yes you are right. But what if another "application" within Lenya needs
> another format?

Then we should declare a specific instance of the date input
module for I18n:

<!-- date input module used by Lenya for I18n -->

<component-instance name="date-i18n"
     logger="core.modules.input"
     class="....modules.input.DateInputModule">
   <format>yyyy-M-dd HH:mm:ss Z</format>
</component-instance>

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: DateInputModule sucks

Posted by Rolf Kulemann <ma...@rolf-kulemann.com>.
On Sat, 2004-02-21 at 11:23, Andreas Hartmann wrote:
> Rolf Kulemann wrote:
> 
> > Hello,
> > 
> > as mentioned in further postings the DateInputModule gets configured on
> > xconf level, which is not very flexible.
> > 
> > I tried to convert the servertime via the i18n tranformer which works
> > great. BUT, one problem is that the DateInputModule returns a string
> > like "Thu Jan" etc.
> 
> I guess I don't understand you correctly ...
> 
> Can't we configure the DateInputModule in cocoon-xconf.xsl so
> that it returns a locale-independent string like yyyy-mm-dd hh:mm?
> This way, the date could be i18n-ized without knowing the locale,
> couldn't it?

Yes you are right. But what if another "application" within Lenya needs
another format?

That is why I'm interested in making the DateInputModule more flexible.


-- 

Regards,

Rolf Kulemann


"Never underestimate the power of a small tactical nuclear weapon."


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: DateInputModule sucks

Posted by Andreas Hartmann <an...@apache.org>.
Rolf Kulemann wrote:

> Hello,
> 
> as mentioned in further postings the DateInputModule gets configured on
> xconf level, which is not very flexible.
> 
> I tried to convert the servertime via the i18n tranformer which works
> great. BUT, one problem is that the DateInputModule returns a string
> like "Thu Jan" etc.

I guess I don't understand you correctly ...

Can't we configure the DateInputModule in cocoon-xconf.xsl so
that it returns a locale-independent string like yyyy-mm-dd hh:mm?
This way, the date could be i18n-ized without knowing the locale,
couldn't it?

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: DateInputModule sucks

Posted by Rolf Kulemann <ro...@apache.org>.
On Sat, 2004-02-21 at 10:57, Michael Wechner wrote:
> Rolf Kulemann wrote:
> 
> >Hello,
> >
> >as mentioned in further postings the DateInputModule gets configured on
> >xconf level, which is not very flexible.
> >
> >I tried to convert the servertime via the i18n tranformer which works
> >great. BUT, one problem is that the DateInputModule returns a string
> >like "Thu Jan" etc. Thus the i18n tranformer needs to know the servers
> >locale or better the source locale at all, if I want to translate to
> >german. Otherwise the tranfomrer expects the src locale to be the dest
> >locale. Question: From where to abtain the servers locale?
> >
> >To avoid this, I will patch the DateInputModule so that one can specify
> >the format on xmap level. I.e. like this:
> >
> >{date:currentDate/format/yyyy-mm-dd hh:mm z}
> >
> >This would prevent any locale specific formats which make trouble when
> >converting them with the i18nTranformer.
> >
> >wdyt?
> >  
> >
> 
> I guess you mean the DateInputModule which is part of Cocoon
> 
> src/java/org/apache/cocoon/components/modules/input/DateInputModule.java
> 
> right?

Yes.

> 
> If so, then I would suggest that you to post your email to the Cocoon 
> mailing list,
> because the Cocooners might like the idea as well, and then you could do 
> the
> modifications right within Cocoon-2.1.5-dev and Cocoon-2.2
> 
> Makes sense?

Yes, thats what I want. I just want to make sure that this enhancement
makes sense from the lenya point of view.

If so, I will carry the idea out to cocoon land.

-- 
Regards,

    Rolf Kulemann


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: DateInputModule sucks

Posted by Michael Wechner <mi...@wyona.com>.
Rolf Kulemann wrote:

>Hello,
>
>as mentioned in further postings the DateInputModule gets configured on
>xconf level, which is not very flexible.
>
>I tried to convert the servertime via the i18n tranformer which works
>great. BUT, one problem is that the DateInputModule returns a string
>like "Thu Jan" etc. Thus the i18n tranformer needs to know the servers
>locale or better the source locale at all, if I want to translate to
>german. Otherwise the tranfomrer expects the src locale to be the dest
>locale. Question: From where to abtain the servers locale?
>
>To avoid this, I will patch the DateInputModule so that one can specify
>the format on xmap level. I.e. like this:
>
>{date:currentDate/format/yyyy-mm-dd hh:mm z}
>
>This would prevent any locale specific formats which make trouble when
>converting them with the i18nTranformer.
>
>wdyt?
>  
>

I guess you mean the DateInputModule which is part of Cocoon

src/java/org/apache/cocoon/components/modules/input/DateInputModule.java

right?

If so, then I would suggest that you to post your email to the Cocoon 
mailing list,
because the Cocooners might like the idea as well, and then you could do 
the
modifications right within Cocoon-2.1.5-dev and Cocoon-2.2

Makes sense?

Michi

>(Its really easy to convert dates with the i18ntransformer)
>
>  
>


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org