On Fri, Jun 25, 2010 at 15:24, Rodrigo Rosenfeld Rosas
<[email protected]> wrote:
> Em 25-06-2010 14:54, Norman Clarke escreveu:
>>
>
> I need to invest too many time for trying to convince the core team to give
> more love to i18n issues that I've just given up. It doesn't worth... :(
>
> And that is the only topic I'm sad about Rails. All the remaining parts are
> just perfect!
Well, try not to get too frustrated. I think that's usually how it
goes with any large, busy open source project. Looks like in that
ticket's thread José took a pretty good amount of time to reply to you
- and people don't usually waste time replying if they simply don't
care.
Contributing to open source takes a lot of persistence and thick skin.
I've had my fair share of patches rejected and ignored, too. Anyway, I
think you've consistently raised important issues on this list, and
given useful answers to other people's questions. I'm not a member of
the Rails core team, but I would encourage you to keep doing what you
are doing. :)
> In any event I do still think a local-aware `to_f` and `to_i` could be
>>
>> useful as top-level I18n methods. You may need to do locale-aware
>> casts outside validations, and you may need to do them for a specific
>> locale even though your current locale is set to something else, e.g.:
>>
>> I18n.to_f("100,001", :locale => :pt_br) #=> 100.001
>> I18n.to_f("100,001", :locale => :en_us) #=> 100001.00
>>
> Sure, this would be a great feature for I18n gem. But this would be probably
> better implemented like:
>
> I18n.locale = :'pt-BR'
> I18n.l(13.5, 3) # => 13,500 (for locale=pt-BR)
That's actually the opposite of what I'm suggesting. That method
formats an object so that it can be displayed according to the
settings for the locale.
I'm taking about adding a method that accepts localized input like
"10.000,001" and returns the correct float value.
But you're right: that method should be made to work correctly for the
case you gave; and if not, then at least the documentation should be
changed.
--
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.