Project

General

Profile

Paste
Download (15.2 KB) Statistics
| Branch: | Revision:

root / drupal7 / includes / iso.inc @ 620f9137

1
<?php
2

    
3
/**
4
 * @file
5
 * Provides a list of countries and languages based on ISO standards.
6
 */
7

    
8
/**
9
 * Get an array of all country code => country name pairs.
10
 *
11
 * Get an array of all country code => country name pairs as laid out
12
 * in ISO 3166-1 alpha-2.
13
 * Grabbed from location project (http://drupal.org/project/location).
14
 * @return
15
 *   An array of all country code => country name pairs.
16
 */
17
function _country_get_predefined_list() {
18
  static $countries;
19

    
20
  if (isset($countries)) {
21
    return $countries;
22
  }
23
  $t = get_t();
24

    
25
  $countries = array(
26
    'AD' => $t('Andorra'),
27
    'AE' => $t('United Arab Emirates'),
28
    'AF' => $t('Afghanistan'),
29
    'AG' => $t('Antigua and Barbuda'),
30
    'AI' => $t('Anguilla'),
31
    'AL' => $t('Albania'),
32
    'AM' => $t('Armenia'),
33
    'AN' => $t('Netherlands Antilles'),
34
    'AO' => $t('Angola'),
35
    'AQ' => $t('Antarctica'),
36
    'AR' => $t('Argentina'),
37
    'AS' => $t('American Samoa'),
38
    'AT' => $t('Austria'),
39
    'AU' => $t('Australia'),
40
    'AW' => $t('Aruba'),
41
    'AX' => $t('Aland Islands'),
42
    'AZ' => $t('Azerbaijan'),
43
    'BA' => $t('Bosnia and Herzegovina'),
44
    'BB' => $t('Barbados'),
45
    'BD' => $t('Bangladesh'),
46
    'BE' => $t('Belgium'),
47
    'BF' => $t('Burkina Faso'),
48
    'BG' => $t('Bulgaria'),
49
    'BH' => $t('Bahrain'),
50
    'BI' => $t('Burundi'),
51
    'BJ' => $t('Benin'),
52
    'BL' => $t('Saint Barthélemy'),
53
    'BM' => $t('Bermuda'),
54
    'BN' => $t('Brunei'),
55
    'BO' => $t('Bolivia'),
56
    'BQ' => $t('Caribbean Netherlands'),
57
    'BR' => $t('Brazil'),
58
    'BS' => $t('Bahamas'),
59
    'BT' => $t('Bhutan'),
60
    'BV' => $t('Bouvet Island'),
61
    'BW' => $t('Botswana'),
62
    'BY' => $t('Belarus'),
63
    'BZ' => $t('Belize'),
64
    'CA' => $t('Canada'),
65
    'CC' => $t('Cocos (Keeling) Islands'),
66
    'CD' => $t('Congo (Kinshasa)'),
67
    'CF' => $t('Central African Republic'),
68
    'CG' => $t('Congo (Brazzaville)'),
69
    'CH' => $t('Switzerland'),
70
    'CI' => $t('Ivory Coast'),
71
    'CK' => $t('Cook Islands'),
72
    'CL' => $t('Chile'),
73
    'CM' => $t('Cameroon'),
74
    'CN' => $t('China'),
75
    'CO' => $t('Colombia'),
76
    'CR' => $t('Costa Rica'),
77
    'CU' => $t('Cuba'),
78
    'CV' => $t('Cape Verde'),
79
    'CW' => $t('Curaçao'),
80
    'CX' => $t('Christmas Island'),
81
    'CY' => $t('Cyprus'),
82
    'CZ' => $t('Czech Republic'),
83
    'DE' => $t('Germany'),
84
    'DJ' => $t('Djibouti'),
85
    'DK' => $t('Denmark'),
86
    'DM' => $t('Dominica'),
87
    'DO' => $t('Dominican Republic'),
88
    'DZ' => $t('Algeria'),
89
    'EC' => $t('Ecuador'),
90
    'EE' => $t('Estonia'),
91
    'EG' => $t('Egypt'),
92
    'EH' => $t('Western Sahara'),
93
    'ER' => $t('Eritrea'),
94
    'ES' => $t('Spain'),
95
    'ET' => $t('Ethiopia'),
96
    'FI' => $t('Finland'),
97
    'FJ' => $t('Fiji'),
98
    'FK' => $t('Falkland Islands'),
99
    'FM' => $t('Micronesia'),
100
    'FO' => $t('Faroe Islands'),
101
    'FR' => $t('France'),
102
    'GA' => $t('Gabon'),
103
    'GB' => $t('United Kingdom'),
104
    'GD' => $t('Grenada'),
105
    'GE' => $t('Georgia'),
106
    'GF' => $t('French Guiana'),
107
    'GG' => $t('Guernsey'),
108
    'GH' => $t('Ghana'),
109
    'GI' => $t('Gibraltar'),
110
    'GL' => $t('Greenland'),
111
    'GM' => $t('Gambia'),
112
    'GN' => $t('Guinea'),
113
    'GP' => $t('Guadeloupe'),
114
    'GQ' => $t('Equatorial Guinea'),
115
    'GR' => $t('Greece'),
116
    'GS' => $t('South Georgia and the South Sandwich Islands'),
117
    'GT' => $t('Guatemala'),
118
    'GU' => $t('Guam'),
119
    'GW' => $t('Guinea-Bissau'),
120
    'GY' => $t('Guyana'),
121
    'HK' => $t('Hong Kong S.A.R., China'),
122
    'HM' => $t('Heard Island and McDonald Islands'),
123
    'HN' => $t('Honduras'),
124
    'HR' => $t('Croatia'),
125
    'HT' => $t('Haiti'),
126
    'HU' => $t('Hungary'),
127
    'ID' => $t('Indonesia'),
128
    'IE' => $t('Ireland'),
129
    'IL' => $t('Israel'),
130
    'IM' => $t('Isle of Man'),
131
    'IN' => $t('India'),
132
    'IO' => $t('British Indian Ocean Territory'),
133
    'IQ' => $t('Iraq'),
134
    'IR' => $t('Iran'),
135
    'IS' => $t('Iceland'),
136
    'IT' => $t('Italy'),
137
    'JE' => $t('Jersey'),
138
    'JM' => $t('Jamaica'),
139
    'JO' => $t('Jordan'),
140
    'JP' => $t('Japan'),
141
    'KE' => $t('Kenya'),
142
    'KG' => $t('Kyrgyzstan'),
143
    'KH' => $t('Cambodia'),
144
    'KI' => $t('Kiribati'),
145
    'KM' => $t('Comoros'),
146
    'KN' => $t('Saint Kitts and Nevis'),
147
    'KP' => $t('North Korea'),
148
    'KR' => $t('South Korea'),
149
    'KW' => $t('Kuwait'),
150
    'KY' => $t('Cayman Islands'),
151
    'KZ' => $t('Kazakhstan'),
152
    'LA' => $t('Laos'),
153
    'LB' => $t('Lebanon'),
154
    'LC' => $t('Saint Lucia'),
155
    'LI' => $t('Liechtenstein'),
156
    'LK' => $t('Sri Lanka'),
157
    'LR' => $t('Liberia'),
158
    'LS' => $t('Lesotho'),
159
    'LT' => $t('Lithuania'),
160
    'LU' => $t('Luxembourg'),
161
    'LV' => $t('Latvia'),
162
    'LY' => $t('Libya'),
163
    'MA' => $t('Morocco'),
164
    'MC' => $t('Monaco'),
165
    'MD' => $t('Moldova'),
166
    'ME' => $t('Montenegro'),
167
    'MF' => $t('Saint Martin (French part)'),
168
    'MG' => $t('Madagascar'),
169
    'MH' => $t('Marshall Islands'),
170
    'MK' => $t('Macedonia'),
171
    'ML' => $t('Mali'),
172
    'MM' => $t('Myanmar'),
173
    'MN' => $t('Mongolia'),
174
    'MO' => $t('Macao S.A.R., China'),
175
    'MP' => $t('Northern Mariana Islands'),
176
    'MQ' => $t('Martinique'),
177
    'MR' => $t('Mauritania'),
178
    'MS' => $t('Montserrat'),
179
    'MT' => $t('Malta'),
180
    'MU' => $t('Mauritius'),
181
    'MV' => $t('Maldives'),
182
    'MW' => $t('Malawi'),
183
    'MX' => $t('Mexico'),
184
    'MY' => $t('Malaysia'),
185
    'MZ' => $t('Mozambique'),
186
    'NA' => $t('Namibia'),
187
    'NC' => $t('New Caledonia'),
188
    'NE' => $t('Niger'),
189
    'NF' => $t('Norfolk Island'),
190
    'NG' => $t('Nigeria'),
191
    'NI' => $t('Nicaragua'),
192
    'NL' => $t('Netherlands'),
193
    'NO' => $t('Norway'),
194
    'NP' => $t('Nepal'),
195
    'NR' => $t('Nauru'),
196
    'NU' => $t('Niue'),
197
    'NZ' => $t('New Zealand'),
198
    'OM' => $t('Oman'),
199
    'PA' => $t('Panama'),
200
    'PE' => $t('Peru'),
201
    'PF' => $t('French Polynesia'),
202
    'PG' => $t('Papua New Guinea'),
203
    'PH' => $t('Philippines'),
204
    'PK' => $t('Pakistan'),
205
    'PL' => $t('Poland'),
206
    'PM' => $t('Saint Pierre and Miquelon'),
207
    'PN' => $t('Pitcairn'),
208
    'PR' => $t('Puerto Rico'),
209
    'PS' => $t('Palestinian Territory'),
210
    'PT' => $t('Portugal'),
211
    'PW' => $t('Palau'),
212
    'PY' => $t('Paraguay'),
213
    'QA' => $t('Qatar'),
214
    'RE' => $t('Reunion'),
215
    'RO' => $t('Romania'),
216
    'RS' => $t('Serbia'),
217
    'RU' => $t('Russia'),
218
    'RW' => $t('Rwanda'),
219
    'SA' => $t('Saudi Arabia'),
220
    'SB' => $t('Solomon Islands'),
221
    'SC' => $t('Seychelles'),
222
    'SD' => $t('Sudan'),
223
    'SE' => $t('Sweden'),
224
    'SG' => $t('Singapore'),
225
    'SH' => $t('Saint Helena'),
226
    'SI' => $t('Slovenia'),
227
    'SJ' => $t('Svalbard and Jan Mayen'),
228
    'SK' => $t('Slovakia'),
229
    'SL' => $t('Sierra Leone'),
230
    'SM' => $t('San Marino'),
231
    'SN' => $t('Senegal'),
232
    'SO' => $t('Somalia'),
233
    'SR' => $t('Suriname'),
234
    'SS' => $t('South Sudan'),
235
    'ST' => $t('Sao Tome and Principe'),
236
    'SV' => $t('El Salvador'),
237
    'SX' => $t('Sint Maarten'),
238
    'SY' => $t('Syria'),
239
    'SZ' => $t('Swaziland'),
240
    'TC' => $t('Turks and Caicos Islands'),
241
    'TD' => $t('Chad'),
242
    'TF' => $t('French Southern Territories'),
243
    'TG' => $t('Togo'),
244
    'TH' => $t('Thailand'),
245
    'TJ' => $t('Tajikistan'),
246
    'TK' => $t('Tokelau'),
247
    'TL' => $t('Timor-Leste'),
248
    'TM' => $t('Turkmenistan'),
249
    'TN' => $t('Tunisia'),
250
    'TO' => $t('Tonga'),
251
    'TR' => $t('Turkey'),
252
    'TT' => $t('Trinidad and Tobago'),
253
    'TV' => $t('Tuvalu'),
254
    'TW' => $t('Taiwan'),
255
    'TZ' => $t('Tanzania'),
256
    'UA' => $t('Ukraine'),
257
    'UG' => $t('Uganda'),
258
    'UM' => $t('United States Minor Outlying Islands'),
259
    'US' => $t('United States'),
260
    'UY' => $t('Uruguay'),
261
    'UZ' => $t('Uzbekistan'),
262
    'VA' => $t('Vatican'),
263
    'VC' => $t('Saint Vincent and the Grenadines'),
264
    'VE' => $t('Venezuela'),
265
    'VG' => $t('British Virgin Islands'),
266
    'VI' => $t('U.S. Virgin Islands'),
267
    'VN' => $t('Vietnam'),
268
    'VU' => $t('Vanuatu'),
269
    'WF' => $t('Wallis and Futuna'),
270
    'WS' => $t('Samoa'),
271
    'YE' => $t('Yemen'),
272
    'YT' => $t('Mayotte'),
273
    'ZA' => $t('South Africa'),
274
    'ZM' => $t('Zambia'),
275
    'ZW' => $t('Zimbabwe'),
276
  );
277

    
278
  // Sort the list.
279
  natcasesort($countries);
280

    
281
  return $countries;
282
}
283

    
284
/**
285
 * @ingroup locale-api-predefined List of predefined languages
286
 * @{
287
 */
288

    
289
/**
290
 * Some of the common languages with their English and native names
291
 *
292
 * Based on ISO 639 and http://people.w3.org/rishida/names/languages.html
293
 */
294
function _locale_get_predefined_list() {
295
  return array(
296
    'aa' => array('Afar'),
297
    'ab' => array('Abkhazian', 'аҧсуа бызшәа'),
298
    'ae' => array('Avestan'),
299
    'af' => array('Afrikaans'),
300
    'ak' => array('Akan'),
301
    'am' => array('Amharic', 'አማርኛ'),
302
    'ar' => array('Arabic', /* Left-to-right marker "‭" */ 'العربية', LANGUAGE_RTL),
303
    'as' => array('Assamese'),
304
    'ast' => array('Asturian'),
305
    'av' => array('Avar'),
306
    'ay' => array('Aymara'),
307
    'az' => array('Azerbaijani', 'azərbaycan'),
308
    'ba' => array('Bashkir'),
309
    'be' => array('Belarusian', 'Беларуская'),
310
    'bg' => array('Bulgarian', 'Български'),
311
    'bh' => array('Bihari'),
312
    'bi' => array('Bislama'),
313
    'bm' => array('Bambara', 'Bamanankan'),
314
    'bn' => array('Bengali'),
315
    'bo' => array('Tibetan'),
316
    'br' => array('Breton'),
317
    'bs' => array('Bosnian', 'Bosanski'),
318
    'ca' => array('Catalan', 'Català'),
319
    'ce' => array('Chechen'),
320
    'ch' => array('Chamorro'),
321
    'co' => array('Corsican'),
322
    'cr' => array('Cree'),
323
    'cs' => array('Czech', 'Čeština'),
324
    'cu' => array('Old Slavonic'),
325
    'cv' => array('Chuvash'),
326
    'cy' => array('Welsh', 'Cymraeg'),
327
    'da' => array('Danish', 'Dansk'),
328
    'de' => array('German', 'Deutsch'),
329
    'dv' => array('Maldivian'),
330
    'dz' => array('Bhutani'),
331
    'ee' => array('Ewe', 'Ɛʋɛ'),
332
    'el' => array('Greek', 'Ελληνικά'),
333
    'en' => array('English'),
334
    'en-gb' => array('English, British'),
335
    'eo' => array('Esperanto'),
336
    'es' => array('Spanish', 'Español'),
337
    'et' => array('Estonian', 'Eesti'),
338
    'eu' => array('Basque', 'Euskera'),
339
    'fa' => array('Persian', /* Left-to-right marker "‭" */ 'فارسی', LANGUAGE_RTL),
340
    'ff' => array('Fulah', 'Fulfulde'),
341
    'fi' => array('Finnish', 'Suomi'),
342
    'fil' => array('Filipino'),
343
    'fj' => array('Fiji'),
344
    'fo' => array('Faeroese'),
345
    'fr' => array('French', 'Français'),
346
    'fy' => array('Frisian', 'Frysk'),
347
    'ga' => array('Irish', 'Gaeilge'),
348
    'gd' => array('Scots Gaelic'),
349
    'gl' => array('Galician', 'Galego'),
350
    'gn' => array('Guarani'),
351
    'gsw-berne' => array('Swiss German'),
352
    'gu' => array('Gujarati'),
353
    'gv' => array('Manx'),
354
    'ha' => array('Hausa'),
355
    'he' => array('Hebrew', /* Left-to-right marker "‭" */ 'עברית', LANGUAGE_RTL),
356
    'hi' => array('Hindi', 'हिन्दी'),
357
    'ho' => array('Hiri Motu'),
358
    'hr' => array('Croatian', 'Hrvatski'),
359
    'ht' => array('Haitian Creole'),
360
    'hu' => array('Hungarian', 'Magyar'),
361
    'hy' => array('Armenian', 'Հայերեն'),
362
    'hz' => array('Herero'),
363
    'ia' => array('Interlingua'),
364
    'id' => array('Indonesian', 'Bahasa Indonesia'),
365
    'ie' => array('Interlingue'),
366
    'ig' => array('Igbo'),
367
    'ik' => array('Inupiak'),
368
    'is' => array('Icelandic', 'Íslenska'),
369
    'it' => array('Italian', 'Italiano'),
370
    'iu' => array('Inuktitut'),
371
    'ja' => array('Japanese', '日本語'),
372
    'jv' => array('Javanese'),
373
    'ka' => array('Georgian'),
374
    'kg' => array('Kongo'),
375
    'ki' => array('Kikuyu'),
376
    'kj' => array('Kwanyama'),
377
    'kk' => array('Kazakh', 'Қазақ'),
378
    'kl' => array('Greenlandic'),
379
    'km' => array('Cambodian'),
380
    'kn' => array('Kannada', 'ಕನ್ನಡ'),
381
    'ko' => array('Korean', '한국어'),
382
    'kr' => array('Kanuri'),
383
    'ks' => array('Kashmiri'),
384
    'ku' => array('Kurdish', 'Kurdî'),
385
    'kv' => array('Komi'),
386
    'kw' => array('Cornish'),
387
    'ky' => array('Kyrgyz', 'Кыргызча'),
388
    'la' => array('Latin', 'Latina'),
389
    'lb' => array('Luxembourgish'),
390
    'lg' => array('Luganda'),
391
    'ln' => array('Lingala'),
392
    'lo' => array('Laothian'),
393
    'lt' => array('Lithuanian', 'Lietuvių'),
394
    'lv' => array('Latvian', 'Latviešu'),
395
    'mg' => array('Malagasy'),
396
    'mh' => array('Marshallese'),
397
    'mi' => array('Māori'),
398
    'mk' => array('Macedonian', 'Македонски'),
399
    'ml' => array('Malayalam', 'മലയാളം'),
400
    'mn' => array('Mongolian'),
401
    'mo' => array('Moldavian'),
402
    'mr' => array('Marathi'),
403
    'ms' => array('Malay', 'Bahasa Melayu'),
404
    'mt' => array('Maltese', 'Malti'),
405
    'my' => array('Burmese'),
406
    'na' => array('Nauru'),
407
    'nd' => array('North Ndebele'),
408
    'ne' => array('Nepali'),
409
    'ng' => array('Ndonga'),
410
    'nl' => array('Dutch', 'Nederlands'),
411
    'nb' => array('Norwegian Bokmål', 'Bokmål'),
412
    'nn' => array('Norwegian Nynorsk', 'Nynorsk'),
413
    'nr' => array('South Ndebele'),
414
    'nv' => array('Navajo'),
415
    'ny' => array('Chichewa'),
416
    'oc' => array('Occitan'),
417
    'om' => array('Oromo'),
418
    'or' => array('Oriya'),
419
    'os' => array('Ossetian'),
420
    'pa' => array('Punjabi'),
421
    'pi' => array('Pali'),
422
    'pl' => array('Polish', 'Polski'),
423
    'ps' => array('Pashto', /* Left-to-right marker "‭" */ 'پښتو', LANGUAGE_RTL),
424
    'pt' => array('Portuguese, International'),
425
    'pt-pt' => array('Portuguese, Portugal', 'Português'),
426
    'pt-br' => array('Portuguese, Brazil', 'Português'),
427
    'qu' => array('Quechua'),
428
    'rm' => array('Rhaeto-Romance'),
429
    'rn' => array('Kirundi'),
430
    'ro' => array('Romanian', 'Română'),
431
    'ru' => array('Russian', 'Русский'),
432
    'rw' => array('Kinyarwanda'),
433
    'sa' => array('Sanskrit'),
434
    'sc' => array('Sardinian'),
435
    'sco' => array('Scots'),
436
    'sd' => array('Sindhi'),
437
    'se' => array('Northern Sami'),
438
    'sg' => array('Sango'),
439
    'sh' => array('Serbo-Croatian'),
440
    'si' => array('Sinhala', 'සිංහල'),
441
    'sk' => array('Slovak', 'Slovenčina'),
442
    'sl' => array('Slovenian', 'Slovenščina'),
443
    'sm' => array('Samoan'),
444
    'sn' => array('Shona'),
445
    'so' => array('Somali'),
446
    'sq' => array('Albanian', 'Shqip'),
447
    'sr' => array('Serbian', 'Српски'),
448
    'ss' => array('Siswati'),
449
    'st' => array('Sesotho'),
450
    'su' => array('Sudanese'),
451
    'sv' => array('Swedish', 'Svenska'),
452
    'sw' => array('Swahili', 'Kiswahili'),
453
    'ta' => array('Tamil', 'தமிழ்'),
454
    'te' => array('Telugu', 'తెలుగు'),
455
    'tg' => array('Tajik'),
456
    'th' => array('Thai', 'ภาษาไทย'),
457
    'ti' => array('Tigrinya'),
458
    'tk' => array('Turkmen'),
459
    'tl' => array('Tagalog'),
460
    'tn' => array('Setswana'),
461
    'to' => array('Tonga'),
462
    'tr' => array('Turkish', 'Türkçe'),
463
    'ts' => array('Tsonga'),
464
    'tt' => array('Tatar', 'Tatarça'),
465
    'tw' => array('Twi'),
466
    'ty' => array('Tahitian'),
467
    'ug' => array('Uyghur'),
468
    'uk' => array('Ukrainian', 'Українська'),
469
    'ur' => array('Urdu', /* Left-to-right marker "‭" */ 'اردو', LANGUAGE_RTL),
470
    'uz' => array('Uzbek', "o'zbek"),
471
    've' => array('Venda'),
472
    'vi' => array('Vietnamese', 'Tiếng Việt'),
473
    'wo' => array('Wolof'),
474
    'xh' => array('Xhosa', 'isiXhosa'),
475
    'xx-lolspeak' => array('Lolspeak'),
476
    'yi' => array('Yiddish'),
477
    'yo' => array('Yoruba', 'Yorùbá'),
478
    'za' => array('Zhuang'),
479
    'zh-hans' => array('Chinese, Simplified', '简体中文'),
480
    'zh-hant' => array('Chinese, Traditional', '繁體中文'),
481
    'zu' => array('Zulu', 'isiZulu'),
482
  );
483
}
484
/**
485
 * @} End of "locale-api-languages-predefined"
486
 */