iso.inc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <?php
  2. /**
  3. * @file
  4. * Provides a list of countries and languages based on ISO standards.
  5. */
  6. /**
  7. * Get an array of all country code => country name pairs.
  8. *
  9. * Get an array of all country code => country name pairs as laid out
  10. * in ISO 3166-1 alpha-2.
  11. * Grabbed from location project (http://drupal.org/project/location).
  12. * @return
  13. * An array of all country code => country name pairs.
  14. */
  15. function _country_get_predefined_list() {
  16. static $countries;
  17. if (isset($countries)) {
  18. return $countries;
  19. }
  20. $t = get_t();
  21. $countries = array(
  22. 'AD' => $t('Andorra'),
  23. 'AE' => $t('United Arab Emirates'),
  24. 'AF' => $t('Afghanistan'),
  25. 'AG' => $t('Antigua and Barbuda'),
  26. 'AI' => $t('Anguilla'),
  27. 'AL' => $t('Albania'),
  28. 'AM' => $t('Armenia'),
  29. 'AN' => $t('Netherlands Antilles'),
  30. 'AO' => $t('Angola'),
  31. 'AQ' => $t('Antarctica'),
  32. 'AR' => $t('Argentina'),
  33. 'AS' => $t('American Samoa'),
  34. 'AT' => $t('Austria'),
  35. 'AU' => $t('Australia'),
  36. 'AW' => $t('Aruba'),
  37. 'AX' => $t('Aland Islands'),
  38. 'AZ' => $t('Azerbaijan'),
  39. 'BA' => $t('Bosnia and Herzegovina'),
  40. 'BB' => $t('Barbados'),
  41. 'BD' => $t('Bangladesh'),
  42. 'BE' => $t('Belgium'),
  43. 'BF' => $t('Burkina Faso'),
  44. 'BG' => $t('Bulgaria'),
  45. 'BH' => $t('Bahrain'),
  46. 'BI' => $t('Burundi'),
  47. 'BJ' => $t('Benin'),
  48. 'BL' => $t('Saint Barthélemy'),
  49. 'BM' => $t('Bermuda'),
  50. 'BN' => $t('Brunei'),
  51. 'BO' => $t('Bolivia'),
  52. 'BR' => $t('Brazil'),
  53. 'BS' => $t('Bahamas'),
  54. 'BT' => $t('Bhutan'),
  55. 'BV' => $t('Bouvet Island'),
  56. 'BW' => $t('Botswana'),
  57. 'BY' => $t('Belarus'),
  58. 'BZ' => $t('Belize'),
  59. 'CA' => $t('Canada'),
  60. 'CC' => $t('Cocos (Keeling) Islands'),
  61. 'CD' => $t('Congo (Kinshasa)'),
  62. 'CF' => $t('Central African Republic'),
  63. 'CG' => $t('Congo (Brazzaville)'),
  64. 'CH' => $t('Switzerland'),
  65. 'CI' => $t('Ivory Coast'),
  66. 'CK' => $t('Cook Islands'),
  67. 'CL' => $t('Chile'),
  68. 'CM' => $t('Cameroon'),
  69. 'CN' => $t('China'),
  70. 'CO' => $t('Colombia'),
  71. 'CR' => $t('Costa Rica'),
  72. 'CU' => $t('Cuba'),
  73. 'CW' => $t('Curaçao'),
  74. 'CV' => $t('Cape Verde'),
  75. 'CX' => $t('Christmas Island'),
  76. 'CY' => $t('Cyprus'),
  77. 'CZ' => $t('Czech Republic'),
  78. 'DE' => $t('Germany'),
  79. 'DJ' => $t('Djibouti'),
  80. 'DK' => $t('Denmark'),
  81. 'DM' => $t('Dominica'),
  82. 'DO' => $t('Dominican Republic'),
  83. 'DZ' => $t('Algeria'),
  84. 'EC' => $t('Ecuador'),
  85. 'EE' => $t('Estonia'),
  86. 'EG' => $t('Egypt'),
  87. 'EH' => $t('Western Sahara'),
  88. 'ER' => $t('Eritrea'),
  89. 'ES' => $t('Spain'),
  90. 'ET' => $t('Ethiopia'),
  91. 'FI' => $t('Finland'),
  92. 'FJ' => $t('Fiji'),
  93. 'FK' => $t('Falkland Islands'),
  94. 'FM' => $t('Micronesia'),
  95. 'FO' => $t('Faroe Islands'),
  96. 'FR' => $t('France'),
  97. 'GA' => $t('Gabon'),
  98. 'GB' => $t('United Kingdom'),
  99. 'GD' => $t('Grenada'),
  100. 'GE' => $t('Georgia'),
  101. 'GF' => $t('French Guiana'),
  102. 'GG' => $t('Guernsey'),
  103. 'GH' => $t('Ghana'),
  104. 'GI' => $t('Gibraltar'),
  105. 'GL' => $t('Greenland'),
  106. 'GM' => $t('Gambia'),
  107. 'GN' => $t('Guinea'),
  108. 'GP' => $t('Guadeloupe'),
  109. 'GQ' => $t('Equatorial Guinea'),
  110. 'GR' => $t('Greece'),
  111. 'GS' => $t('South Georgia and the South Sandwich Islands'),
  112. 'GT' => $t('Guatemala'),
  113. 'GU' => $t('Guam'),
  114. 'GW' => $t('Guinea-Bissau'),
  115. 'GY' => $t('Guyana'),
  116. 'HK' => $t('Hong Kong S.A.R., China'),
  117. 'HM' => $t('Heard Island and McDonald Islands'),
  118. 'HN' => $t('Honduras'),
  119. 'HR' => $t('Croatia'),
  120. 'HT' => $t('Haiti'),
  121. 'HU' => $t('Hungary'),
  122. 'ID' => $t('Indonesia'),
  123. 'IE' => $t('Ireland'),
  124. 'IL' => $t('Israel'),
  125. 'IM' => $t('Isle of Man'),
  126. 'IN' => $t('India'),
  127. 'IO' => $t('British Indian Ocean Territory'),
  128. 'IQ' => $t('Iraq'),
  129. 'IR' => $t('Iran'),
  130. 'IS' => $t('Iceland'),
  131. 'IT' => $t('Italy'),
  132. 'JE' => $t('Jersey'),
  133. 'JM' => $t('Jamaica'),
  134. 'JO' => $t('Jordan'),
  135. 'JP' => $t('Japan'),
  136. 'KE' => $t('Kenya'),
  137. 'KG' => $t('Kyrgyzstan'),
  138. 'KH' => $t('Cambodia'),
  139. 'KI' => $t('Kiribati'),
  140. 'KM' => $t('Comoros'),
  141. 'KN' => $t('Saint Kitts and Nevis'),
  142. 'KP' => $t('North Korea'),
  143. 'KR' => $t('South Korea'),
  144. 'KW' => $t('Kuwait'),
  145. 'KY' => $t('Cayman Islands'),
  146. 'KZ' => $t('Kazakhstan'),
  147. 'LA' => $t('Laos'),
  148. 'LB' => $t('Lebanon'),
  149. 'LC' => $t('Saint Lucia'),
  150. 'LI' => $t('Liechtenstein'),
  151. 'LK' => $t('Sri Lanka'),
  152. 'LR' => $t('Liberia'),
  153. 'LS' => $t('Lesotho'),
  154. 'LT' => $t('Lithuania'),
  155. 'LU' => $t('Luxembourg'),
  156. 'LV' => $t('Latvia'),
  157. 'LY' => $t('Libya'),
  158. 'MA' => $t('Morocco'),
  159. 'MC' => $t('Monaco'),
  160. 'MD' => $t('Moldova'),
  161. 'ME' => $t('Montenegro'),
  162. 'MF' => $t('Saint Martin (French part)'),
  163. 'MG' => $t('Madagascar'),
  164. 'MH' => $t('Marshall Islands'),
  165. 'MK' => $t('Macedonia'),
  166. 'ML' => $t('Mali'),
  167. 'MM' => $t('Myanmar'),
  168. 'MN' => $t('Mongolia'),
  169. 'MO' => $t('Macao S.A.R., China'),
  170. 'MP' => $t('Northern Mariana Islands'),
  171. 'MQ' => $t('Martinique'),
  172. 'MR' => $t('Mauritania'),
  173. 'MS' => $t('Montserrat'),
  174. 'MT' => $t('Malta'),
  175. 'MU' => $t('Mauritius'),
  176. 'MV' => $t('Maldives'),
  177. 'MW' => $t('Malawi'),
  178. 'MX' => $t('Mexico'),
  179. 'MY' => $t('Malaysia'),
  180. 'MZ' => $t('Mozambique'),
  181. 'NA' => $t('Namibia'),
  182. 'NC' => $t('New Caledonia'),
  183. 'NE' => $t('Niger'),
  184. 'NF' => $t('Norfolk Island'),
  185. 'NG' => $t('Nigeria'),
  186. 'NI' => $t('Nicaragua'),
  187. 'NL' => $t('Netherlands'),
  188. 'NO' => $t('Norway'),
  189. 'NP' => $t('Nepal'),
  190. 'NR' => $t('Nauru'),
  191. 'NU' => $t('Niue'),
  192. 'NZ' => $t('New Zealand'),
  193. 'OM' => $t('Oman'),
  194. 'PA' => $t('Panama'),
  195. 'PE' => $t('Peru'),
  196. 'PF' => $t('French Polynesia'),
  197. 'PG' => $t('Papua New Guinea'),
  198. 'PH' => $t('Philippines'),
  199. 'PK' => $t('Pakistan'),
  200. 'PL' => $t('Poland'),
  201. 'PM' => $t('Saint Pierre and Miquelon'),
  202. 'PN' => $t('Pitcairn'),
  203. 'PR' => $t('Puerto Rico'),
  204. 'PS' => $t('Palestinian Territory'),
  205. 'PT' => $t('Portugal'),
  206. 'PW' => $t('Palau'),
  207. 'PY' => $t('Paraguay'),
  208. 'QA' => $t('Qatar'),
  209. 'RE' => $t('Reunion'),
  210. 'RO' => $t('Romania'),
  211. 'RS' => $t('Serbia'),
  212. 'RU' => $t('Russia'),
  213. 'RW' => $t('Rwanda'),
  214. 'SA' => $t('Saudi Arabia'),
  215. 'SB' => $t('Solomon Islands'),
  216. 'SC' => $t('Seychelles'),
  217. 'SD' => $t('Sudan'),
  218. 'SE' => $t('Sweden'),
  219. 'SG' => $t('Singapore'),
  220. 'SH' => $t('Saint Helena'),
  221. 'SI' => $t('Slovenia'),
  222. 'SJ' => $t('Svalbard and Jan Mayen'),
  223. 'SK' => $t('Slovakia'),
  224. 'SL' => $t('Sierra Leone'),
  225. 'SM' => $t('San Marino'),
  226. 'SN' => $t('Senegal'),
  227. 'SO' => $t('Somalia'),
  228. 'SR' => $t('Suriname'),
  229. 'ST' => $t('Sao Tome and Principe'),
  230. 'SV' => $t('El Salvador'),
  231. 'SY' => $t('Syria'),
  232. 'SZ' => $t('Swaziland'),
  233. 'TC' => $t('Turks and Caicos Islands'),
  234. 'TD' => $t('Chad'),
  235. 'TF' => $t('French Southern Territories'),
  236. 'TG' => $t('Togo'),
  237. 'TH' => $t('Thailand'),
  238. 'TJ' => $t('Tajikistan'),
  239. 'TK' => $t('Tokelau'),
  240. 'TL' => $t('Timor-Leste'),
  241. 'TM' => $t('Turkmenistan'),
  242. 'TN' => $t('Tunisia'),
  243. 'TO' => $t('Tonga'),
  244. 'TR' => $t('Turkey'),
  245. 'TT' => $t('Trinidad and Tobago'),
  246. 'TV' => $t('Tuvalu'),
  247. 'TW' => $t('Taiwan'),
  248. 'TZ' => $t('Tanzania'),
  249. 'UA' => $t('Ukraine'),
  250. 'UG' => $t('Uganda'),
  251. 'UM' => $t('United States Minor Outlying Islands'),
  252. 'US' => $t('United States'),
  253. 'UY' => $t('Uruguay'),
  254. 'UZ' => $t('Uzbekistan'),
  255. 'VA' => $t('Vatican'),
  256. 'VC' => $t('Saint Vincent and the Grenadines'),
  257. 'VE' => $t('Venezuela'),
  258. 'VG' => $t('British Virgin Islands'),
  259. 'VI' => $t('U.S. Virgin Islands'),
  260. 'VN' => $t('Vietnam'),
  261. 'VU' => $t('Vanuatu'),
  262. 'WF' => $t('Wallis and Futuna'),
  263. 'WS' => $t('Samoa'),
  264. 'YE' => $t('Yemen'),
  265. 'YT' => $t('Mayotte'),
  266. 'ZA' => $t('South Africa'),
  267. 'ZM' => $t('Zambia'),
  268. 'ZW' => $t('Zimbabwe'),
  269. );
  270. // Sort the list.
  271. natcasesort($countries);
  272. return $countries;
  273. }
  274. /**
  275. * @ingroup locale-api-predefined List of predefined languages
  276. * @{
  277. */
  278. /**
  279. * Some of the common languages with their English and native names
  280. *
  281. * Based on ISO 639 and http://people.w3.org/rishida/names/languages.html
  282. */
  283. function _locale_get_predefined_list() {
  284. return array(
  285. 'aa' => array('Afar'),
  286. 'ab' => array('Abkhazian', 'аҧсуа бызшәа'),
  287. 'ae' => array('Avestan'),
  288. 'af' => array('Afrikaans'),
  289. 'ak' => array('Akan'),
  290. 'am' => array('Amharic', 'አማርኛ'),
  291. 'ar' => array('Arabic', /* Left-to-right marker "‭" */ 'العربية', LANGUAGE_RTL),
  292. 'as' => array('Assamese'),
  293. 'ast' => array('Asturian'),
  294. 'av' => array('Avar'),
  295. 'ay' => array('Aymara'),
  296. 'az' => array('Azerbaijani', 'azərbaycan'),
  297. 'ba' => array('Bashkir'),
  298. 'be' => array('Belarusian', 'Беларуская'),
  299. 'bg' => array('Bulgarian', 'Български'),
  300. 'bh' => array('Bihari'),
  301. 'bi' => array('Bislama'),
  302. 'bm' => array('Bambara', 'Bamanankan'),
  303. 'bn' => array('Bengali'),
  304. 'bo' => array('Tibetan'),
  305. 'br' => array('Breton'),
  306. 'bs' => array('Bosnian', 'Bosanski'),
  307. 'ca' => array('Catalan', 'Català'),
  308. 'ce' => array('Chechen'),
  309. 'ch' => array('Chamorro'),
  310. 'co' => array('Corsican'),
  311. 'cr' => array('Cree'),
  312. 'cs' => array('Czech', 'Čeština'),
  313. 'cu' => array('Old Slavonic'),
  314. 'cv' => array('Chuvash'),
  315. 'cy' => array('Welsh', 'Cymraeg'),
  316. 'da' => array('Danish', 'Dansk'),
  317. 'de' => array('German', 'Deutsch'),
  318. 'dv' => array('Maldivian'),
  319. 'dz' => array('Bhutani'),
  320. 'ee' => array('Ewe', 'Ɛʋɛ'),
  321. 'el' => array('Greek', 'Ελληνικά'),
  322. 'en' => array('English'),
  323. 'en-gb' => array('English, British'),
  324. 'eo' => array('Esperanto'),
  325. 'es' => array('Spanish', 'Español'),
  326. 'et' => array('Estonian', 'Eesti'),
  327. 'eu' => array('Basque', 'Euskera'),
  328. 'fa' => array('Persian', /* Left-to-right marker "‭" */ 'فارسی', LANGUAGE_RTL),
  329. 'ff' => array('Fulah', 'Fulfulde'),
  330. 'fi' => array('Finnish', 'Suomi'),
  331. 'fil' => array('Filipino'),
  332. 'fj' => array('Fiji'),
  333. 'fo' => array('Faeroese'),
  334. 'fr' => array('French', 'Français'),
  335. 'fy' => array('Frisian', 'Frysk'),
  336. 'ga' => array('Irish', 'Gaeilge'),
  337. 'gd' => array('Scots Gaelic'),
  338. 'gl' => array('Galician', 'Galego'),
  339. 'gn' => array('Guarani'),
  340. 'gsw-berne' => array('Swiss German'),
  341. 'gu' => array('Gujarati'),
  342. 'gv' => array('Manx'),
  343. 'ha' => array('Hausa'),
  344. 'he' => array('Hebrew', /* Left-to-right marker "‭" */ 'עברית', LANGUAGE_RTL),
  345. 'hi' => array('Hindi', 'हिन्दी'),
  346. 'ho' => array('Hiri Motu'),
  347. 'hr' => array('Croatian', 'Hrvatski'),
  348. 'ht' => array('Haitian Creole'),
  349. 'hu' => array('Hungarian', 'Magyar'),
  350. 'hy' => array('Armenian', 'Հայերեն'),
  351. 'hz' => array('Herero'),
  352. 'ia' => array('Interlingua'),
  353. 'id' => array('Indonesian', 'Bahasa Indonesia'),
  354. 'ie' => array('Interlingue'),
  355. 'ig' => array('Igbo'),
  356. 'ik' => array('Inupiak'),
  357. 'is' => array('Icelandic', 'Íslenska'),
  358. 'it' => array('Italian', 'Italiano'),
  359. 'iu' => array('Inuktitut'),
  360. 'ja' => array('Japanese', '日本語'),
  361. 'jv' => array('Javanese'),
  362. 'ka' => array('Georgian'),
  363. 'kg' => array('Kongo'),
  364. 'ki' => array('Kikuyu'),
  365. 'kj' => array('Kwanyama'),
  366. 'kk' => array('Kazakh', 'Қазақ'),
  367. 'kl' => array('Greenlandic'),
  368. 'km' => array('Cambodian'),
  369. 'kn' => array('Kannada', 'ಕನ್ನಡ'),
  370. 'ko' => array('Korean', '한국어'),
  371. 'kr' => array('Kanuri'),
  372. 'ks' => array('Kashmiri'),
  373. 'ku' => array('Kurdish', 'Kurdî'),
  374. 'kv' => array('Komi'),
  375. 'kw' => array('Cornish'),
  376. 'ky' => array('Kyrgyz', 'Кыргызча'),
  377. 'la' => array('Latin', 'Latina'),
  378. 'lb' => array('Luxembourgish'),
  379. 'lg' => array('Luganda'),
  380. 'ln' => array('Lingala'),
  381. 'lo' => array('Laothian'),
  382. 'lt' => array('Lithuanian', 'Lietuvių'),
  383. 'lv' => array('Latvian', 'Latviešu'),
  384. 'mg' => array('Malagasy'),
  385. 'mh' => array('Marshallese'),
  386. 'mi' => array('Māori'),
  387. 'mk' => array('Macedonian', 'Македонски'),
  388. 'ml' => array('Malayalam', 'മലയാളം'),
  389. 'mn' => array('Mongolian'),
  390. 'mo' => array('Moldavian'),
  391. 'mr' => array('Marathi'),
  392. 'ms' => array('Malay', 'Bahasa Melayu'),
  393. 'mt' => array('Maltese', 'Malti'),
  394. 'my' => array('Burmese'),
  395. 'na' => array('Nauru'),
  396. 'nd' => array('North Ndebele'),
  397. 'ne' => array('Nepali'),
  398. 'ng' => array('Ndonga'),
  399. 'nl' => array('Dutch', 'Nederlands'),
  400. 'nb' => array('Norwegian Bokmål', 'Bokmål'),
  401. 'nn' => array('Norwegian Nynorsk', 'Nynorsk'),
  402. 'nr' => array('South Ndebele'),
  403. 'nv' => array('Navajo'),
  404. 'ny' => array('Chichewa'),
  405. 'oc' => array('Occitan'),
  406. 'om' => array('Oromo'),
  407. 'or' => array('Oriya'),
  408. 'os' => array('Ossetian'),
  409. 'pa' => array('Punjabi'),
  410. 'pi' => array('Pali'),
  411. 'pl' => array('Polish', 'Polski'),
  412. 'ps' => array('Pashto', /* Left-to-right marker "‭" */ 'پښتو', LANGUAGE_RTL),
  413. 'pt' => array('Portuguese, International'),
  414. 'pt-pt' => array('Portuguese, Portugal', 'Português'),
  415. 'pt-br' => array('Portuguese, Brazil', 'Português'),
  416. 'qu' => array('Quechua'),
  417. 'rm' => array('Rhaeto-Romance'),
  418. 'rn' => array('Kirundi'),
  419. 'ro' => array('Romanian', 'Română'),
  420. 'ru' => array('Russian', 'Русский'),
  421. 'rw' => array('Kinyarwanda'),
  422. 'sa' => array('Sanskrit'),
  423. 'sc' => array('Sardinian'),
  424. 'sco' => array('Scots'),
  425. 'sd' => array('Sindhi'),
  426. 'se' => array('Northern Sami'),
  427. 'sg' => array('Sango'),
  428. 'sh' => array('Serbo-Croatian'),
  429. 'si' => array('Sinhala', 'සිංහල'),
  430. 'sk' => array('Slovak', 'Slovenčina'),
  431. 'sl' => array('Slovenian', 'Slovenščina'),
  432. 'sm' => array('Samoan'),
  433. 'sn' => array('Shona'),
  434. 'so' => array('Somali'),
  435. 'sq' => array('Albanian', 'Shqip'),
  436. 'sr' => array('Serbian', 'Српски'),
  437. 'ss' => array('Siswati'),
  438. 'st' => array('Sesotho'),
  439. 'su' => array('Sudanese'),
  440. 'sv' => array('Swedish', 'Svenska'),
  441. 'sw' => array('Swahili', 'Kiswahili'),
  442. 'ta' => array('Tamil', 'தமிழ்'),
  443. 'te' => array('Telugu', 'తెలుగు'),
  444. 'tg' => array('Tajik'),
  445. 'th' => array('Thai', 'ภาษาไทย'),
  446. 'ti' => array('Tigrinya'),
  447. 'tk' => array('Turkmen'),
  448. 'tl' => array('Tagalog'),
  449. 'tn' => array('Setswana'),
  450. 'to' => array('Tonga'),
  451. 'tr' => array('Turkish', 'Türkçe'),
  452. 'ts' => array('Tsonga'),
  453. 'tt' => array('Tatar', 'Tatarça'),
  454. 'tw' => array('Twi'),
  455. 'ty' => array('Tahitian'),
  456. 'ug' => array('Uyghur'),
  457. 'uk' => array('Ukrainian', 'Українська'),
  458. 'ur' => array('Urdu', /* Left-to-right marker "‭" */ 'اردو', LANGUAGE_RTL),
  459. 'uz' => array('Uzbek', "o'zbek"),
  460. 've' => array('Venda'),
  461. 'vi' => array('Vietnamese', 'Tiếng Việt'),
  462. 'wo' => array('Wolof'),
  463. 'xh' => array('Xhosa', 'isiXhosa'),
  464. 'xx-lolspeak' => array('Lolspeak'),
  465. 'yi' => array('Yiddish'),
  466. 'yo' => array('Yoruba', 'Yorùbá'),
  467. 'za' => array('Zhuang'),
  468. 'zh-hans' => array('Chinese, Simplified', '简体中文'),
  469. 'zh-hant' => array('Chinese, Traditional', '繁體中文'),
  470. 'zu' => array('Zulu', 'isiZulu'),
  471. );
  472. }
  473. /**
  474. * @} End of "locale-api-languages-predefined"
  475. */