Storing numeric/data/currency etc.

1 view
Skip to first unread message

Maciej Piechotka

unread,
Jun 24, 2008, 12:26:17 PM6/24/08
to Merb Global Mailing List
1. What should be stored in the database? I.e. number, data, currency
and something else or that's it?

2. In what format should it be stored (well - the problem with every
provider but GetText)?
I.e in single table merged with Language table or in separate? etc.

Regards

signature.asc

Alexander Coles

unread,
Jun 24, 2008, 1:04:31 PM6/24/08
to merb_...@googlegroups.com
I think if we're talking about a series of helper methods that provide
support for formatting currencies?

Maciej Piechotka

unread,
Jun 24, 2008, 3:14:24 PM6/24/08
to merb_...@googlegroups.com
On Tue, 2008-06-24 at 19:04 +0200, Alexander Coles wrote:
> I think if we're talking about a series of helper methods that provide
> support for formatting currencies?
>

Yes.

12000.localize
Date.new(2008, 06, 24).localize
etc.

Regards

signature.asc

Alexander Coles

unread,
Jun 24, 2008, 3:18:37 PM6/24/08
to merb_...@googlegroups.com

OK thanks for clarifying.
I'd prefer to keep information defined statically - in Hashes, etc. -
unless it changes on a daily basis (e.g. currency conversion rates).

Do we want to reopen and add methods to String, Fixnum? (I guess maybe
I am still enough of a Java developer, to find this a little
irksome ;) )

Alex

Maciej Piechotka

unread,
Jun 24, 2008, 4:29:24 PM6/24/08
to merb_...@googlegroups.com
On Tue, 2008-06-24 at 21:18 +0200, Alexander Coles wrote:
> On Jun 24, 2008, at 9:14 PM, Maciej Piechotka wrote:
>
> > On Tue, 2008-06-24 at 19:04 +0200, Alexander Coles wrote:
> >> I think if we're talking about a series of helper methods that
> >> provide
> >> support for formatting currencies?
> >>
> >
> > Yes.
> >
> > 12000.localize
> > Date.new(2008, 06, 24).localize
> > etc.
>
> OK thanks for clarifying.
> I'd prefer to keep information defined statically - in Hashes, etc. -
> unless it changes on a daily basis (e.g. currency conversion rates).
>

Ok. But it should be somehow generated - may be from glibc locale files
(I need to get into it deeper and consider license problems).

> Do we want to reopen and add methods to String, Fixnum? (I guess maybe
> I am still enough of a Java developer, to find this a little
> irksome ;) )
>

It is done in rails. It is done in merb and rails - why not?
Possibly even:
"Hi! Hello %".localize % current_user.name
Instead of (or rather in addition to):
_("Hi! Hello %") % current_user.name

> Alex

Maciej

signature.asc

Alexander Coles

unread,
Jun 24, 2008, 4:45:17 PM6/24/08
to merb_...@googlegroups.com

On Jun 24, 2008, at 10:29 PM, Maciej Piechotka wrote:

> On Tue, 2008-06-24 at 21:18 +0200, Alexander Coles wrote:
>> On Jun 24, 2008, at 9:14 PM, Maciej Piechotka wrote:
>
> Ok. But it should be somehow generated - may be from glibc locale
> files
> (I need to get into it deeper and consider license problems).

OK, agreed. Let's not reinvent the wheel. I think users should only be
required to store data that is updated continually in the database.

>> Do we want to reopen and add methods to String, Fixnum? (I guess
>> maybe
>> I am still enough of a Java developer, to find this a little
>> irksome ;) )
>>
>
> It is done in rails. It is done in merb and rails - why not?
> Possibly even:
> "Hi! Hello %".localize % current_user.name
> Instead of (or rather in addition to):
> _("Hi! Hello %") % current_user.name
>

Sure, sure. But I think it should be done to a minimal rather than
maximum extent .. we really need to think this through to avoid
conflicts/ collisions.

For example, extlib (used by DataMapper, DataObjects) adds the #t
method to String for performing translations.

Alex

Reply all
Reply to author
Forward
0 new messages