Re: Initial cut at Locale-based forms in HTML pages

A couple of thoughts and observations...

I see two things that Firefox is doing that I feel could help inform users
about what number format is expected.

(1) Locale-specific conversions of the display of inputted numeric values
when the step attribute is used. So, when step = ¡°1¡±, and the input value
is increased:

If lang=¡°en¡±:
- ¡°1.000¡± becomes ¡°2¡±
- ¡°1,000¡± becomes ¡°1001¡±

If lang=¡°fr¡±:
- ¡°1.000¡± becomes ¡°2000¡±
- ¡°1,000¡± becomes ¡°2¡±

This conversion could take place not just with step, but also when focus
is lost. 

A couple of drawbacks with this approach... in order for this to work, the
thousands separator needs to be removed. Also, the conversion would not
take place in time if the next thing the user does is to click on a submit
button (a very likely scenario).

(2) Validation of data inputted by the user, by displaying a red border
around the field when there¡¯s a format mismatch. For example:

- #.###,## when lang = ¡°en¡±
- #,## when lang = ¡°en"
- #,##,###.## when lang != ¡°hi¡±

(3) This is not currently provided by Firefox, but I wonder if users could
be provided with guidance of what the expected format is, similarly to how
the placeholder attribute works (see attachment).

(4) Lastly, I noticed that Firefox also preserves (in addition to
Arabic-Indic) numeric digits for Bengali and Burmese, when using the step
attribute, when lang is set accordingly (e.g. ¡®bn¡¯, ¡®my¡¯). We should
require this for many more numeric systems (Devanagari, Telugu, Malayalam,
Tamil, Khmer, Thai, Lao, Mongolian, Tibetan, etc).

Thoughts?

Thanks,
Leandro




On 10/15/14, 9:40 AM, "Richard Ishida" <ishida@w3.org> wrote:

>On 14/10/2014 17:27, Leandro Reis wrote:
>> Thanks for putting this together, Richard.
>>
>> I support the use of the lang attribute in the form control for locale
>> identification, but there are certain valid BCP47 values, such as those
>> with just the language tag, that are insufficient to help determine
>>which
>> format to use with numbers, dates, and times. For example, ©øfr©÷ does not
>> provide enough information to determine whether the decimal separator to
>> use should be the comma (as used in France) or the period (as used in
>> Switzerland). Same problem arises with invalid language tags.
>>
>> For such cases, shall we explicitly specify that a fallback locale
>>(which
>> provides sufficient information) should be used?
>
>hi Leandro,
>
>Sorry to be late answering this. Addison already gave the answer I
>would.  In fact, we do allude to this in the wiki page under the heading
>"Where to declare the language tag that will be used for locale
>setting?", but I thought it raised some additional questions, and so I
>created a new section "What to do if the locale is under-specified?".
>
>I also added some more discussion text to the former section.
>
>cheers,
>ri
>
>
>

Received on Monday, 20 October 2014 16:14:23 UTC