Commit 3b64fa1f by Robert Lyon

Bug 1732046: Fixing up the country codes within country lib file

Fixing some mistakes from Bug 1514647 where we forgot to update the Country class, which is used as part of the import/export leap2A process Also adjusting getoptions_country() so that it fetches the 2 char codes from the Country class rather than repeating code. behatnotneeded Change-Id: I901e6a1827da31fbdbb1ac4c9fb8e46b247b5dc2 Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent c06a3565
......@@ -1025,6 +1025,7 @@ $string['country.yt'] = 'Mayotte';
$string['country.mx'] = 'Mexico';
$string['country.fm'] = 'Micronesia, Federated States of';
$string['country.md'] = 'Moldova, Republic of';
$string['country.me'] = 'Montenegro';
$string['country.mc'] = 'Monaco';
$string['country.mn'] = 'Mongolia';
$string['country.ms'] = 'Montserrat';
......@@ -1074,7 +1075,7 @@ $string['country.sm'] = 'San Marino';
$string['country.st'] = 'Sao Tome and Principe';
$string['country.sa'] = 'Saudi Arabia';
$string['country.sn'] = 'Senegal';
$string['country.cs'] = 'Serbia';
$string['country.rs'] = 'Serbia';
$string['country.sc'] = 'Seychelles';
$string['country.sl'] = 'Sierra Leone';
$string['country.sg'] = 'Singapore';
......
......@@ -55,11 +55,6 @@ class Country {
'match' => "^Armenia\$",
),
array(
'2' => 'an',
'3' => 'ant',
'match' => "^Netherlands Antilles\$",
),
array(
'2' => 'ao',
'3' => 'ago',
'match' => "^Angola\$",
......@@ -150,6 +145,11 @@ class Country {
'match' => "^Benin\$",
),
array(
'2' => 'bl',
'3' => 'blm',
'match' => "^Saint Barthelemy\$",
),
array(
'2' => 'bm',
'3' => 'bmu',
'match' => "^Bermuda\$",
......@@ -165,6 +165,11 @@ class Country {
'match' => "^Bolivia\$",
),
array(
'2' => 'bq',
'3' => 'bes',
'match' => "^Bonaire, Sint Eustatius and Saba\$",
),
array(
'2' => 'br',
'3' => 'bra',
'match' => "^Brazil\$",
......@@ -265,11 +270,6 @@ class Country {
'match' => "^Costa Rica\$",
),
array(
'2' => 'cs',
'3' => 'scg',
'match' => "^Serbia and Montenegro\$",
),
array(
'2' => 'cu',
'3' => 'cub',
'match' => "^Cuba\$",
......@@ -280,6 +280,11 @@ class Country {
'match' => "^Cape Verde\$",
),
array(
'2' => 'cw',
'3' => 'cuw',
'match' => "^Curacao\$",
),
array(
'2' => 'cx',
'3' => 'cxr',
'match' => "^Christmas Island\$",
......@@ -390,11 +395,6 @@ class Country {
'match' => "^France\$",
),
array(
'2' => 'fx',
'3' => 'fxx',
'match' => "^France, Metropolitan\$",
),
array(
'2' => 'ga',
'3' => 'gab',
'match' => "^Gabon\$",
......@@ -420,6 +420,11 @@ class Country {
'match' => "^French Guiana\$",
),
array(
'2' => 'gg',
'3' => 'ggy',
'match' => "^Guernsey\$",
),
array(
'2' => 'gh',
'3' => 'gha',
'match' => "^Ghana\$",
......@@ -530,6 +535,11 @@ class Country {
'match' => "^Israel\$",
),
array(
'2' => 'im',
'3' => 'imn',
'match' => "^Isle of Man\$",
),
array(
'2' => 'in',
'3' => 'ind',
'match' => "^India\$",
......@@ -560,6 +570,11 @@ class Country {
'match' => "^Italy\$",
),
array(
'2' => 'je',
'3' => 'jey',
'match' => "^Jersey\$",
),
array(
'2' => 'jm',
'3' => 'jam',
'match' => "^Jamaica\$",
......@@ -682,7 +697,7 @@ class Country {
array(
'2' => 'ly',
'3' => 'lby',
'match' => "^Libyan Arab Jamahiriya\$",
'match' => "^Libya\$",
),
array(
'2' => 'ma',
......@@ -700,6 +715,16 @@ class Country {
'match' => "^Moldova, Republic of\$",
),
array(
'2' => 'me',
'3' => 'mne',
'match' => "^Montenegro\$",
),
array(
'2' => 'mf',
'3' => 'maf',
'match' => "^Saint Martin (French part)\$",
),
array(
'2' => 'mg',
'3' => 'mdg',
'match' => "^Madagascar\$",
......@@ -907,7 +932,7 @@ class Country {
array(
'2' => 'ps',
'3' => 'pse',
'match' => "^Palestinian Territory, Occupied\$",
'match' => "^Palestine, State of\$",
),
array(
'2' => 'pt',
......@@ -940,6 +965,11 @@ class Country {
'match' => "^Romania\$",
),
array(
'2' => 'rs',
'3' => 'srb',
'match' => "^Serbia\$",
),
array(
'2' => 'ru',
'3' => 'rus',
'match' => "^Russian Federation\$",
......@@ -1025,6 +1055,11 @@ class Country {
'match' => "^Suriname\$",
),
array(
'2' => 'ss',
'3' => 'ssd',
'match' => "^South Sudan\$",
),
array(
'2' => 'st',
'3' => 'stp',
'match' => "^Sao Tome and Principe\$",
......@@ -1035,6 +1070,11 @@ class Country {
'match' => "^El Salvador\$",
),
array(
'2' => 'sx',
'3' => 'sxm',
'match' => "^Sint Maarten (Dutch part)\$",
),
array(
'2' => 'sy',
'3' => 'syr',
'match' => "^Syrian Arab Republic\$",
......@@ -1200,6 +1240,11 @@ class Country {
'match' => "^Samoa\$",
),
array(
'2' => 'xk',
'3' => 'xk',
'match' => "^Kosovo\$",
),
array(
'2' => 'ye',
'3' => 'yem',
'match' => "^Yemen\$",
......@@ -1210,11 +1255,6 @@ class Country {
'match' => "^Mayotte\$",
),
array(
'2' => 'xk',
'3' => 'xk',
'match' => "^Kosovo\$",
),
array(
'2' => 'za',
'3' => 'zaf',
'match' => "^South Africa\$",
......@@ -1263,4 +1303,11 @@ class Country {
return null;
}
public static function iso3166_alpha2() {
$alpha2 = array();
foreach (self::$mapping as $countrydata) {
$alpha2[] = $countrydata['2'];
}
return $alpha2;
}
}
......@@ -2001,257 +2001,8 @@ function getoptions_country() {
if (!empty($countries)) {
return $countries;
}
$codes = array(
'af',
'ax',
'al',
'dz',
'as',
'ad',
'ao',
'ai',
'aq',
'ag',
'ar',
'am',
'aw',
'au',
'at',
'az',
'bs',
'bh',
'bd',
'bb',
'by',
'be',
'bz',
'bj',
'bm',
'bt',
'bo',
'bq',
'ba',
'bw',
'bv',
'br',
'io',
'bn',
'bg',
'bf',
'bi',
'kh',
'cm',
'ca',
'cv',
'ky',
'cf',
'td',
'cl',
'cn',
'cx',
'cc',
'co',
'km',
'cg',
'cd',
'ck',
'cr',
'ci',
'hr',
'cw',
'cu',
'cy',
'cz',
'dk',
'dj',
'dm',
'do',
'ec',
'eg',
'sv',
'gq',
'er',
'ee',
'et',
'fk',
'fo',
'fj',
'fi',
'fr',
'gf',
'pf',
'tf',
'ga',
'gm',
'ge',
'de',
'gh',
'gi',
'gr',
'gl',
'gd',
'gp',
'gu',
'gt',
'gg',
'gn',
'gw',
'gy',
'ht',
'hm',
'va',
'hn',
'hk',
'hu',
'is',
'in',
'id',
'ir',
'iq',
'ie',
'im',
'il',
'it',
'jm',
'jp',
'je',
'jo',
'kz',
'ke',
'ki',
'kp',
'kr',
'kw',
'kg',
'la',
'lv',
'lb',
'ls',
'lr',
'ly',
'li',
'lt',
'lu',
'mo',
'mk',
'mg',
'mw',
'my',
'mv',
'ml',
'mt',
'mh',
'mq',
'mr',
'mu',
'yt',
'mx',
'fm',
'md',
'mc',
'mn',
'ms',
'ma',
'mz',
'mm',
'na',
'nr',
'np',
'nl',
'nc',
'nz',
'ni',
'ne',
'ng',
'nu',
'nf',
'mp',
'no',
'om',
'pk',
'pw',
'ps',
'pa',
'pg',
'py',
'pe',
'ph',
'pn',
'pl',
'pt',
'pr',
'qa',
're',
'ro',
'ru',
'rw',
'bl',
'sh',
'kn',
'lc',
'mf',
'pm',
'vc',
'ws',
'sm',
'st',
'sa',
'sn',
'cs',
'sc',
'sl',
'sg',
'sx',
'sk',
'si',
'sb',
'so',
'za',
'gs',
'ss',
'es',
'lk',
'sd',
'sr',
'sj',
'sz',
'se',
'ch',
'sy',
'tw',
'tj',
'tz',
'th',
'tl',
'tg',
'tk',
'to',
'tt',
'tn',
'tr',
'tm',
'tc',
'tv',
'ug',
'ua',
'ae',
'gb',
'us',
'um',
'uy',
'uz',
'vu',
've',
'vn',
'vg',
'vi',
'wf',
'eh',
'ye',
'xk',
'zm',
'zw',
);
require_once(get_config('libroot') . 'country.php');
$codes = Country::iso3166_alpha2();
foreach ($codes as $c) {
$countries[$c] = get_string("country.{$c}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment