--- a/geocoder.widget.inc 2012-08-21 16:48:36.000000000 +0200 +++ b/geocoder.widget.inc 2013-09-09 12:19:16.407843705 +0200 @@ -401,13 +401,23 @@ * Geocoder Widget - Parse an address field */ function geocoder_widget_parse_addressfield($field_item) { + // Try to translate the iso country code to the country name, for better + // geocoding through Google. + $country_name = $field_item['country']; + if (!empty($field_item['country'])) { + if (function_exists('country_load')) { + $country_object = country_load($field_item['country']); + $country_name = $country_object->official_name; + } + } + $address = ''; if (!empty($field_item['premise'])) $address .= $field_item['premise'] . ','; if (!empty($field_item['thoroughfare'])) $address .= $field_item['thoroughfare'] . ','; if (!empty($field_item['locality'])) $address .= $field_item['locality'] . ','; if (!empty($field_item['administrative_area'])) $address .= $field_item['administrative_area'] . ','; if (!empty($field_item['sub_administrative_area'])) $address .= $field_item['sub_administrative_area'] . ','; - if (!empty($field_item['country'])) $address .= $field_item['country'] . ','; + if (!empty($country_name)) $address .= $country_name . ','; if (!empty($field_item['postal_code'])) $address .= $field_item['postal_code'] . ','; $address = rtrim($address, ', ');