web/lib/Zend/Locale.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category  Zend
    15  * @category  Zend
    16  * @package   Zend_Locale
    16  * @package   Zend_Locale
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license   http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license   http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version   $Id: Locale.php 24593 2012-01-05 20:35:02Z matthew $
    19  * @version   $Id$
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * Base class for localization
    23  * Base class for localization
    24  *
    24  *
    25  * @category  Zend
    25  * @category  Zend
    26  * @package   Zend_Locale
    26  * @package   Zend_Locale
    27  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    27  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    28  * @license   http://framework.zend.com/license/new-bsd     New BSD License
    28  * @license   http://framework.zend.com/license/new-bsd     New BSD License
    29  */
    29  */
    30 class Zend_Locale
    30 class Zend_Locale
    31 {
    31 {
    32     /**
    32     /**
       
    33      * List of locales that are no longer part of CLDR along with a
       
    34      * mapping to an appropriate alternative.
       
    35      *
       
    36      * @var array
       
    37      */
       
    38     private static $_localeAliases = array(
       
    39         'az_AZ'  => 'az_Latn_AZ',
       
    40         'bs_BA'  => 'bs_Latn_BA',
       
    41         'ha_GH'  => 'ha_Latn_GH',
       
    42         'ha_NE'  => 'ha_Latn_NE',
       
    43         'ha_NG'  => 'ha_Latn_NG',
       
    44         'kk_KZ'  => 'kk_Cyrl_KZ',
       
    45         'ks_IN'  => 'ks_Arab_IN',
       
    46         'mn_MN'  => 'mn_Cyrl_MN',
       
    47         'ms_BN'  => 'ms_Latn_BN',
       
    48         'ms_MY'  => 'ms_Latn_MY',
       
    49         'ms_SG'  => 'ms_Latn_SG',
       
    50         'pa_IN'  => 'pa_Guru_IN',
       
    51         'pa_PK'  => 'pa_Arab_PK',
       
    52         'shi_MA' => 'shi_Latn_MA',
       
    53         'sr_BA'  => 'sr_Latn_BA',
       
    54         'sr_ME'  => 'sr_Latn_ME',
       
    55         'sr_RS'  => 'sr_Latn_RS',
       
    56         'sr_XK'  => 'sr_Latn_XK',
       
    57         'tg_TJ'  => 'tg_Cyrl_TJ',
       
    58         'tzm_MA' => 'tzm_Latn_MA',
       
    59         'uz_AF'  => 'uz_Arab_AF',
       
    60         'uz_UZ'  => 'uz_Latn_UZ',
       
    61         'vai_LR' => 'vai_Latn_LR',
       
    62         'zh_CN' => 'zh_Hans_CN',
       
    63         'zh_HK' => 'zh_Hant_HK',
       
    64         'zh_MO' => 'zh_Hans_MO',
       
    65         'zh_SG' => 'zh_Hans_SG',
       
    66         'zh_TW' => 'zh_Hant_TW',
       
    67     );
       
    68 
       
    69     /**
    33      * Class wide Locale Constants
    70      * Class wide Locale Constants
    34      *
    71      *
    35      * @var array $_localeData
    72      * @var array $_localeData
    36      */
    73      */
    37     private static $_localeData = array(
    74     private static $_localeData = array(
    38         'root'  => true, 'aa_DJ' => true, 'aa_ER' => true, 'aa_ET' => true, 'aa'    => true,
    75         'root'        => true,
    39         'af_NA' => true, 'af_ZA' => true, 'af'    => true, 'ak_GH' => true, 'ak'    => true,
    76         'aa'          => true,
    40         'am_ET' => true, 'am'    => true, 'ar_AE' => true, 'ar_BH' => true, 'ar_DZ' => true,
    77         'aa_DJ'       => true,
    41         'ar_EG' => true, 'ar_IQ' => true, 'ar_JO' => true, 'ar_KW' => true, 'ar_LB' => true,
    78         'aa_ER'       => true,
    42         'ar_LY' => true, 'ar_MA' => true, 'ar_OM' => true, 'ar_QA' => true, 'ar_SA' => true,
    79         'aa_ET'       => true,
    43         'ar_SD' => true, 'ar_SY' => true, 'ar_TN' => true, 'ar_YE' => true, 'ar'    => true,
    80         'af'          => true,
    44         'as_IN' => true, 'as'    => true, 'az_AZ' => true, 'az'    => true, 'be_BY' => true,
    81         'af_NA'       => true,
    45         'be'    => true, 'bg_BG' => true, 'bg'    => true, 'bn_BD' => true, 'bn_IN' => true,
    82         'af_ZA'       => true,
    46         'bn'    => true, 'bo_CN' => true, 'bo_IN' => true, 'bo'    => true, 'bs_BA' => true,
    83         'agq'         => true,
    47         'bs'    => true, 'byn_ER'=> true, 'byn'   => true, 'ca_ES' => true, 'ca'    => true,
    84         'agq_CM'      => true,
    48         'cch_NG'=> true, 'cch'   => true, 'cop'   => true, 'cs_CZ' => true, 'cs'    => true,
    85         'ak'          => true,
    49         'cy_GB' => true, 'cy'    => true, 'da_DK' => true, 'da'    => true, 'de_AT' => true,
    86         'ak_GH'       => true,
    50         'de_BE' => true, 'de_CH' => true, 'de_DE' => true, 'de_LI' => true, 'de_LU' => true,
    87         'am'          => true,
    51         'de'    => true, 'dv_MV' => true, 'dv'    => true, 'dz_BT' => true, 'dz'    => true,
    88         'am_ET'       => true,
    52         'ee_GH' => true, 'ee_TG' => true, 'ee'    => true, 'el_CY' => true, 'el_GR' => true,
    89         'ar'          => true,
    53         'el'    => true, 'en_AS' => true, 'en_AU' => true, 'en_BE' => true, 'en_BW' => true,
    90         'ar_001'      => true,
    54         'en_BZ' => true, 'en_CA' => true, 'en_GB' => true, 'en_GU' => true, 'en_HK' => true,
    91         'ar_AE'       => true,
    55         'en_IE' => true, 'en_IN' => true, 'en_JM' => true, 'en_MH' => true, 'en_MP' => true,
    92         'ar_BH'       => true,
    56         'en_MT' => true, 'en_NA' => true, 'en_NZ' => true, 'en_PH' => true, 'en_PK' => true,
    93         'ar_DJ'       => true,
    57         'en_SG' => true, 'en_TT' => true, 'en_UM' => true, 'en_US' => true, 'en_VI' => true,
    94         'ar_DZ'       => true,
    58         'en_ZA' => true, 'en_ZW' => true, 'en'    => true, 'eo'    => true, 'es_AR' => true,
    95         'ar_EG'       => true,
    59         'es_BO' => true, 'es_CL' => true, 'es_CO' => true, 'es_CR' => true, 'es_DO' => true,
    96         'ar_EH'       => true,
    60         'es_EC' => true, 'es_ES' => true, 'es_GT' => true, 'es_HN' => true, 'es_MX' => true,
    97         'ar_ER'       => true,
    61         'es_NI' => true, 'es_PA' => true, 'es_PE' => true, 'es_PR' => true, 'es_PY' => true,
    98         'ar_IL'       => true,
    62         'es_SV' => true, 'es_US' => true, 'es_UY' => true, 'es_VE' => true, 'es'    => true,
    99         'ar_IQ'       => true,
    63         'et_EE' => true, 'et'    => true, 'eu_ES' => true, 'eu'    => true, 'fa_AF' => true,
   100         'ar_JO'       => true,
    64         'fa_IR' => true, 'fa'    => true, 'fi_FI' => true, 'fi'    => true, 'fil_PH'=> true,
   101         'ar_KM'       => true,
    65         'fil'   => true, 'fo_FO' => true, 'fo'    => true, 'fr_BE' => true, 'fr_CA' => true,
   102         'ar_KW'       => true,
    66         'fr_CH' => true, 'fr_FR' => true, 'fr_LU' => true, 'fr_MC' => true, 'fr_SN' => true,
   103         'ar_LB'       => true,
    67         'fr'    => true, 'fur_IT'=> true, 'fur'   => true, 'ga_IE' => true, 'ga'    => true,
   104         'ar_LY'       => true,
    68         'gaa_GH'=> true, 'gaa'   => true, 'gez_ER'=> true, 'gez_ET'=> true, 'gez'   => true,
   105         'ar_MA'       => true,
    69         'gl_ES' => true, 'gl'    => true, 'gsw_CH'=> true, 'gsw'   => true, 'gu_IN' => true,
   106         'ar_MR'       => true,
    70         'gu'    => true, 'gv_GB' => true, 'gv'    => true, 'ha_GH' => true, 'ha_NE' => true,
   107         'ar_OM'       => true,
    71         'ha_NG' => true, 'ha_SD' => true, 'ha'    => true, 'haw_US'=> true, 'haw'   => true,
   108         'ar_PS'       => true,
    72         'he_IL' => true, 'he'    => true, 'hi_IN' => true, 'hi'    => true, 'hr_HR' => true,
   109         'ar_QA'       => true,
    73         'hr'    => true, 'hu_HU' => true, 'hu'    => true, 'hy_AM' => true, 'hy'    => true,
   110         'ar_SA'       => true,
    74         'ia'    => true, 'id_ID' => true, 'id'    => true, 'ig_NG' => true, 'ig'    => true,
   111         'ar_SD'       => true,
    75         'ii_CN' => true, 'ii'    => true, 'in'    => true, 'is_IS' => true, 'is'    => true,
   112         'ar_SO'       => true,
    76         'it_CH' => true, 'it_IT' => true, 'it'    => true, 'iu'    => true, 'iw'    => true,
   113         'ar_SS'       => true,
    77         'ja_JP' => true, 'ja'    => true, 'ka_GE' => true, 'ka'    => true, 'kaj_NG'=> true,
   114         'ar_SY'       => true,
    78         'kaj'   => true, 'kam_KE'=> true, 'kam'   => true, 'kcg_NG'=> true, 'kcg'   => true,
   115         'ar_TD'       => true,
    79         'kfo_CI'=> true, 'kfo'   => true, 'kk_KZ' => true, 'kk'    => true, 'kl_GL' => true,
   116         'ar_TN'       => true,
    80         'kl'    => true, 'km_KH' => true, 'km'    => true, 'kn_IN' => true, 'kn'    => true,
   117         'ar_YE'       => true,
    81         'ko_KR' => true, 'ko'    => true, 'kok_IN'=> true, 'kok'   => true, 'kpe_GN'=> true,
   118         'as'          => true,
    82         'kpe_LR'=> true, 'kpe'   => true, 'ku_IQ' => true, 'ku_IR' => true, 'ku_SY' => true,
   119         'as_IN'       => true,
    83         'ku_TR' => true, 'ku'    => true, 'kw_GB' => true, 'kw'    => true, 'ky_KG' => true,
   120         'asa'         => true,
    84         'ky'    => true, 'ln_CD' => true, 'ln_CG' => true, 'ln'    => true, 'lo_LA' => true,
   121         'asa_TZ'      => true,
    85         'lo'    => true, 'lt_LT' => true, 'lt'    => true, 'lv_LV' => true, 'lv'    => true,
   122         'ast'         => true,
    86         'mk_MK' => true, 'mk'    => true, 'ml_IN' => true, 'ml'    => true, 'mn_CN' => true,
   123         'ast_ES'      => true,
    87         'mn_MN' => true, 'mn'    => true, 'mo'    => true, 'mr_IN' => true, 'mr'    => true,
   124         'az'          => true,
    88         'ms_BN' => true, 'ms_MY' => true, 'ms'    => true, 'mt_MT' => true, 'mt'    => true,
   125         'az_Cyrl'     => true,
    89         'my_MM' => true, 'my'    => true, 'nb_NO' => true, 'nb'    => true, 'nds_DE'=> true,
   126         'az_Cyrl_AZ'  => true,
    90         'nds'   => true, 'ne_IN' => true, 'ne_NP' => true, 'ne'    => true, 'nl_BE' => true,
   127         'az_Latn'     => true,
    91         'nl_NL' => true, 'nl'    => true, 'nn_NO' => true, 'nn'    => true, 'no'    => true,
   128         'az_Latn_AZ'  => true,
    92         'nr_ZA' => true, 'nr'    => true, 'nso_ZA'=> true, 'nso'   => true, 'ny_MW' => true,
   129         'bas'         => true,
    93         'ny'    => true, 'oc_FR' => true, 'oc'    => true, 'om_ET' => true, 'om_KE' => true,
   130         'bas_CM'      => true,
    94         'om'    => true, 'or_IN' => true, 'or'    => true, 'pa_IN' => true, 'pa_PK' => true,
   131         'be'          => true,
    95         'pa'    => true, 'pl_PL' => true, 'pl'    => true, 'ps_AF' => true, 'ps'    => true,
   132         'be_BY'       => true,
    96         'pt_BR' => true, 'pt_PT' => true, 'pt'    => true, 'ro_MD' => true, 'ro_RO' => true,
   133         'bem'         => true,
    97         'ro'    => true, 'ru_RU' => true, 'ru_UA' => true, 'ru'    => true, 'rw_RW' => true,
   134         'bem_ZM'      => true,
    98         'rw'    => true, 'sa_IN' => true, 'sa'    => true, 'se_FI' => true, 'se_NO' => true,
   135         'bez'         => true,
    99         'se'    => true, 'sh_BA' => true, 'sh_CS' => true, 'sh_YU' => true, 'sh'    => true,
   136         'bez_TZ'      => true,
   100         'si_LK' => true, 'si'    => true, 'sid_ET'=> true, 'sid'   => true, 'sk_SK' => true,
   137         'bg'          => true,
   101         'sk'    => true, 'sl_SI' => true, 'sl'    => true, 'so_DJ' => true, 'so_ET' => true,
   138         'bg_BG'       => true,
   102         'so_KE' => true, 'so_SO' => true, 'so'    => true, 'sq_AL' => true, 'sq'    => true,
   139         'bm'          => true,
   103         'sr_BA' => true, 'sr_CS' => true, 'sr_ME' => true, 'sr_RS' => true, 'sr_YU' => true,
   140         'bm_ML'       => true,
   104         'sr'    => true, 'ss_SZ' => true, 'ss_ZA' => true, 'ss'    => true, 'st_LS' => true,
   141         'bn'          => true,
   105         'st_ZA' => true, 'st'    => true, 'sv_FI' => true, 'sv_SE' => true, 'sv'    => true,
   142         'bn_BD'       => true,
   106         'sw_KE' => true, 'sw_TZ' => true, 'sw'    => true, 'syr_SY'=> true, 'syr'   => true,
   143         'bn_IN'       => true,
   107         'ta_IN' => true, 'ta'    => true, 'te_IN' => true, 'te'    => true, 'tg_TJ' => true,
   144         'bo'          => true,
   108         'tg'    => true, 'th_TH' => true, 'th'    => true, 'ti_ER' => true, 'ti_ET' => true,
   145         'bo_CN'       => true,
   109         'ti'    => true, 'tig_ER'=> true, 'tig'   => true, 'tl'    => true, 'tn_ZA' => true,
   146         'bo_IN'       => true,
   110         'tn'    => true, 'to_TO' => true, 'to'    => true, 'tr_TR' => true, 'tr'    => true,
   147         'br'          => true,
   111         'trv_TW'=> true, 'trv'   => true, 'ts_ZA' => true, 'ts'    => true, 'tt_RU' => true,
   148         'br_FR'       => true,
   112         'tt'    => true, 'ug_CN' => true, 'ug'    => true, 'uk_UA' => true, 'uk'    => true,
   149         'brx'         => true,
   113         'ur_IN' => true, 'ur_PK' => true, 'ur'    => true, 'uz_AF' => true, 'uz_UZ' => true,
   150         'brx_IN'      => true,
   114         'uz'    => true, 've_ZA' => true, 've'    => true, 'vi_VN' => true, 'vi'    => true,
   151         'bs'          => true,
   115         'wal_ET'=> true, 'wal'   => true, 'wo_SN' => true, 'wo'    => true, 'xh_ZA' => true,
   152         'bs_Cyrl'     => true,
   116         'xh'    => true, 'yo_NG' => true, 'yo'    => true, 'zh_CN' => true, 'zh_HK' => true,
   153         'bs_Cyrl_BA'  => true,
   117         'zh_MO' => true, 'zh_SG' => true, 'zh_TW' => true, 'zh'    => true, 'zu_ZA' => true,
   154         'bs_Latn'     => true,
   118         'zu'    => true
   155         'bs_Latn_BA'  => true,
       
   156         'byn'         => true,
       
   157         'byn_ER'      => true,
       
   158         'ca'          => true,
       
   159         'ca_AD'       => true,
       
   160         'ca_ES'       => true,
       
   161         'ca_ES_VALENCIA' => true,
       
   162         'ca_FR'       => true,
       
   163         'ca_IT'       => true,
       
   164         'cgg'         => true,
       
   165         'cgg_UG'      => true,
       
   166         'chr'         => true,
       
   167         'chr_US'      => true,
       
   168         'cs'          => true,
       
   169         'cs_CZ'       => true,
       
   170         'cy'          => true,
       
   171         'cy_GB'       => true,
       
   172         'da'          => true,
       
   173         'da_DK'       => true,
       
   174         'da_GL'       => true,
       
   175         'dav'         => true,
       
   176         'dav_KE'      => true,
       
   177         'de'          => true,
       
   178         'de_AT'       => true,
       
   179         'de_BE'       => true,
       
   180         'de_CH'       => true,
       
   181         'de_DE'       => true,
       
   182         'de_LI'       => true,
       
   183         'de_LU'       => true,
       
   184         'dje'         => true,
       
   185         'dje_NE'      => true,
       
   186         'dua'         => true,
       
   187         'dua_CM'      => true,
       
   188         'dyo'         => true,
       
   189         'dyo_SN'      => true,
       
   190         'dz'          => true,
       
   191         'dz_BT'       => true,
       
   192         'ebu'         => true,
       
   193         'ebu_KE'      => true,
       
   194         'ee'          => true,
       
   195         'ee_GH'       => true,
       
   196         'ee_TG'       => true,
       
   197         'el'          => true,
       
   198         'el_CY'       => true,
       
   199         'el_GR'       => true,
       
   200         'en'          => true,
       
   201         'en_001'      => true,
       
   202         'en_150'      => true,
       
   203         'en_AG'       => true,
       
   204         'en_AI'       => true,
       
   205         'en_AS'       => true,
       
   206         'en_AU'       => true,
       
   207         'en_BB'       => true,
       
   208         'en_BE'       => true,
       
   209         'en_BM'       => true,
       
   210         'en_BS'       => true,
       
   211         'en_BW'       => true,
       
   212         'en_BZ'       => true,
       
   213         'en_CA'       => true,
       
   214         'en_CC'       => true,
       
   215         'en_CK'       => true,
       
   216         'en_CM'       => true,
       
   217         'en_CX'       => true,
       
   218         'en_DG'       => true,
       
   219         'en_DM'       => true,
       
   220         'en_Dsrt'     => true,
       
   221         'en_Dsrt_US'  => true,
       
   222         'en_ER'       => true,
       
   223         'en_FJ'       => true,
       
   224         'en_FK'       => true,
       
   225         'en_FM'       => true,
       
   226         'en_GB'       => true,
       
   227         'en_GD'       => true,
       
   228         'en_GG'       => true,
       
   229         'en_GH'       => true,
       
   230         'en_GI'       => true,
       
   231         'en_GM'       => true,
       
   232         'en_GU'       => true,
       
   233         'en_GY'       => true,
       
   234         'en_HK'       => true,
       
   235         'en_IE'       => true,
       
   236         'en_IM'       => true,
       
   237         'en_IN'       => true,
       
   238         'en_IO'       => true,
       
   239         'en_JE'       => true,
       
   240         'en_JM'       => true,
       
   241         'en_KE'       => true,
       
   242         'en_KI'       => true,
       
   243         'en_KN'       => true,
       
   244         'en_KY'       => true,
       
   245         'en_LC'       => true,
       
   246         'en_LR'       => true,
       
   247         'en_LS'       => true,
       
   248         'en_MG'       => true,
       
   249         'en_MH'       => true,
       
   250         'en_MO'       => true,
       
   251         'en_MP'       => true,
       
   252         'en_MS'       => true,
       
   253         'en_MT'       => true,
       
   254         'en_MU'       => true,
       
   255         'en_MW'       => true,
       
   256         'en_NA'       => true,
       
   257         'en_NF'       => true,
       
   258         'en_NG'       => true,
       
   259         'en_NR'       => true,
       
   260         'en_NU'       => true,
       
   261         'en_NZ'       => true,
       
   262         'en_PG'       => true,
       
   263         'en_PH'       => true,
       
   264         'en_PK'       => true,
       
   265         'en_PN'       => true,
       
   266         'en_PR'       => true,
       
   267         'en_PW'       => true,
       
   268         'en_RW'       => true,
       
   269         'en_SB'       => true,
       
   270         'en_SC'       => true,
       
   271         'en_SD'       => true,
       
   272         'en_SG'       => true,
       
   273         'en_SH'       => true,
       
   274         'en_SL'       => true,
       
   275         'en_SS'       => true,
       
   276         'en_SX'       => true,
       
   277         'en_SZ'       => true,
       
   278         'en_TC'       => true,
       
   279         'en_TK'       => true,
       
   280         'en_TO'       => true,
       
   281         'en_TT'       => true,
       
   282         'en_TV'       => true,
       
   283         'en_TZ'       => true,
       
   284         'en_UG'       => true,
       
   285         'en_UM'       => true,
       
   286         'en_US'       => true,
       
   287         'en_US_POSIX' => true,
       
   288         'en_VC'       => true,
       
   289         'en_VG'       => true,
       
   290         'en_VI'       => true,
       
   291         'en_VU'       => true,
       
   292         'en_WS'       => true,
       
   293         'en_ZA'       => true,
       
   294         'en_ZM'       => true,
       
   295         'en_ZW'       => true,
       
   296         'eo'          => true,
       
   297         'eo_001'      => true,
       
   298         'es'          => true,
       
   299         'es_419'      => true,
       
   300         'es_AR'       => true,
       
   301         'es_BO'       => true,
       
   302         'es_CL'       => true,
       
   303         'es_CO'       => true,
       
   304         'es_CR'       => true,
       
   305         'es_CU'       => true,
       
   306         'es_DO'       => true,
       
   307         'es_EA'       => true,
       
   308         'es_EC'       => true,
       
   309         'es_ES'       => true,
       
   310         'es_GQ'       => true,
       
   311         'es_GT'       => true,
       
   312         'es_HN'       => true,
       
   313         'es_IC'       => true,
       
   314         'es_MX'       => true,
       
   315         'es_NI'       => true,
       
   316         'es_PA'       => true,
       
   317         'es_PE'       => true,
       
   318         'es_PH'       => true,
       
   319         'es_PR'       => true,
       
   320         'es_PY'       => true,
       
   321         'es_SV'       => true,
       
   322         'es_US'       => true,
       
   323         'es_UY'       => true,
       
   324         'es_VE'       => true,
       
   325         'et'          => true,
       
   326         'et_EE'       => true,
       
   327         'eu'          => true,
       
   328         'eu_ES'       => true,
       
   329         'ewo'         => true,
       
   330         'ewo_CM'      => true,
       
   331         'fa'          => true,
       
   332         'fa_AF'       => true,
       
   333         'fa_IR'       => true,
       
   334         'ff'          => true,
       
   335         'ff_CM'       => true,
       
   336         'ff_GN'       => true,
       
   337         'ff_MR'       => true,
       
   338         'fr_PM'       => true,
       
   339         'ff_SN'       => true,
       
   340         'fr_WF'       => true,
       
   341         'fi'          => true,
       
   342         'fi_FI'       => true,
       
   343         'fil'         => true,
       
   344         'fil_PH'      => true,
       
   345         'fo'          => true,
       
   346         'fo_FO'       => true,
       
   347         'fr'          => true,
       
   348         'fr_BE'       => true,
       
   349         'fr_BF'       => true,
       
   350         'fr_BI'       => true,
       
   351         'fr_BJ'       => true,
       
   352         'fr_BL'       => true,
       
   353         'fr_CA'       => true,
       
   354         'fr_CD'       => true,
       
   355         'fr_CF'       => true,
       
   356         'fr_CG'       => true,
       
   357         'fr_CH'       => true,
       
   358         'fr_CI'       => true,
       
   359         'fr_CM'       => true,
       
   360         'fr_DJ'       => true,
       
   361         'fr_DZ'       => true,
       
   362         'fr_FR'       => true,
       
   363         'fr_GA'       => true,
       
   364         'fr_GF'       => true,
       
   365         'fr_GN'       => true,
       
   366         'fr_GP'       => true,
       
   367         'fr_GQ'       => true,
       
   368         'fr_HT'       => true,
       
   369         'fr_KM'       => true,
       
   370         'fr_LU'       => true,
       
   371         'fr_MA'       => true,
       
   372         'fr_MC'       => true,
       
   373         'fr_MF'       => true,
       
   374         'fr_MG'       => true,
       
   375         'fr_ML'       => true,
       
   376         'fr_MQ'       => true,
       
   377         'fr_MR'       => true,
       
   378         'fr_MU'       => true,
       
   379         'fr_NC'       => true,
       
   380         'fr_NE'       => true,
       
   381         'fr_PF'       => true,
       
   382         'fr_RE'       => true,
       
   383         'fr_RW'       => true,
       
   384         'fr_SC'       => true,
       
   385         'fr_SN'       => true,
       
   386         'fr_SY'       => true,
       
   387         'fr_TD'       => true,
       
   388         'fr_TG'       => true,
       
   389         'fr_TN'       => true,
       
   390         'fr_VU'       => true,
       
   391         'fr_YT'       => true,
       
   392         'fur'         => true,
       
   393         'fur_IT'      => true,
       
   394         'fy'          => true,
       
   395         'fy_NL'       => true,
       
   396         'ga'          => true,
       
   397         'ga_IE'       => true,
       
   398         'gd'          => true,
       
   399         'gd_GB'       => true,
       
   400         'gl'          => true,
       
   401         'gl_ES'       => true,
       
   402         'gsw'         => true,
       
   403         'gsw_CH'      => true,
       
   404         'gsw_LI'      => true,
       
   405         'gu'          => true,
       
   406         'gu_IN'       => true,
       
   407         'guz'         => true,
       
   408         'guz_KE'      => true,
       
   409         'gv'          => true,
       
   410         'gv_IM'       => true,
       
   411         'ha'          => true,
       
   412         'ha_Latn'     => true,
       
   413         'ha_Latn_GH'  => true,
       
   414         'ha_Latn_NE'  => true,
       
   415         'ha_Latn_NG'  => true,
       
   416         'haw'         => true,
       
   417         'haw_US'      => true,
       
   418         'he'          => true,
       
   419         'he_IL'       => true,
       
   420         'hi'          => true,
       
   421         'hi_IN'       => true,
       
   422         'hr'          => true,
       
   423         'hr_BA'       => true,
       
   424         'hr_HR'       => true,
       
   425         'hu'          => true,
       
   426         'hu_HU'       => true,
       
   427         'hy'          => true,
       
   428         'hy_AM'       => true,
       
   429         'ia'          => true,
       
   430         'ia_FR'       => true,
       
   431         'id'          => true,
       
   432         'id_ID'       => true,
       
   433         'ig'          => true,
       
   434         'ig_NG'       => true,
       
   435         'ii'          => true,
       
   436         'ii_CN'       => true,
       
   437         'is'          => true,
       
   438         'is_IS'       => true,
       
   439         'it'          => true,
       
   440         'it_CH'       => true,
       
   441         'it_IT'       => true,
       
   442         'it_SM'       => true,
       
   443         'ja'          => true,
       
   444         'ja_JP'       => true,
       
   445         'jgo'         => true,
       
   446         'jgo_CM'      => true,
       
   447         'jmc'         => true,
       
   448         'jmc_TZ'      => true,
       
   449         'ka'          => true,
       
   450         'ka_GE'       => true,
       
   451         'kab'         => true,
       
   452         'kab_DZ'      => true,
       
   453         'kam'         => true,
       
   454         'kam_KE'      => true,
       
   455         'kde'         => true,
       
   456         'kde_TZ'      => true,
       
   457         'kea'         => true,
       
   458         'kea_CV'      => true,
       
   459         'khq'         => true,
       
   460         'khq_ML'      => true,
       
   461         'ki'          => true,
       
   462         'ki_KE'       => true,
       
   463         'kk'          => true,
       
   464         'kk_Cyrl'     => true,
       
   465         'kk_Cyrl_KZ'  => true,
       
   466         'kkj'         => true,
       
   467         'kkj_CM'      => true,
       
   468         'kl'          => true,
       
   469         'kl_GL'       => true,
       
   470         'kln'         => true,
       
   471         'kln_KE'      => true,
       
   472         'km'          => true,
       
   473         'km_KH'       => true,
       
   474         'kn'          => true,
       
   475         'kn_IN'       => true,
       
   476         'ko'          => true,
       
   477         'ko_KP'       => true,
       
   478         'ko_KR'       => true,
       
   479         'kok'         => true,
       
   480         'kok_IN'      => true,
       
   481         'ks'          => true,
       
   482         'ks_Arab'     => true,
       
   483         'ks_Arab_IN'  => true,
       
   484         'ksb'         => true,
       
   485         'ksb_TZ'      => true,
       
   486         'ksf'         => true,
       
   487         'ksf_CM'      => true,
       
   488         'ksh'         => true,
       
   489         'ksh_DE'      => true,
       
   490         'kw'          => true,
       
   491         'kw_GB'       => true,
       
   492         'ky'          => true,
       
   493         'ky_Cyrl'     => true,
       
   494         'ky_Cyrl_KG'  => true,
       
   495         'lag'         => true,
       
   496         'lag_TZ'      => true,
       
   497         'lg'          => true,
       
   498         'lg_UG'       => true,
       
   499         'lkt'         => true,
       
   500         'lkt_US'      => true,
       
   501         'ln'          => true,
       
   502         'ln_AO'       => true,
       
   503         'ln_CD'       => true,
       
   504         'ln_CF'       => true,
       
   505         'ln_CG'       => true,
       
   506         'lo'          => true,
       
   507         'lo_LA'       => true,
       
   508         'lt'          => true,
       
   509         'lt_LT'       => true,
       
   510         'lu'          => true,
       
   511         'lu_CD'       => true,
       
   512         'luo'         => true,
       
   513         'luo_KE'      => true,
       
   514         'luy'         => true,
       
   515         'luy_KE'      => true,
       
   516         'lv'          => true,
       
   517         'lv_LV'       => true,
       
   518         'mas'         => true,
       
   519         'mas_KE'      => true,
       
   520         'mas_TZ'      => true,
       
   521         'mer'         => true,
       
   522         'mer_KE'      => true,
       
   523         'mfe'         => true,
       
   524         'mfe_MU'      => true,
       
   525         'mg'          => true,
       
   526         'mg_MG'       => true,
       
   527         'mgh'         => true,
       
   528         'mgh_MZ'      => true,
       
   529         'mgo'         => true,
       
   530         'mgo_CM'      => true,
       
   531         'mk'          => true,
       
   532         'mk_MK'       => true,
       
   533         'ml'          => true,
       
   534         'ml_IN'       => true,
       
   535         'mn'          => true,
       
   536         'mn_Cyrl'     => true,
       
   537         'mn_Cyrl_MN'  => true,
       
   538         'mr'          => true,
       
   539         'mr_IN'       => true,
       
   540         'ms'          => true,
       
   541         'ms_Latn'     => true,
       
   542         'ms_Latn_BN'  => true,
       
   543         'ms_Latn_MY'  => true,
       
   544         'ms_Latn_SG'  => true,
       
   545         'mt'          => true,
       
   546         'mt_MT'       => true,
       
   547         'mua'         => true,
       
   548         'mua_CM'      => true,
       
   549         'my'          => true,
       
   550         'my_MM'       => true,
       
   551         'naq'         => true,
       
   552         'naq_NA'      => true,
       
   553         'nb'          => true,
       
   554         'nb_NO'       => true,
       
   555         'nb_SJ'       => true,
       
   556         'nd'          => true,
       
   557         'nd_ZW'       => true,
       
   558         'ne'          => true,
       
   559         'ne_IN'       => true,
       
   560         'ne_NP'       => true,
       
   561         'nl'          => true,
       
   562         'nl_AW'       => true,
       
   563         'nl_BE'       => true,
       
   564         'nl_BQ'       => true,
       
   565         'nl_CW'       => true,
       
   566         'nl_NL'       => true,
       
   567         'nl_SR'       => true,
       
   568         'nl_SX'       => true,
       
   569         'nmg'         => true,
       
   570         'nmg_CM'      => true,
       
   571         'nn'          => true,
       
   572         'nn_NO'       => true,
       
   573         'nnh'         => true,
       
   574         'nnh_CM'      => true,
       
   575         'nr'          => true,
       
   576         'nr_ZA'       => true,
       
   577         'nso'         => true,
       
   578         'nso_ZA'      => true,
       
   579         'nus'         => true,
       
   580         'nus_SD'      => true,
       
   581         'nyn'         => true,
       
   582         'nyn_UG'      => true,
       
   583         'om'          => true,
       
   584         'om_ET'       => true,
       
   585         'om_KE'       => true,
       
   586         'or'          => true,
       
   587         'or_IN'       => true,
       
   588         'ordinals'    => true,
       
   589         'os'          => true,
       
   590         'os_GE'       => true,
       
   591         'os_RU'       => true,
       
   592         'pa'          => true,
       
   593         'pa_Arab'     => true,
       
   594         'pa_Arab_PK'  => true,
       
   595         'pa_Guru'     => true,
       
   596         'pa_Guru_IN'  => true,
       
   597         'pl'          => true,
       
   598         'pl_PL'       => true,
       
   599         'plurals'     => true,
       
   600         'ps'          => true,
       
   601         'ps_AF'       => true,
       
   602         'pt'          => true,
       
   603         'pt_AO'       => true,
       
   604         'pt_BR'       => true,
       
   605         'pt_CV'       => true,
       
   606         'pt_GW'       => true,
       
   607         'pt_MO'       => true,
       
   608         'pt_MZ'       => true,
       
   609         'pt_PT'       => true,
       
   610         'pt_ST'       => true,
       
   611         'pt_TL'       => true,
       
   612         'rm'          => true,
       
   613         'rm_CH'       => true,
       
   614         'rn'          => true,
       
   615         'rn_BI'       => true,
       
   616         'ro'          => true,
       
   617         'ro_MD'       => true,
       
   618         'ro_RO'       => true,
       
   619         'rof'         => true,
       
   620         'rof_TZ'      => true,
       
   621         'ru'          => true,
       
   622         'ru_BY'       => true,
       
   623         'ru_KG'       => true,
       
   624         'ru_KZ'       => true,
       
   625         'ru_MD'       => true,
       
   626         'ru_RU'       => true,
       
   627         'ru_UA'       => true,
       
   628         'rw'          => true,
       
   629         'rw_RW'       => true,
       
   630         'rwk'         => true,
       
   631         'rwk_TZ'      => true,
       
   632         'sah'         => true,
       
   633         'sah_RU'      => true,
       
   634         'saq'         => true,
       
   635         'saq_KE'      => true,
       
   636         'sbp'         => true,
       
   637         'sbp_TZ'      => true,
       
   638         'se'          => true,
       
   639         'se_FI'       => true,
       
   640         'se_NO'       => true,
       
   641         'seh'         => true,
       
   642         'seh_MZ'      => true,
       
   643         'ses'         => true,
       
   644         'ses_ML'      => true,
       
   645         'sg'          => true,
       
   646         'sg_CF'       => true,
       
   647         'shi'         => true,
       
   648         'shi_Latn'    => true,
       
   649         'shi_Latn_MA' => true,
       
   650         'shi_Tfng'    => true,
       
   651         'shi_Tfng_MA' => true,
       
   652         'si'          => true,
       
   653         'si_LK'       => true,
       
   654         'sk'          => true,
       
   655         'sk_SK'       => true,
       
   656         'sl'          => true,
       
   657         'sl_SI'       => true,
       
   658         'sn'          => true,
       
   659         'sn_ZW'       => true,
       
   660         'so'          => true,
       
   661         'so_DJ'       => true,
       
   662         'so_ET'       => true,
       
   663         'so_KE'       => true,
       
   664         'so_SO'       => true,
       
   665         'sq'          => true,
       
   666         'sq_AL'       => true,
       
   667         'sq_MK'       => true,
       
   668         'sq_XK'       => true,
       
   669         'sr'          => true,
       
   670         'sr_Cyrl'     => true,
       
   671         'sr_Cyrl_BA'  => true,
       
   672         'sr_Cyrl_ME'  => true,
       
   673         'sr_Cyrl_RS'  => true,
       
   674         'sr_Cyrl_XK'  => true,
       
   675         'sr_Latn'     => true,
       
   676         'sr_Latn_BA'  => true,
       
   677         'sr_Latn_ME'  => true,
       
   678         'sr_Latn_RS'  => true,
       
   679         'sr_Latn_XK'  => true,
       
   680         'ss'          => true,
       
   681         'ss_SZ'       => true,
       
   682         'ss_ZA'       => true,
       
   683         'ssy'         => true,
       
   684         'ssy_ER'      => true,
       
   685         'st'          => true,
       
   686         'st_LS'       => true,
       
   687         'st_ZA'       => true,
       
   688         'sv'          => true,
       
   689         'sv_AX'       => true,
       
   690         'sv_FI'       => true,
       
   691         'sv_SE'       => true,
       
   692         'sw'          => true,
       
   693         'sw_KE'       => true,
       
   694         'sw_TZ'       => true,
       
   695         'sw_UG'       => true,
       
   696         'swc'         => true,
       
   697         'swc_CD'      => true,
       
   698         'ta'          => true,
       
   699         'ta_IN'       => true,
       
   700         'ta_LK'       => true,
       
   701         'ta_MY'       => true,
       
   702         'ta_SG'       => true,
       
   703         'te'          => true,
       
   704         'te_IN'       => true,
       
   705         'teo'         => true,
       
   706         'teo_KE'      => true,
       
   707         'teo_UG'      => true,
       
   708         'tg'          => true,
       
   709         'tg_Cyrl'     => true,
       
   710         'tg_Cyrl_TJ'  => true,
       
   711         'th'          => true,
       
   712         'th_TH'       => true,
       
   713         'ti'          => true,
       
   714         'ti_ER'       => true,
       
   715         'ti_ET'       => true,
       
   716         'tig'         => true,
       
   717         'tig_ER'      => true,
       
   718         'tn'          => true,
       
   719         'tn_BW'       => true,
       
   720         'tn_ZA'       => true,
       
   721         'to'          => true,
       
   722         'to_TO'       => true,
       
   723         'tr'          => true,
       
   724         'tr_CY'       => true,
       
   725         'tr_TR'       => true,
       
   726         'ts'          => true,
       
   727         'ts_ZA'       => true,
       
   728         'twq'         => true,
       
   729         'twq_NE'      => true,
       
   730         'tzm'         => true,
       
   731         'tzm_Latn'    => true,
       
   732         'tzm_Latn_MA' => true,
       
   733         'ug'          => true,
       
   734         'ug_Arab'     => true,
       
   735         'ug_Arab_CN'  => true,
       
   736         'uk'          => true,
       
   737         'uk_UA'       => true,
       
   738         'ur'          => true,
       
   739         'ur_IN'       => true,
       
   740         'ur_PK'       => true,
       
   741         'uz'          => true,
       
   742         'uz_Arab'     => true,
       
   743         'uz_Arab_AF'  => true,
       
   744         'uz_Cyrl'     => true,
       
   745         'uz_Cyrl_UZ'  => true,
       
   746         'uz_Latn'     => true,
       
   747         'uz_Latn_UZ'  => true,
       
   748         'vai'         => true,
       
   749         'vai_Latn'    => true,
       
   750         'vai_Latn_LR' => true,
       
   751         'vai_Vaii'    => true,
       
   752         'vai_Vaii_LR' => true,
       
   753         've'          => true,
       
   754         've_ZA'       => true,
       
   755         'vi'          => true,
       
   756         'vi_VN'       => true,
       
   757         'vo'          => true,
       
   758         'vo_001'      => true,
       
   759         'vun'         => true,
       
   760         'vun_TZ'      => true,
       
   761         'wae'         => true,
       
   762         'wae_CH'      => true,
       
   763         'wal'         => true,
       
   764         'wal_ET'      => true,
       
   765         'xh'          => true,
       
   766         'xh_ZA'       => true,
       
   767         'xog'         => true,
       
   768         'xog_UG'      => true,
       
   769         'yav'         => true,
       
   770         'yav_CM'      => true,
       
   771         'yo'          => true,
       
   772         'yo_BJ'       => true,
       
   773         'yo_NG'       => true,
       
   774         'zgh'         => true,
       
   775         'zgh_MA'      => true,
       
   776         'zh'          => true,
       
   777         'zh_Hans'     => true,
       
   778         'zh_Hans_CN'  => true,
       
   779         'zh_Hans_HK'  => true,
       
   780         'zh_Hans_MO'  => true,
       
   781         'zh_Hans_SG'  => true,
       
   782         'zh_Hant'     => true,
       
   783         'zh_Hant_HK'  => true,
       
   784         'zh_Hant_MO'  => true,
       
   785         'zh_Hant_TW'  => true,
       
   786         'zu'          => true,
       
   787         'zu_ZA'       => true,
   119     );
   788     );
   120 
   789 
   121     /**
   790     /**
   122      * Class wide Locale Constants
   791      * Class wide Locale Constants
   123      *
   792      *
   124      * @var array $_territoryData
   793      * @var array $_territoryData
   125      */
   794      */
   126     private static $_territoryData = array(
   795     private static $_territoryData = array(
   127         'AD' => 'ca_AD', 'AE' => 'ar_AE', 'AF' => 'fa_AF', 'AG' => 'en_AG', 'AI' => 'en_AI',
   796         'AD' => 'ca_AD',
   128         'AL' => 'sq_AL', 'AM' => 'hy_AM', 'AN' => 'pap_AN', 'AO' => 'pt_AO', 'AQ' => 'und_AQ',
   797         'AE' => 'ar_AE',
   129         'AR' => 'es_AR', 'AS' => 'sm_AS', 'AT' => 'de_AT', 'AU' => 'en_AU', 'AW' => 'nl_AW',
   798         'AF' => 'fa_AF',
   130         'AX' => 'sv_AX', 'AZ' => 'az_Latn_AZ', 'BA' => 'bs_BA', 'BB' => 'en_BB', 'BD' => 'bn_BD',
   799         'AG' => 'en_AG',
   131         'BE' => 'nl_BE', 'BF' => 'mos_BF', 'BG' => 'bg_BG', 'BH' => 'ar_BH', 'BI' => 'rn_BI',
   800         'AI' => 'en_AI',
   132         'BJ' => 'fr_BJ', 'BL' => 'fr_BL', 'BM' => 'en_BM', 'BN' => 'ms_BN', 'BO' => 'es_BO',
   801         'AL' => 'sq_AL',
   133         'BR' => 'pt_BR', 'BS' => 'en_BS', 'BT' => 'dz_BT', 'BV' => 'und_BV', 'BW' => 'en_BW',
   802         'AM' => 'hy_AM',
   134         'BY' => 'be_BY', 'BZ' => 'en_BZ', 'CA' => 'en_CA', 'CC' => 'ms_CC', 'CD' => 'sw_CD',
   803         'AN' => 'pap_AN',
   135         'CF' => 'fr_CF', 'CG' => 'fr_CG', 'CH' => 'de_CH', 'CI' => 'fr_CI', 'CK' => 'en_CK',
   804         'AO' => 'pt_AO',
   136         'CL' => 'es_CL', 'CM' => 'fr_CM', 'CN' => 'zh_Hans_CN', 'CO' => 'es_CO', 'CR' => 'es_CR',
   805         'AQ' => 'und_AQ',
   137         'CU' => 'es_CU', 'CV' => 'kea_CV', 'CX' => 'en_CX', 'CY' => 'el_CY', 'CZ' => 'cs_CZ',
   806         'AR' => 'es_AR',
   138         'DE' => 'de_DE', 'DJ' => 'aa_DJ', 'DK' => 'da_DK', 'DM' => 'en_DM', 'DO' => 'es_DO',
   807         'AS' => 'sm_AS',
   139         'DZ' => 'ar_DZ', 'EC' => 'es_EC', 'EE' => 'et_EE', 'EG' => 'ar_EG', 'EH' => 'ar_EH',
   808         'AT' => 'de_AT',
   140         'ER' => 'ti_ER', 'ES' => 'es_ES', 'ET' => 'en_ET', 'FI' => 'fi_FI', 'FJ' => 'hi_FJ',
   809         'AU' => 'en_AU',
   141         'FK' => 'en_FK', 'FM' => 'chk_FM', 'FO' => 'fo_FO', 'FR' => 'fr_FR', 'GA' => 'fr_GA',
   810         'AW' => 'nl_AW',
   142         'GB' => 'en_GB', 'GD' => 'en_GD', 'GE' => 'ka_GE', 'GF' => 'fr_GF', 'GG' => 'en_GG',
   811         'AX' => 'sv_AX',
   143         'GH' => 'ak_GH', 'GI' => 'en_GI', 'GL' => 'iu_GL', 'GM' => 'en_GM', 'GN' => 'fr_GN',
   812         'AZ' => 'az_Latn_AZ',
   144         'GP' => 'fr_GP', 'GQ' => 'fan_GQ', 'GR' => 'el_GR', 'GS' => 'und_GS', 'GT' => 'es_GT',
   813         'BA' => 'bs_BA',
   145         'GU' => 'en_GU', 'GW' => 'pt_GW', 'GY' => 'en_GY', 'HK' => 'zh_Hant_HK', 'HM' => 'und_HM',
   814         'BB' => 'en_BB',
   146         'HN' => 'es_HN', 'HR' => 'hr_HR', 'HT' => 'ht_HT', 'HU' => 'hu_HU', 'ID' => 'id_ID',
   815         'BD' => 'bn_BD',
   147         'IE' => 'en_IE', 'IL' => 'he_IL', 'IM' => 'en_IM', 'IN' => 'hi_IN', 'IO' => 'und_IO',
   816         'BE' => 'nl_BE',
   148         'IQ' => 'ar_IQ', 'IR' => 'fa_IR', 'IS' => 'is_IS', 'IT' => 'it_IT', 'JE' => 'en_JE',
   817         'BF' => 'mos_BF',
   149         'JM' => 'en_JM', 'JO' => 'ar_JO', 'JP' => 'ja_JP', 'KE' => 'en_KE', 'KG' => 'ky_Cyrl_KG',
   818         'BG' => 'bg_BG',
   150         'KH' => 'km_KH', 'KI' => 'en_KI', 'KM' => 'ar_KM', 'KN' => 'en_KN', 'KP' => 'ko_KP',
   819         'BH' => 'ar_BH',
   151         'KR' => 'ko_KR', 'KW' => 'ar_KW', 'KY' => 'en_KY', 'KZ' => 'ru_KZ', 'LA' => 'lo_LA',
   820         'BI' => 'rn_BI',
   152         'LB' => 'ar_LB', 'LC' => 'en_LC', 'LI' => 'de_LI', 'LK' => 'si_LK', 'LR' => 'en_LR',
   821         'BJ' => 'fr_BJ',
   153         'LS' => 'st_LS', 'LT' => 'lt_LT', 'LU' => 'fr_LU', 'LV' => 'lv_LV', 'LY' => 'ar_LY',
   822         'BL' => 'fr_BL',
   154         'MA' => 'ar_MA', 'MC' => 'fr_MC', 'MD' => 'ro_MD', 'ME' => 'sr_Latn_ME', 'MF' => 'fr_MF',
   823         'BM' => 'en_BM',
   155         'MG' => 'mg_MG', 'MH' => 'mh_MH', 'MK' => 'mk_MK', 'ML' => 'bm_ML', 'MM' => 'my_MM',
   824         'BN' => 'ms_BN',
   156         'MN' => 'mn_Cyrl_MN', 'MO' => 'zh_Hant_MO', 'MP' => 'en_MP', 'MQ' => 'fr_MQ', 'MR' => 'ar_MR',
   825         'BO' => 'es_BO',
   157         'MS' => 'en_MS', 'MT' => 'mt_MT', 'MU' => 'mfe_MU', 'MV' => 'dv_MV', 'MW' => 'ny_MW',
   826         'BR' => 'pt_BR',
   158         'MX' => 'es_MX', 'MY' => 'ms_MY', 'MZ' => 'pt_MZ', 'NA' => 'kj_NA', 'NC' => 'fr_NC',
   827         'BS' => 'en_BS',
   159         'NE' => 'ha_Latn_NE', 'NF' => 'en_NF', 'NG' => 'en_NG', 'NI' => 'es_NI', 'NL' => 'nl_NL',
   828         'BT' => 'dz_BT',
   160         'NO' => 'nb_NO', 'NP' => 'ne_NP', 'NR' => 'en_NR', 'NU' => 'niu_NU', 'NZ' => 'en_NZ',
   829         'BV' => 'und_BV',
   161         'OM' => 'ar_OM', 'PA' => 'es_PA', 'PE' => 'es_PE', 'PF' => 'fr_PF', 'PG' => 'tpi_PG',
   830         'BW' => 'en_BW',
   162         'PH' => 'fil_PH', 'PK' => 'ur_PK', 'PL' => 'pl_PL', 'PM' => 'fr_PM', 'PN' => 'en_PN',
   831         'BY' => 'be_BY',
   163         'PR' => 'es_PR', 'PS' => 'ar_PS', 'PT' => 'pt_PT', 'PW' => 'pau_PW', 'PY' => 'gn_PY',
   832         'BZ' => 'en_BZ',
   164         'QA' => 'ar_QA', 'RE' => 'fr_RE', 'RO' => 'ro_RO', 'RS' => 'sr_Cyrl_RS', 'RU' => 'ru_RU',
   833         'CA' => 'en_CA',
   165         'RW' => 'rw_RW', 'SA' => 'ar_SA', 'SB' => 'en_SB', 'SC' => 'crs_SC', 'SD' => 'ar_SD',
   834         'CC' => 'ms_CC',
   166         'SE' => 'sv_SE', 'SG' => 'en_SG', 'SH' => 'en_SH', 'SI' => 'sl_SI', 'SJ' => 'nb_SJ',
   835         'CD' => 'sw_CD',
   167         'SK' => 'sk_SK', 'SL' => 'kri_SL', 'SM' => 'it_SM', 'SN' => 'fr_SN', 'SO' => 'sw_SO',
   836         'CF' => 'fr_CF',
   168         'SR' => 'srn_SR', 'ST' => 'pt_ST', 'SV' => 'es_SV', 'SY' => 'ar_SY', 'SZ' => 'en_SZ',
   837         'CG' => 'fr_CG',
   169         'TC' => 'en_TC', 'TD' => 'fr_TD', 'TF' => 'und_TF', 'TG' => 'fr_TG', 'TH' => 'th_TH',
   838         'CH' => 'de_CH',
   170         'TJ' => 'tg_Cyrl_TJ', 'TK' => 'tkl_TK', 'TL' => 'pt_TL', 'TM' => 'tk_TM', 'TN' => 'ar_TN',
   839         'CI' => 'fr_CI',
   171         'TO' => 'to_TO', 'TR' => 'tr_TR', 'TT' => 'en_TT', 'TV' => 'tvl_TV', 'TW' => 'zh_Hant_TW',
   840         'CK' => 'en_CK',
   172         'TZ' => 'sw_TZ', 'UA' => 'uk_UA', 'UG' => 'sw_UG', 'UM' => 'en_UM', 'US' => 'en_US',
   841         'CL' => 'es_CL',
   173         'UY' => 'es_UY', 'UZ' => 'uz_Cyrl_UZ', 'VA' => 'it_VA', 'VC' => 'en_VC', 'VE' => 'es_VE',
   842         'CM' => 'fr_CM',
   174         'VG' => 'en_VG', 'VI' => 'en_VI', 'VU' => 'bi_VU', 'WF' => 'wls_WF', 'WS' => 'sm_WS',
   843         'CN' => 'zh_Hans_CN',
   175         'YE' => 'ar_YE', 'YT' => 'swb_YT', 'ZA' => 'en_ZA', 'ZM' => 'en_ZM', 'ZW' => 'sn_ZW'
   844         'CO' => 'es_CO',
       
   845         'CR' => 'es_CR',
       
   846         'CU' => 'es_CU',
       
   847         'CV' => 'kea_CV',
       
   848         'CX' => 'en_CX',
       
   849         'CY' => 'el_CY',
       
   850         'CZ' => 'cs_CZ',
       
   851         'DE' => 'de_DE',
       
   852         'DJ' => 'aa_DJ',
       
   853         'DK' => 'da_DK',
       
   854         'DM' => 'en_DM',
       
   855         'DO' => 'es_DO',
       
   856         'DZ' => 'ar_DZ',
       
   857         'EC' => 'es_EC',
       
   858         'EE' => 'et_EE',
       
   859         'EG' => 'ar_EG',
       
   860         'EH' => 'ar_EH',
       
   861         'ER' => 'ti_ER',
       
   862         'ES' => 'es_ES',
       
   863         'ET' => 'en_ET',
       
   864         'FI' => 'fi_FI',
       
   865         'FJ' => 'hi_FJ',
       
   866         'FK' => 'en_FK',
       
   867         'FM' => 'chk_FM',
       
   868         'FO' => 'fo_FO',
       
   869         'FR' => 'fr_FR',
       
   870         'GA' => 'fr_GA',
       
   871         'GB' => 'en_GB',
       
   872         'GD' => 'en_GD',
       
   873         'GE' => 'ka_GE',
       
   874         'GF' => 'fr_GF',
       
   875         'GG' => 'en_GG',
       
   876         'GH' => 'ak_GH',
       
   877         'GI' => 'en_GI',
       
   878         'GL' => 'iu_GL',
       
   879         'GM' => 'en_GM',
       
   880         'GN' => 'fr_GN',
       
   881         'GP' => 'fr_GP',
       
   882         'GQ' => 'fan_GQ',
       
   883         'GR' => 'el_GR',
       
   884         'GS' => 'und_GS',
       
   885         'GT' => 'es_GT',
       
   886         'GU' => 'en_GU',
       
   887         'GW' => 'pt_GW',
       
   888         'GY' => 'en_GY',
       
   889         'HK' => 'zh_Hant_HK',
       
   890         'HM' => 'und_HM',
       
   891         'HN' => 'es_HN',
       
   892         'HR' => 'hr_HR',
       
   893         'HT' => 'ht_HT',
       
   894         'HU' => 'hu_HU',
       
   895         'ID' => 'id_ID',
       
   896         'IE' => 'en_IE',
       
   897         'IL' => 'he_IL',
       
   898         'IM' => 'en_IM',
       
   899         'IN' => 'hi_IN',
       
   900         'IO' => 'und_IO',
       
   901         'IQ' => 'ar_IQ',
       
   902         'IR' => 'fa_IR',
       
   903         'IS' => 'is_IS',
       
   904         'IT' => 'it_IT',
       
   905         'JE' => 'en_JE',
       
   906         'JM' => 'en_JM',
       
   907         'JO' => 'ar_JO',
       
   908         'JP' => 'ja_JP',
       
   909         'KE' => 'en_KE',
       
   910         'KG' => 'ky_Cyrl_KG',
       
   911         'KH' => 'km_KH',
       
   912         'KI' => 'en_KI',
       
   913         'KM' => 'ar_KM',
       
   914         'KN' => 'en_KN',
       
   915         'KP' => 'ko_KP',
       
   916         'KR' => 'ko_KR',
       
   917         'KW' => 'ar_KW',
       
   918         'KY' => 'en_KY',
       
   919         'KZ' => 'ru_KZ',
       
   920         'LA' => 'lo_LA',
       
   921         'LB' => 'ar_LB',
       
   922         'LC' => 'en_LC',
       
   923         'LI' => 'de_LI',
       
   924         'LK' => 'si_LK',
       
   925         'LR' => 'en_LR',
       
   926         'LS' => 'st_LS',
       
   927         'LT' => 'lt_LT',
       
   928         'LU' => 'fr_LU',
       
   929         'LV' => 'lv_LV',
       
   930         'LY' => 'ar_LY',
       
   931         'MA' => 'ar_MA',
       
   932         'MC' => 'fr_MC',
       
   933         'MD' => 'ro_MD',
       
   934         'ME' => 'sr_Latn_ME',
       
   935         'MF' => 'fr_MF',
       
   936         'MG' => 'mg_MG',
       
   937         'MH' => 'mh_MH',
       
   938         'MK' => 'mk_MK',
       
   939         'ML' => 'bm_ML',
       
   940         'MM' => 'my_MM',
       
   941         'MN' => 'mn_Cyrl_MN',
       
   942         'MO' => 'zh_Hant_MO',
       
   943         'MP' => 'en_MP',
       
   944         'MQ' => 'fr_MQ',
       
   945         'MR' => 'ar_MR',
       
   946         'MS' => 'en_MS',
       
   947         'MT' => 'mt_MT',
       
   948         'MU' => 'mfe_MU',
       
   949         'MV' => 'dv_MV',
       
   950         'MW' => 'ny_MW',
       
   951         'MX' => 'es_MX',
       
   952         'MY' => 'ms_MY',
       
   953         'MZ' => 'pt_MZ',
       
   954         'NA' => 'kj_NA',
       
   955         'NC' => 'fr_NC',
       
   956         'NE' => 'ha_Latn_NE',
       
   957         'NF' => 'en_NF',
       
   958         'NG' => 'en_NG',
       
   959         'NI' => 'es_NI',
       
   960         'NL' => 'nl_NL',
       
   961         'NO' => 'nb_NO',
       
   962         'NP' => 'ne_NP',
       
   963         'NR' => 'en_NR',
       
   964         'NU' => 'niu_NU',
       
   965         'NZ' => 'en_NZ',
       
   966         'OM' => 'ar_OM',
       
   967         'PA' => 'es_PA',
       
   968         'PE' => 'es_PE',
       
   969         'PF' => 'fr_PF',
       
   970         'PG' => 'tpi_PG',
       
   971         'PH' => 'fil_PH',
       
   972         'PK' => 'ur_PK',
       
   973         'PL' => 'pl_PL',
       
   974         'PM' => 'fr_PM',
       
   975         'PN' => 'en_PN',
       
   976         'PR' => 'es_PR',
       
   977         'PS' => 'ar_PS',
       
   978         'PT' => 'pt_PT',
       
   979         'PW' => 'pau_PW',
       
   980         'PY' => 'gn_PY',
       
   981         'QA' => 'ar_QA',
       
   982         'RE' => 'fr_RE',
       
   983         'RO' => 'ro_RO',
       
   984         'RS' => 'sr_Cyrl_RS',
       
   985         'RU' => 'ru_RU',
       
   986         'RW' => 'rw_RW',
       
   987         'SA' => 'ar_SA',
       
   988         'SB' => 'en_SB',
       
   989         'SC' => 'crs_SC',
       
   990         'SD' => 'ar_SD',
       
   991         'SE' => 'sv_SE',
       
   992         'SG' => 'en_SG',
       
   993         'SH' => 'en_SH',
       
   994         'SI' => 'sl_SI',
       
   995         'SJ' => 'nb_SJ',
       
   996         'SK' => 'sk_SK',
       
   997         'SL' => 'kri_SL',
       
   998         'SM' => 'it_SM',
       
   999         'SN' => 'fr_SN',
       
  1000         'SO' => 'sw_SO',
       
  1001         'SR' => 'srn_SR',
       
  1002         'ST' => 'pt_ST',
       
  1003         'SV' => 'es_SV',
       
  1004         'SY' => 'ar_SY',
       
  1005         'SZ' => 'en_SZ',
       
  1006         'TC' => 'en_TC',
       
  1007         'TD' => 'fr_TD',
       
  1008         'TF' => 'und_TF',
       
  1009         'TG' => 'fr_TG',
       
  1010         'TH' => 'th_TH',
       
  1011         'TJ' => 'tg_Cyrl_TJ',
       
  1012         'TK' => 'tkl_TK',
       
  1013         'TL' => 'pt_TL',
       
  1014         'TM' => 'tk_TM',
       
  1015         'TN' => 'ar_TN',
       
  1016         'TO' => 'to_TO',
       
  1017         'TR' => 'tr_TR',
       
  1018         'TT' => 'en_TT',
       
  1019         'TV' => 'tvl_TV',
       
  1020         'TW' => 'zh_Hant_TW',
       
  1021         'TZ' => 'sw_TZ',
       
  1022         'UA' => 'uk_UA',
       
  1023         'UG' => 'sw_UG',
       
  1024         'UM' => 'en_UM',
       
  1025         'US' => 'en_US',
       
  1026         'UY' => 'es_UY',
       
  1027         'UZ' => 'uz_Cyrl_UZ',
       
  1028         'VA' => 'it_VA',
       
  1029         'VC' => 'en_VC',
       
  1030         'VE' => 'es_VE',
       
  1031         'VG' => 'en_VG',
       
  1032         'VI' => 'en_VI',
       
  1033         'VN' => 'vi_VN',
       
  1034         'VU' => 'bi_VU',
       
  1035         'WF' => 'wls_WF',
       
  1036         'WS' => 'sm_WS',
       
  1037         'YE' => 'ar_YE',
       
  1038         'YT' => 'swb_YT',
       
  1039         'ZA' => 'en_ZA',
       
  1040         'ZM' => 'en_ZM',
       
  1041         'ZW' => 'sn_ZW'
   176     );
  1042     );
   177 
  1043 
   178     /**
  1044     /**
   179      * Autosearch constants
  1045      * Autosearch constants
   180      */
  1046      */
   484     public function setLocale($locale = null)
  1350     public function setLocale($locale = null)
   485     {
  1351     {
   486         $locale = self::_prepareLocale($locale);
  1352         $locale = self::_prepareLocale($locale);
   487 
  1353 
   488         if (isset(self::$_localeData[(string) $locale]) === false) {
  1354         if (isset(self::$_localeData[(string) $locale]) === false) {
       
  1355             // Is it an alias? If so, we can use this locale
       
  1356             if (isset(self::$_localeAliases[$locale]) === true) {
       
  1357                 $this->_locale = $locale;
       
  1358                 return;
       
  1359             }
       
  1360 
   489             $region = substr((string) $locale, 0, 3);
  1361             $region = substr((string) $locale, 0, 3);
   490             if (isset($region[2]) === true) {
  1362             if (isset($region[2]) === true) {
   491                 if (($region[2] === '_') or ($region[2] === '-')) {
  1363                 if (($region[2] === '_') or ($region[2] === '-')) {
   492                     $region = substr($region, 0, 2);
  1364                     $region = substr($region, 0, 2);
   493                 }
  1365                 }
   814             || (is_string($locale) && array_key_exists($locale, self::$_localeData))
  1686             || (is_string($locale) && array_key_exists($locale, self::$_localeData))
   815         ) {
  1687         ) {
   816             return true;
  1688             return true;
   817         }
  1689         }
   818 
  1690 
       
  1691         // Is it an alias?
       
  1692         if (is_string($locale) && array_key_exists($locale, self::$_localeAliases)) {
       
  1693             return true;
       
  1694         }
       
  1695 
   819         if (($locale === null) || (!is_string($locale) and !is_array($locale))) {
  1696         if (($locale === null) || (!is_string($locale) and !is_array($locale))) {
   820             return false;
  1697             return false;
   821         }
  1698         }
   822 
  1699 
   823         try {
  1700         try {
  1096                 break;
  1973                 break;
  1097         }
  1974         }
  1098 
  1975 
  1099         return $languages;
  1976         return $languages;
  1100     }
  1977     }
       
  1978 
       
  1979     /**
       
  1980      * Is the given locale in the list of aliases?
       
  1981      *
       
  1982      * @param  string|Zend_Locale $locale Locale to work on
       
  1983      * @return boolean
       
  1984      */
       
  1985     public static function isAlias($locale)
       
  1986     {
       
  1987         if ($locale instanceof Zend_Locale) {
       
  1988             $locale = $locale->toString();
       
  1989         }
       
  1990 
       
  1991         return isset(self::$_localeAliases[$locale]);
       
  1992     }
       
  1993 
       
  1994     /**
       
  1995      * Return an alias' actual locale.
       
  1996      *
       
  1997      * @param  string|Zend_Locale $locale Locale to work on
       
  1998      * @return string
       
  1999      */
       
  2000     public static function getAlias($locale)
       
  2001     {
       
  2002         if ($locale instanceof Zend_Locale) {
       
  2003             $locale = $locale->toString();
       
  2004         }
       
  2005 
       
  2006         if (isset(self::$_localeAliases[$locale]) === true) {
       
  2007             return self::$_localeAliases[$locale];
       
  2008         }
       
  2009 
       
  2010         return (string) $locale;
       
  2011     }
  1101 }
  2012 }