Hi,
The implementation of HTML5's <input type=number> (a number spinner form
control) is scheduled for release in v29. There is l10n support built in now
(except in Firefox Mobile and Firefox OS, which don't yet have ICU built in) is
it would be great if you guys could test it out and report any bugs, CC'ing me
please:
https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=DOM%3A%20Core%20%26%20HTML
The locale sources for the input are, in order of priority:
1) a 'lang'/'xml:lang' attribute on the input element or nearest ancestor
2) the page's HTTP Content-Language, either via a <meta> tag or the HTTP
headers
3) the locale of the application
Localization happens in two directions:
A) parsing a localized number string that the user types in
B) formatting the internal number to the user's locale for display to
the user when the number is set/changes in some other way
In both cases we check the first locale source and try to do the localization
using that locale. If that fails we try the next locale source. And so on.
I should also say a few things about the grouping separator(s) (the "thousands
separator" in most locales).
The parser will accept numbers both with or without the grouping separator, but
the grouping separator must be in the correct location or else there will be a
parse error. So, for example, if the user types in "123.456,78" and we're using
the locale "de" then the parser will succeed and return the value 123456.78. If
on the other hand they type "12.3456,78" there will be a parse error because the
"." is in a bad position.
The formatter will by default insert grouping separator characters using the
locale's grouping separator(s) when formatting numbers. If most users using that
locale would prefer not to see/use grouping separators then localizers have a
pref available to them to stop the formatter from inserting grouping separator
characters. If the boolean pref dom.forms.number.grouping is set to true the
formatter will insert grouping separator characters. If the pref is set to false
it will not.
Regards,
Jonathan