Em 25-06-2010 15:45, Norman Clarke escreveu:
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.
Do you have any real use case where it would make sense to use
I18n.to_f(number, locale) instead of I18n.l(number, precision)?
Usually an application will be either a single-language application or
an internationalized one. If it is a single-language application,
I18n.default_locale would always format float numbers accordingly.
If it is a multi-language application, the locale wil probably be set by
a before_filter on each request from user's preference or from a URL
prefix, for instance. In this case, calling I18n.l(number) would use
that locale for any conversion.
What would be a real use case for the other proposal (I18n.to_f(float,
locale))?
Best Regards,
Rodrigo.
p.s: thank you for trying to reduce my frustrations, but I really don't
like to waste my time. That doesn't mean I stopped contributing at all.
I'm just not contributing to Rails any time soon... I'll use my free
time for contributing to other projects with lower barriers, such as
Redmine, some Rails plugins and others. When I have some free time
again, I'll make a second attempt of contributing to Gitorious. In the
first one, I've submitted a simple merge request for correcting the
Gitorious name in two places (it was Gitorius in 2 places). I've got no
feedback for a long time. Some day they have corrected the name but
didn't update my merge request to cancel it so that I had to close it
myself.
Some months ago I've modified my local installation of Gitorious for
allowing tree view of the repository source-code and it is working great
at my company. But I didn't submit yet because I need to organize it a
bit more before requesting a merge from Gitorious commiters. But I'm
postponing this because of my previous experience with Gitorious
feedback. I feel that my effort will be wasted, but I'll try it anyway
when I get some free time. If I don't get any feedback I'll give up on
contributing to Gitorious too.
I had a much better experience contributing to Redmine and EzGraphix
plugin for Rails... So, I'll probably concentrate my efforts on these
projects instead, for instance...
I appreciate your words anyway, thank you.
--
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.