- From: Martin Duerst <duerst@w3.org>
- Date: Mon, 05 May 2003 17:23:48 -0400
- To: "Russ Rolfe" <rrolfe@windows.microsoft.com>, <ishida@w3.org>, <public-i18n-geo@w3.org>
Hello Russ, This is a good example, a bit too specific for the first question for my taste, but I think we should just go with it. A few comments below: At 13:42 03/05/05 -0700, Russ Rolfe wrote: >Richard, > >Here is my question as promised Let me know what we need to do next. > >Regards, Russ > >=-=-=-=-=-=-=-=-= >Question: > >As part of a form, I have a list of terms in a drop-down box. Why are >they not correctly sorted when I translate the items in the list? > > >Answer: > >Although many programming languages have devices like drop-down boxes that >have the capability of sorting a list of items before displaying them as >part of their functionality. Half a sentence. Needs completion. >The HTML <select> function has no such capabilities. It will list the ><options> in the order received. Thus one must manually pre-sort their >translated options before presenting them to the client. > >For example, lets say we have a pull-down list for types of pets. In the >list, we have the following in alphabetical order: The problem with this example is that the script that gets the input has to react to cat, kat, dog, hound,... and it's getting worse when more options are added. I strongly suggest we use the 'value' attribute: ><form .....> > <select size="1" name="pet"> > <option value='cat'> cat </option> > <option value='dog'> dog </option> > <option value='mouse'> mouse </option> > </select> >... >... ></form> > >When this is translated to Dutch, the list becomes > > <form .....> > <select size="1" name="pet"> > <option value='cat'> kat </option> > <option value='dog'> hond </option> > <option value='mouse'> muis </option> > </select> >... >... ></form> > >But for it to be in correct Dutch alphabetical order we will need to >re-arrange to list to: > > > <form .....> > <select size="1" name="pet"> > <option value='dog'> hond</option> > <option value='cat'> kat </option> > <option value='mouse'> muis </option> > </select> >... >... ></form> > >This must be done for each language to be displayed. Regards, Martin.
Received on Monday, 5 May 2003 17:24:46 UTC