Closed Bug 949074 Opened 11 years ago Closed 6 years ago

Provide some sort of basic localization support for <input type=number> in Firefox for Android and Firefox OS

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jwatt, Unassigned)

References

(Blocks 1 open bug)

Details

https://jwatt.org/2013/12/11/input-type-number-coming-to-mozilla

The support for <input type=number> in Nightly and Aurora 28 only supports period as a decimal separator. Is there some sort of temporary hack we can use to make <input type=number> usable for non-English speaking users for Firefox 28? Perhaps even as basic as trying to parse the number and, if it fails, try to reparse it again with any single instance of the comma replaced with a period? I don't know how complex international numbering formatting is, so I've no idea if that's just not good enough. Can anyone with more knowledge about this comment?
v29 should hopefully have a proper solution based on ICU. If the ICU code was simple it might even be possible to uplift that for 28.

I have no time to work on this before next year other than the most simple of solutions though. If someone else wants to take this on I'd be very happy. Basically it would involve replacing this call with something that handles i10n:

https://mxr.mozilla.org/mozilla-central/source/content/html/content/src/HTMLInputElement.cpp?rev=1949b601ca45#4449
A hack of parsing with comma replaced by period badly interacts with using commas as digit separators (999+1 = 1,000).

(I just created bug 953338 on the topic of the current comma separator support.)
Blocks: 679220
You could try to look at any [lang] attribute along the DOM tree, and compile a list of languages that use comma as a decimal separator to match against. That's likely a bit more complicated, but allows for a deterministic behaviour and thus (always working) workarounds.
(In reply to Jonathan Watt [:jwatt] from comment #1)
> v29 should hopefully have a proper solution based on ICU. If the ICU code
> was simple it might even be possible to uplift that for 28.

Except that Firefox for Android and Firefox OS don't include ICU, so fixing bug 844744 doesn't help them. I'm morphing this bug to cover creating some sort of basic support for them.
Summary: Consider a temporary hack to support comma as a decimal separator for <input type=number> for Firefox 28 → Provide some sort of basic localization support for <input type=number> in Firefox for Android and Firefox OS
Blocks: number-input
No longer blocks: 679220
Component: DOM: Core & HTML → Layout: Form Controls
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.