Webform currently offers one prebuilt country list, the English one (afaik). Clients very often request a translated country list which isn't available by default.

I've found a simple solution to meet this request.

  1. Go to the sign up page of Yahoo,
  2. Switch it to the language you'd like to have the translation of (alter the "us" in the url),
  3. Open the source view of the page,
  4. Copy paste all the option tags with a value from between the select tags of the country list,
  5. Currently each option tag looks like this: <option value="xx" >Country name</option>, now find & replace:
    • <option value=" to nothing,
    • " > to nothing,
    • </option> to nothing,
    • " to | (pipe)
  6. Remove the SELECTED attribute from the country that's selected by default, most probably yours obviously,
  7. This will make the options look like this: xx|Country name, perfect for the option list in the webform,
  8. Make sure you set Load a pre-built option list to none before you paste the list.

In addition I've attached 5 translated country lists (.txt) to this post which should be ready to go straight into your webform (Dutch, French, German, Spanish, Russian). Feel free to add your own or to extend the current list of countries.

I'm aware of the fact this could be useful for the language list, but I'm not really sure how to get it in there.

It may come in handy for modules that would like to provide a i18n-supported country list as well, I guess.

Comments

quicksketch’s picture

The country list is already run through the t() function, which means the list of countries can be translated through the locale module just like any other hard-coded string in Drupal. http://api.drupal.org/api/drupal/includes%21iso.inc/function/_country_ge...

knalstaaf’s picture

Status: Active » Closed (works as designed)
knalstaaf’s picture

Issue summary: View changes

alter