I want browsers to localize data like dates and numbers
Submitted by Koos Looijesteijn
Permalink https://webwewant.fyi/wants/59/
As much of English-written content is targeting an international audience, I'd like to have a way for browsers to automatically show things like dates and numbers in the format that's preferred by the user. For numbers, this may require use of a new element (e.g., amount
).
Example 1: Time
<time datetime="2008-02-14">August 14th 2008</time>
This could render as written or as "14 August 2008", "14. August 2008", or "August 14, 2008", depending on the user's settings.
Example 2: Currency
<amount type="currency" unit="euro" value="2.30">
This would render as "€ 2,30", "2,30 €", or "€ 2.30" depending on the user's settings. Some browsers could even enhance this and provide current price in the users’ preferred currency based on current exchange rates.
Example 3: Weight
<amount type="weight" unit="kg" decimals="1" non-zero-decimals="false">
This could render as "2 kg" or "4.4 lbs" (with proper accessible expansions of units), depending on the user's settings.
- This was presented at
- WordCamp US
–
St. Louis, MO USA
- WordCamp US