ISO 3166 (for countries) and ISO 639 (for languages) are widely used international standards in information exchange. Websites routinely ask users to select a country or language, but every author must supply and maintain the full list of acceptable values individually. Although projects like Unicode CLDR provide translations and locale-appropriate sort orders for these items, authors must include all of that data themselves.
I want <select> (or perhaps <input>) elements to have a special mode for selecting a country or a language, triggered by an attribute value, so browsers can provide a built-in, localised picker backed by ISO 3166 and ISO 639.
Authors would also need to be able to specify valid values either explicitly or implicitly — by declaring only additions and exclusions from the default set — without having to supply more than the standard two- or three-letter codes. This could work similarly to <input list="…"> with <datalist>:
<datalist id="excluded-countries">
<option value="ru"></option>
</datalist>
<datalist id="additional-countries">
<option value="eu"></option>
</datalist>
<datalist id="supported-languages">
<option value="en"></option>
<option value="en-US"></option>
<option value="es"></option>
<option value="pt-BR"></option>
</datalist>
ISO 3166 (for countries) and ISO 639 (for languages) are widely used international standards in information exchange. Websites routinely ask users to select a country or language, but every author must supply and maintain the full list of acceptable values individually. Although projects like Unicode CLDR provide translations and locale-appropriate sort orders for these items, authors must include all of that data themselves.
I want
<select>(or perhaps<input>) elements to have a special mode for selecting a country or a language, triggered by an attribute value, so browsers can provide a built-in, localised picker backed by ISO 3166 and ISO 639.Authors would also need to be able to specify valid values either explicitly or implicitly — by declaring only additions and exclusions from the default set — without having to supply more than the standard two- or three-letter codes. This could work similarly to
<input list="…">with<datalist>: