Here are a couple ISO country changes, as per http://www.iso.org/iso/iso_3166-1_newsletter_vi-8_split_of_the_dutch_ant...

Deleted

  • "Netherlands Antilles" (AN)

Added

  • "Curaçao (CW)"
  • "Sint Maarten (Dutch part) (SX)"
  • "Bonaire, Saint Eustatius and Saba (BQ)"

Git newbe, so no patch sorry. :(

Comments

droplet’s picture

Category: feature » task
Status: Active » Needs review
StatusFileSize
new15.84 KB
new15.8 KB
new16.2 KB
new16.16 KB

i created 2 patch:
1. add & remove country
2. only add new country (some D7 site already there and the users set Deleted country)

** some country name is changed.

wrote a dummy code script to catch it


// get iso country 

print '<pre>';

$lines = file('http://www.iso.org/iso/list-en1-semic-3.txt');

foreach ($lines as $line_num => $line) {
    $line = trim($line);
    $country = explode(";", $line);
    $country_name = preg_replace_callback("/\w+/",'ucfirst_some',$country['0']);
    $iso[$country['1']] = $country_name;
}

ksort($iso);

foreach ($iso as $country_code => $country_name) {
   $format = '\'%s\' => $t(\'%s\'),';
   printf($format, $country_code, $country_name);
   echo "\n";
}

print '</pre>';



function ucfirst_some($match)
{
    $exclude = array('and','not');
    if ( in_array(strtolower($match[0]),$exclude) ) return strtolower($match[0]);
    
    if ( in_array($match[0], array('McDonald')) ) return $match[0];
    
    return ucfirst(strtolower($match[0]));
}

alan d.’s picture

Some of the name changes may require feedback, like "Venezuela" to "Venezuela, the Bolivarian Republic of".

To prevent data loss, I would only add the new names. The countries module allows users to directly update the names as required, and to disable "Netherlands Antilles" if they so desire.

catch’s picture

Status: Needs review » Closed (duplicate)