W3C home > Mailing lists > Public > public-i18n-geo@w3.org > May 2003

[public-i18n-geo] <none>

From: Russ Rolfe <rrolfe@windows.microsoft.com>
Date: Mon, 5 May 2003 13:42:56 -0700
Message-ID: <F7B97826912BC4419D5DDF53B216945302EE9B23@WIN-MSG-10.wingroup.windeploy.ntdev.microsoft.com>
To: <ishida@w3.org>, <public-i18n-geo@w3.org>
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.  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:

<form .....>
   <select size="1" name="pet">
      <option> cat </option>
      <option> dog </option>
      <option> mouse </option>
   </select>
...
...
</form>

When this is translated to Dutch, the list becomes 

   <form .....>
   <select size="1" name="pet">
      <option> kat </option>
      <option> hond </option>
      <option> 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> hond</option>
      <option> kat </option>
      <option> muis </option>
   </select>
...
...
</form>

This must be done for each language to be displayed.
Received on Monday, 5 May 2003 16:43:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:27:59 UTC