There is a rails-i18n mailing list you maybe better posting on there,
I'm not sure how many on that list also subscribe to this one. I've
not got time to look at moment, but I think I've already seen this
feature somewhere. A quick Google returned this:

# translations in Ruby
{ :'en-US' => {
  :date => {
    :formats => {
      :default => "%Y-%m-%d"
      # ...
    }
  }
}}


2009/5/22 Colin Law <[email protected]>
>
> 2009/5/22 Clemens Kofler <[email protected]>
>>
>> Hi guys,
>>
>> I was wondering if there's any interest in including support for
>> localized numbers directly in Rails core.
>>
>> Example:
>> �[email protected] = '19,95' # => 19.95
>
> Is that a good idea?  That would mean that if in my application I write, 
> using a literal string,
> @product.price = '19,95'
> the result will be dependent on the locale setting?  Surely not a good idea?
>
> Colin
>
>>
>> There's a really simply way to get this done as can be seen at
>> http://github.com/clemens/delocalize/blob/f6b3dcf3203612c41baeb0f3c0a2de5f99bbe4c3/lib/delocalize/rails_ext/active_record.rb
>> (line 41). In addition it would probably make to include something
>> similar to the FormHelper hack I used in this plugin so text fields
>> localize the number (see
>> http://github.com/clemens/delocalize/blob/f6b3dcf3203612c41baeb0f3c0a2de5f99bbe4c3/lib/delocalize/rails_ext/action_view.rb).
>>
>> I'm definitely sure the Date/Time stuff in this plugin isn't ready for
>> core but the Number stuff IMO is pretty simple and unobtrusive.
>>
>> Any opinions on that? I can submit a patch with tests at any time.
>> - Clemens
>>
>
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to