1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Core
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26: class Mage_Core_Model_Locale_Config
27: {
28: /**
29: * List of allowed locales
30: *
31: * @var array
32: */
33: protected $_allowedLocales = array(
34: 'af_ZA' /*Afrikaans (South Africa)*/, 'ar_DZ' /*Arabic (Algeria)*/, 'ar_EG' /*Arabic (Egypt)*/,
35: 'ar_KW' /*Arabic (Kuwait)*/, 'ar_MA' /*Arabic (Morocco)*/, 'ar_SA' /*Arabic (Saudi Arabia)*/,
36: 'az_AZ' /*Azerbaijani (Azerbaijan)*/, 'be_BY' /*Belarusian (Belarus)*/, 'bg_BG' /*Bulgarian (Bulgaria)*/,
37: 'bn_BD' /*Bengali (Bangladesh)*/, 'bs_BA' /*Bosnian (Bosnia)*/, 'ca_ES' /*Catalan (Catalonia)*/,
38: 'cs_CZ' /*Czech (Czech Republic)*/, 'cy_GB' /*Welsh (United Kingdom)*/, 'da_DK' /*Danish (Denmark)*/,
39: 'de_AT' /*German (Austria)*/, 'de_CH' /*German (Switzerland)*/, 'de_DE' /*German (Germany)*/,
40: 'el_GR' /*Greek (Greece)*/, 'en_AU' /*English (Australian)*/, 'en_CA' /*English (Canadian)*/,
41: 'en_GB' /*English (United Kingdom)*/, 'en_NZ' /*English (New Zealand)*/, 'en_US' /*English (United States)*/,
42: 'es_AR' /*Spanish (Argentina)*/, 'es_CO' /*Spanish (Colombia)*/, 'es_PA' /*Spanish (Panama)*/,
43: 'gl_ES' /*Galician (Galician)*/, 'es_CR' /*Spanish (Costa Rica)*/, 'es_ES' /*Spanish (Spain)*/,
44: 'es_MX' /*Spanish (Mexico)*/, 'es_EU' /*Basque (Basque)*/, 'es_PE' /*Spanish (Peru)*/,
45: 'et_EE' /*Estonian (Estonia)*/, 'fa_IR' /*Persian (Iran)*/, 'fi_FI' /*Finnish (Finland)*/,
46: 'fil_PH' /*Filipino (Philippines)*/, 'fr_CA' /*French (Canada)*/, 'fr_FR' /*French (France)*/,
47: 'gu_IN' /*Gujarati (India)*/, 'he_IL' /*Hebrew (Israel)*/, 'hi_IN' /*Hindi (India)*/,
48: 'hr_HR' /*Croatian (Croatia)*/, 'hu_HU' /*Hungarian (Hungary)*/, 'id_ID' /*Indonesian (Indonesia)*/,
49: 'is_IS' /*Icelandic (Iceland)*/, 'it_CH' /*Italian (Switzerland)*/, 'it_IT' /*Italian (Italy)*/,
50: 'ja_JP' /*Japanese (Japan)*/, 'ka_GE' /*Georgian (Georgia)*/, 'km_KH' /*Khmer (Cambodia)*/,
51: 'ko_KR' /*Korean (South Korea)*/, 'lo_LA' /*Lao (Laos)*/, 'lt_LT' /*Lithuanian (Lithuania)*/,
52: 'lv_LV' /*Latvian (Latvia)*/, 'mk_MK' /*Macedonian (Macedonia)*/, 'mn_MN' /*Mongolian (Mongolia)*/,
53: 'ms_MY' /*Malaysian (Malaysia)*/, 'nl_NL' /*Dutch (Netherlands)*/, 'nb_NO' /*Norwegian BokmГ_l (Norway)*/,
54: 'nn_NO' /*Norwegian Nynorsk (Norway)*/, 'pl_PL' /*Polish (Poland)*/, 'pt_BR' /*Portuguese (Brazil)*/,
55: 'pt_PT' /*Portuguese (Portugal)*/, 'ro_RO' /*Romanian (Romania)*/, 'ru_RU' /*Russian (Russia)*/,
56: 'sk_SK' /*Slovak (Slovakia)*/, 'sl_SI' /*Slovenian (Slovenia)*/, 'sq_AL' /*Albanian (Albania)*/,
57: 'sr_RS' /*Serbian (Serbia)*/, 'sv_SE' /*Swedish (Sweden)*/, 'sw_KE' /*Swahili (Kenya)*/,
58: 'th_TH' /*Thai (Thailand)*/, 'tr_TR' /*Turkish (Turkey)*/, 'uk_UA' /*Ukrainian (Ukraine)*/,
59: 'vi_VN' /*Vietnamese (Vietnam)*/, 'zh_CN' /*Chinese (China)*/, 'zh_HK' /*Chinese (Hong Kong SAR)*/,
60: 'zh_TW' /*Chinese (Taiwan)*/, 'es_CL' /*Spanich (Chile)*/, 'lo_LA' /*Laotian*/,
61: 'es_VE' /*Spanish (Venezuela)*/, 'en_IE' /*English (Ireland)*/,
62: );
63:
64: /**
65: * List of allowed currencies
66: *
67: * @var array
68: */
69: protected $_allowedCurrencies = array(
70: 'AFN' /*Afghani*/, 'ALL' /*Albanian Lek*/, 'AZN' /*Azerbaijanian Manat*/, 'DZD' /*Algerian Dinar*/,
71: 'AOA' /*Angolan Kwanza*/, 'ARS' /*Argentine Peso*/, 'AMD' /*Armenian Dram*/, 'AWG' /*Aruban Florin*/,
72: 'AUD' /*Australian Dollar*/,'BSD' /*Bahamian Dollar*/, 'BHD' /*Bahraini Dinar*/, 'BDT' /*Bangladesh Taka*/,
73: 'BBD' /*Barbados Dollar*/, 'BYR' /*Belarussian Ruble*/,'BZD' /*Belize Dollar*/, 'BMD' /*Bermudan Dollar*/,
74: 'BTN' /*Bhutan Ngultrum*/, 'BOB' /*Boliviano*/, 'BAM' /*Bosnia-Herzegovina Convertible Mark*/,'BWP' /*Botswanan Pula*/,
75: 'BRL' /*Brazilian Real*/, 'GBP' /*British Pound Sterling*/,'BND' /*Brunei Dollar*/, 'BGN' /*Bulgarian New Lev*/,
76: 'BUK' /*Burmese Kyat*/, 'BIF' /*Burundi Franc*/, 'KHR' /*Cambodian Riel*/, 'CAD' /*Canadian Dollar*/,
77: 'CVE' /*Cape Verde Escudo*/,'CZK' /*Czech Republic Koruna*/,'KYD' /*Cayman Islands Dollar*/,'GQE' /*Central African CFA Franc*/,
78: 'CLP' /*Chilean Peso*/, 'CNY' /*Chinese Yuan Renminbi*/,'COP' /*Colombian Peso*/, 'KMF' /*Comoro Franc*/,
79: 'CDF' /*Congolese Franc Congolais*/,'CRC' /*Costa Rican Colon*/,'HRK' /*Croatian Kuna*/, 'CUP' /*Cuban Peso*/,
80: 'DKK' /*Danish Krone*/, 'DJF' /*Djibouti Franc*/, 'DOP' /*Dominican Peso*/, 'XCD' /*East Caribbean Dollar*/,
81: 'EGP' /*Egyptian Pound*/, 'SVC' /*El Salvador Colon*/,'ERN' /*Eritrean Nakfa*/, 'EEK' /*Estonian Kroon*/,
82: 'ETB' /*Ethiopian Birr*/, 'EUR' /*Euro*/, 'FKP' /*Falkland Islands Pound*/, 'FJD' /*Fiji Dollar*/,
83: 'GMD' /*Gambia Dalasi*/, 'GEK' /*Georgian Kupon Larit*/,'GEL' /*Georgian Lari*/, 'GHS' /*Ghana Cedi*/,
84: 'GIP' /*Gibraltar Pound*/, 'GTQ' /*Guatemala Quetzal*/,'GNF' /*Guinea Franc*/, 'GYD' /*Guyana Dollar*/,
85: 'HTG' /*Haitian Gourde*/, 'HNL' /*Honduras Lempira*/, 'HKD' /*Hong Kong Dollar*/, 'HUF' /*Hungarian Forint*/,
86: 'ISK' /*Icelandic Krona*/, 'INR' /*Indian Rupee*/, 'IDR' /*Indonesian Rupiah*/, 'IRR' /*Iranian Rial*/,
87: 'IQD' /*Iraqi Dinar*/, 'ILS' /*Israeli New Sheqel*/,'JMD' /*Jamaican Dollar*/, 'JPY' /*Japanese Yen*/,
88: 'JOD' /*Jordanian Dinar*/, 'KZT' /*Kazakhstan Tenge*/, 'KES' /*Kenyan Shilling*/, 'KWD' /*Kuwaiti Dinar*/,
89: 'KGS' /*Kyrgystan Som*/, 'LAK' /*Laotian Kip*/, 'LVL' /*Latvian Lats*/, 'LBP' /*Lebanese Pound*/,
90: 'LSL' /*Lesotho Loti*/, 'LRD' /*Liberian Dollar*/, 'LYD' /*Libyan Dinar*/, 'LTL' /*Lithuanian Lita*/,
91: 'MOP' /*Macao Pataca*/, 'MKD' /*Macedonian Denar*/, 'MGA' /*Malagasy Ariary*/, 'MWK' /*Malawi Kwacha*/,
92: 'MYR' /*Malaysian Ringgit*/,'MVR' /*Maldive Islands Rufiyaa*/,'LSM' /*Maloti*/, 'MRO' /*Mauritania Ouguiya*/,
93: 'MUR' /*Mauritius Rupee*/, 'MXN' /*Mexican Peso*/, 'MDL' /*Moldovan Leu*/, 'MNT' /*Mongolian*/,
94: 'MAD' /*Moroccan Dirham*/, 'MZN' /*Mozambique Metical*/,'MMK' /*Myanmar Kyat*/, 'NAD' /*Namibia Dollar*/,
95: 'NPR' /*Nepalese Rupee*/, 'ANG' /*Netherlands Antillan Guilder*/,'YTL' /*New Turkish Lira*/,'NZD' /*New Zealand Dollar*/,
96: 'NIC' /*Nicaraguan Cordoba*/,'NGN' /*Nigerian Naira*/, 'KPW' /*North Korean Won*/, 'NOK' /*Norwegian Krone*/,
97: 'OMR' /*Oman Rial*/, 'PKR' /*Pakistan Rupee*/, 'PAB' /*Panamanian Balboa*/, 'PGK' /*Papua New Guinea Kina*/,
98: 'PYG' /*Paraguay Guarani*/, 'PEN' /*Peruvian Nuevo Sol*/,'PHP' /*Philippine Peso*/, 'PLN' /*Polish Zloty*/,
99: 'QAR' /*Qatari Rial*/, 'RHD' /*Rhodesian Dollar*/, 'RON' /*Romanian Leu*/, 'RUB' /*Russian Ruble*/,
100: 'RWF' /*Rwandan Franc*/, 'SHP' /*Saint Helena Pound*/,'STD' /*Sao Tome Dobra*/, 'SAR' /*Saudi Riyal*/,
101: 'RSD' /*Serbian Dinar*/, 'SCR' /*Seychelles Rupee*/, 'SLL' /*Sierra Leone Leone*/, 'SGD' /*Singapore Dollar*/,
102: 'SKK' /*Slovak Koruna*/, 'SBD' /*Solomon Islands Dollar*/,'SOS' /*Somali Shilling*/, 'ZAR' /*South African Rand*/,
103: 'KRW' /*South Korean Won*/, 'LKR' /*Sri Lanka Rupee*/, 'SDG' /*Sudanese Pound*/, 'SRD' /*Surinam Dollar*/,
104: 'SZL' /*Swaziland Lilangeni*/,'SEK' /*Swedish Krona*/, 'CHF' /*Swiss Franc*/, 'SYP' /*Syrian Pound*/,
105: 'TWD' /*Taiwan New Dollar*/,'TJS' /*Tajikistan Somoni*/,'TZS' /*Tanzanian Shilling*/, 'THB' /*Thai Baht*/,
106: 'TOP' /*Tonga Pa?anga*/, 'TTD' /*Trinidad and Tobago Dollar*/,'TND' /*Tunisian Dinar*/, 'TMM' /*Turkmenistan Manat*/,
107: 'USD' /*US Dollar*/, 'UGX' /*Ugandan Shilling*/, 'UAH' /*Ukrainian Hryvnia*/, 'AED' /*United Arab Emirates Dirham*/,
108: 'UYU' /*Uruguay Peso Uruguayo*/,'UZS' /*Uzbekistan Sum*/,'VUV' /*Vanuatu Vatu*/, 'VEB' /*Venezuelan Bolivar*/,
109: 'VEF' /*Venezuelan bolívar fuerte*/,'VND' /*Vietnamese Dong*/, 'CHE' /*WIR Euro*/, 'CHW' /*WIR Franc*/,
110: 'XOF' /*West African CFA franc*/,'WST' /*Western Samoa Tala*/,'YER' /*Yemeni Rial*/, 'ZMK' /*Zambian Kwacha*/,
111: 'ZWD' /*Zimbabwe Dollar*/,'TRY' /*Turkish Lira*/,'AZM' /*Azerbaijani Manat (1993-2006)*/, 'ROL' /*Old Romanian Leu*/,
112: 'TRL' /*Old Turkish Lira*/,'XPF' /*CFP Franc*/
113: );
114:
115: /**
116: * Get list preconfigured allowed locales
117: *
118: * @return array
119: */
120: public function getAllowedLocales()
121: {
122: $configData = Mage::getConfig()->getNode(Mage_Core_Model_Locale::XML_PATH_ALLOW_CODES);
123: if ($configData) {
124: $configData = $configData->asArray();
125: }
126: if ($configData) {
127: $configData = array_keys($configData);
128: } else {
129: $configData = array();
130: }
131: return array_merge($this->_allowedLocales, $configData);
132: }
133:
134: /**
135: * Get list preconfigured allowed currencies
136: *
137: * @return array
138: */
139: public function getAllowedCurrencies()
140: {
141: $configData = Mage::getConfig()->getNode(Mage_Core_Model_Locale::XML_PATH_ALLOW_CURRENCIES);
142: if ($configData) {
143: $configData = $configData->asArray();
144: }
145: if ($configData) {
146: $configData = array_keys($configData);
147: } else {
148: $configData = array();
149: }
150: return array_merge($this->_allowedCurrencies, $configData);
151: }
152: }
153: