[whatwg] Localisation of form fields

Benjamin Hawkes-Lewis bhawkeslewis at googlemail.com
Mon May 7 03:09:10 PDT 2012


>> 2/ FormatSettings object
>> [Constructor(),
>>  Constructor(DOMString locale),
>>  Constructor(FormatSettings locale),
>> ]
>> interface FormatSettings {
>>    attribute DOMString CurrencyString;
>>    attribute Number CurrencyFormat;
>>    attribute Number CurrencyDecimals;
>>    attribute DOMString ThousandSeparator;
>>    attribute DOMString DecimalSeparator;
>>    attribute DOMString DateSeparator;
>>    attribute DOMString TimeSeparator;
>>    attribute DOMString ShortDateFormat;
>>    attribute DOMString LongDateFormat;
>>    attribute DOMString TimeAMString;
>>    attribute DOMString TimePMString;
>>    attribute DOMString ShortTimeFormat;
>>    attribute DOMString LongTimeFormat;
>>    attribute Array ShortMonthNames;
>>    attribute Array LongMonthNames;
>>    attribute Array ShortDayNames;
>>    attribute Array LongDayNames;
>>    attribute bool DaylightSavingTime;
>>    attribute Number TimeZoneOffset;
>>
>>    DOMString format (String input, Array data)
>>
>>    Number CurrencyAsNumber (DOMString value)
>>    Number StringAsNumber (DOMString value)
>>    Date StringAsDate (DOMString value)
>>
>>   [and probably set of constants representing different types of error
>> regarding formatting and data sanitation]
>> }
>
> What does the JS library space look like on this front? Is this something
> that's done at all?

What are you looking for?

There is plenty of JS i18n code out there for formatting and parsing
dates and numbers.

Are you talking specifically about conversion of form values between
an over-the-wire format and a localized display format?

--
Benjamin Hawkes-Lewis



More information about the whatwg mailing list