Closed Bug 503033 Opened 15 years ago Closed 15 years ago

Contributions page does not accept non-en-US decimal points

Categories

(addons.mozilla.org Graveyard :: Developer Pages, defect, P3)

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: wenzel, Assigned: wenzel)

Details

Attachments

(4 files, 1 obsolete file)

Attached image Screenshot
See attached screenshot: When setting up contributions, the localized decimal point should be supported.

I suggest we always support the dot, and in addition to that allow whatever the local decimal point is (in German, that would be a comma). localeconv [1] knows.

Marking this major, because non-English users will stumble across this almost inevitably.

[1] http://us2.php.net/manual/en/function.localeconv.php
In fact, I am unsure why we use a regex for valid money? is_numeric does the separator-thing automatically. Note though that it would not support the point anymore if the correct one for your locale is a comma. May need to str_replace the point to the appropriate local decimal separator before checking with is_numeric.
We're only supporting USD for this initial launch as we're just testing it out.  I thought there was a "(USD)" label after the box but apparently not.

Would adding that label be enough for people to realize they need to use decimal points?
Sorry, don't want to sound self-centered, but I don't think all people know that English-speaking countries use a point as a decimal point. I could change the German error message for invalid numbers so that it shows "0.00", which would hopefully make people realize that they need to write it like that, but it feels like a duct-tape fix to me :-/

From what I can tell, however, all other localizers that have translated the string preserved the decimal point rather than localizing the value.

I'll change it in the German l10n, but I'd feel bad calling the issue FIXED after this...
I changed it to "0.00" etc in de: r29515.
Jeff added an example in r29519.  Since we're only supporting USD for this run I'm calling this fixed (or wontfix if you like).  If/when we support other currencies we'll make the system more robust, including accepting appropriate decimal points.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
(In reply to comment #5)
> Jeff added an example in r29519.  Since we're only supporting USD for this run
> I'm calling this fixed (or wontfix if you like).  If/when we support other
> currencies we'll make the system more robust, including accepting appropriate
> decimal points.

Although I was a bad student in the German class, I would like to point out that the fact that USD is the only supported currency here has nothing to do with this issue.  In some languages including German, the decimal separator in a number is represented by a comma no matter which unit the number is in.  This is just in the same way that we do not write “12,34 EUR” in the American/British English.
See e.g. http://news.google.com/news?ned=de&hl=de&q=USD

For now, the current hack (writing “0.00”) is probably much better than no hack.  But I wish that this bug will be really fixed in future.

> msgstr "Sollte eine positive Zahl zwischen 0.00 and 99.99 sein."
and -> und?
(In reply to comment #6)
> > msgstr "Sollte eine positive Zahl zwischen 0.00 and 99.99 sein."
> and -> und?

Haha, wow, thanks ;) r29546.

I also agree that this has nothing to do with the currency. Commas stay commas :)

Wil, should we add this to an upcoming milestone? I can probably write a simple patch.
if you like
(In reply to comment #8)
> if you like

Oh, you know I do.
Severity: major → minor
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 5.0.7 → 5.0.8
Assignee: nobody → fwenzel
Priority: -- → P3
Attached patch Patch, rev. 1 (obsolete) — Splinter Review
This patch converts localized "commas" to the point we currently require on the fly.
Attachment #389913 - Flags: review?(clouserw)
Status: REOPENED → ASSIGNED
Comment on attachment 389913 [details] [diff] [review]
Patch, rev. 1

typo: $local_info
Attachment #389913 - Flags: review?(clouserw) → review-
Attached patch Patch, rev. 2Splinter Review
Whoops. Thanks.
Attachment #389913 - Attachment is obsolete: true
Attachment #389969 - Flags: review?(clouserw)
Attachment #389969 - Flags: review?(clouserw) → review+
r30240, thanks.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago15 years ago
Keywords: push-needed
Resolution: --- → FIXED
Is it expected that, even on /de/, the "1,25" I entered gets normalized back to "1.25"?
Verified FIXED per the scope of this bug and comment 14; comment 15, if desired, should be a separate bug.
Status: RESOLVED → VERIFIED
(In reply to comment #16)
> Verified FIXED per the scope of this bug and comment 14; comment 15, if
> desired, should be a separate bug.

I agree, thanks. For the scope of this bug, normalizing back to '.' is expected. I intentionally wanted to allow localized decimal points to be *entered* without screwing with the PayPal side of things.

Choosing the right decimal point when displaying it on the page, that is probably indeed another bug.
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: