Lib_ZF_Locale - Version 1.0.18800

Version Notes

First stable release

Download this release

Release Info

Developer Magento Core Team
Extension Lib_ZF_Locale
Version 1.0.18800
Comparing to
See all releases


Version 1.0.18800

Files changed (449) hide show
  1. lib/Zend/Locale.php +837 -0
  2. lib/Zend/Locale/Data.php +1169 -0
  3. lib/Zend/Locale/Data/Translation.php +93 -0
  4. lib/Zend/Locale/Data/aa.xml +261 -0
  5. lib/Zend/Locale/Data/aa_DJ.xml +36 -0
  6. lib/Zend/Locale/Data/aa_ER.xml +21 -0
  7. lib/Zend/Locale/Data/aa_ER_SAAHO.xml +40 -0
  8. lib/Zend/Locale/Data/aa_ET.xml +11 -0
  9. lib/Zend/Locale/Data/af.xml +732 -0
  10. lib/Zend/Locale/Data/af_NA.xml +76 -0
  11. lib/Zend/Locale/Data/af_ZA.xml +11 -0
  12. lib/Zend/Locale/Data/ak.xml +195 -0
  13. lib/Zend/Locale/Data/ak_GH.xml +11 -0
  14. lib/Zend/Locale/Data/am.xml +1344 -0
  15. lib/Zend/Locale/Data/am_ET.xml +11 -0
  16. lib/Zend/Locale/Data/ar.xml +2944 -0
  17. lib/Zend/Locale/Data/ar_AE.xml +16 -0
  18. lib/Zend/Locale/Data/ar_BH.xml +16 -0
  19. lib/Zend/Locale/Data/ar_DZ.xml +21 -0
  20. lib/Zend/Locale/Data/ar_EG.xml +11 -0
  21. lib/Zend/Locale/Data/ar_IQ.xml +16 -0
  22. lib/Zend/Locale/Data/ar_JO.xml +67 -0
  23. lib/Zend/Locale/Data/ar_KW.xml +16 -0
  24. lib/Zend/Locale/Data/ar_LB.xml +72 -0
  25. lib/Zend/Locale/Data/ar_LY.xml +16 -0
  26. lib/Zend/Locale/Data/ar_MA.xml +21 -0
  27. lib/Zend/Locale/Data/ar_OM.xml +16 -0
  28. lib/Zend/Locale/Data/ar_QA.xml +51 -0
  29. lib/Zend/Locale/Data/ar_SA.xml +51 -0
  30. lib/Zend/Locale/Data/ar_SD.xml +16 -0
  31. lib/Zend/Locale/Data/ar_SY.xml +83 -0
  32. lib/Zend/Locale/Data/ar_TN.xml +55 -0
  33. lib/Zend/Locale/Data/ar_YE.xml +51 -0
  34. lib/Zend/Locale/Data/as.xml +237 -0
  35. lib/Zend/Locale/Data/as_IN.xml +11 -0
  36. lib/Zend/Locale/Data/az.xml +329 -0
  37. lib/Zend/Locale/Data/az_AZ.xml +11 -0
  38. lib/Zend/Locale/Data/az_Cyrl.xml +86 -0
  39. lib/Zend/Locale/Data/az_Cyrl_AZ.xml +12 -0
  40. lib/Zend/Locale/Data/az_Latn.xml +11 -0
  41. lib/Zend/Locale/Data/az_Latn_AZ.xml +12 -0
  42. lib/Zend/Locale/Data/be.xml +909 -0
  43. lib/Zend/Locale/Data/be_BY.xml +11 -0
  44. lib/Zend/Locale/Data/bg.xml +2987 -0
  45. lib/Zend/Locale/Data/bg_BG.xml +11 -0
  46. lib/Zend/Locale/Data/bn.xml +766 -0
  47. lib/Zend/Locale/Data/bn_BD.xml +11 -0
  48. lib/Zend/Locale/Data/bn_IN.xml +178 -0
  49. lib/Zend/Locale/Data/bo.xml +506 -0
  50. lib/Zend/Locale/Data/bo_CN.xml +10 -0
  51. lib/Zend/Locale/Data/bo_IN.xml +11 -0
  52. lib/Zend/Locale/Data/bs.xml +338 -0
  53. lib/Zend/Locale/Data/bs_BA.xml +11 -0
  54. lib/Zend/Locale/Data/byn.xml +509 -0
  55. lib/Zend/Locale/Data/byn_ER.xml +11 -0
  56. lib/Zend/Locale/Data/ca.xml +1012 -0
  57. lib/Zend/Locale/Data/ca_ES.xml +11 -0
  58. lib/Zend/Locale/Data/cch.xml +195 -0
  59. lib/Zend/Locale/Data/cch_NG.xml +11 -0
  60. lib/Zend/Locale/Data/cop.xml +203 -0
  61. lib/Zend/Locale/Data/cop_Arab.xml +23 -0
  62. lib/Zend/Locale/Data/cop_Arab_EG.xml +12 -0
  63. lib/Zend/Locale/Data/cop_Arab_US.xml +12 -0
  64. lib/Zend/Locale/Data/cop_EG.xml +11 -0
  65. lib/Zend/Locale/Data/cop_US.xml +11 -0
  66. lib/Zend/Locale/Data/cs.xml +2098 -0
  67. lib/Zend/Locale/Data/cs_CZ.xml +11 -0
  68. lib/Zend/Locale/Data/cy.xml +635 -0
  69. lib/Zend/Locale/Data/cy_GB.xml +11 -0
  70. lib/Zend/Locale/Data/da.xml +2313 -0
  71. lib/Zend/Locale/Data/da_DK.xml +11 -0
  72. lib/Zend/Locale/Data/de.xml +2370 -0
  73. lib/Zend/Locale/Data/de_AT.xml +48 -0
  74. lib/Zend/Locale/Data/de_BE.xml +73 -0
  75. lib/Zend/Locale/Data/de_CH.xml +55 -0
  76. lib/Zend/Locale/Data/de_DE.xml +11 -0
  77. lib/Zend/Locale/Data/de_LI.xml +24 -0
  78. lib/Zend/Locale/Data/de_LU.xml +20 -0
  79. lib/Zend/Locale/Data/dv.xml +228 -0
  80. lib/Zend/Locale/Data/dv_MV.xml +11 -0
  81. lib/Zend/Locale/Data/dz.xml +420 -0
  82. lib/Zend/Locale/Data/dz_BT.xml +11 -0
  83. lib/Zend/Locale/Data/ee.xml +199 -0
  84. lib/Zend/Locale/Data/ee_GH.xml +11 -0
  85. lib/Zend/Locale/Data/ee_TG.xml +11 -0
  86. lib/Zend/Locale/Data/el.xml +2535 -0
  87. lib/Zend/Locale/Data/el_CY.xml +20 -0
  88. lib/Zend/Locale/Data/el_GR.xml +11 -0
  89. lib/Zend/Locale/Data/el_POLYTON.xml +546 -0
  90. lib/Zend/Locale/Data/el_POLYTONI.xml +559 -0
  91. lib/Zend/Locale/Data/en.xml +3846 -0
  92. lib/Zend/Locale/Data/en_AS.xml +11 -0
  93. lib/Zend/Locale/Data/en_AU.xml +84 -0
  94. lib/Zend/Locale/Data/en_BE.xml +85 -0
  95. lib/Zend/Locale/Data/en_BW.xml +54 -0
  96. lib/Zend/Locale/Data/en_BZ.xml +76 -0
  97. lib/Zend/Locale/Data/en_CA.xml +49 -0
  98. lib/Zend/Locale/Data/en_GB.xml +98 -0
  99. lib/Zend/Locale/Data/en_GU.xml +11 -0
  100. lib/Zend/Locale/Data/en_HK.xml +58 -0
  101. lib/Zend/Locale/Data/en_IE.xml +87 -0
  102. lib/Zend/Locale/Data/en_IN.xml +69 -0
  103. lib/Zend/Locale/Data/en_JM.xml +20 -0
  104. lib/Zend/Locale/Data/en_MH.xml +11 -0
  105. lib/Zend/Locale/Data/en_MP.xml +11 -0
  106. lib/Zend/Locale/Data/en_MT.xml +81 -0
  107. lib/Zend/Locale/Data/en_NA.xml +20 -0
  108. lib/Zend/Locale/Data/en_NZ.xml +82 -0
  109. lib/Zend/Locale/Data/en_PH.xml +18 -0
  110. lib/Zend/Locale/Data/en_PK.xml +69 -0
  111. lib/Zend/Locale/Data/en_SG.xml +84 -0
  112. lib/Zend/Locale/Data/en_TT.xml +20 -0
  113. lib/Zend/Locale/Data/en_UM.xml +11 -0
  114. lib/Zend/Locale/Data/en_US.xml +11 -0
  115. lib/Zend/Locale/Data/en_US_POSIX.xml +45 -0
  116. lib/Zend/Locale/Data/en_VI.xml +11 -0
  117. lib/Zend/Locale/Data/en_ZA.xml +73 -0
  118. lib/Zend/Locale/Data/en_ZW.xml +73 -0
  119. lib/Zend/Locale/Data/eo.xml +565 -0
  120. lib/Zend/Locale/Data/es.xml +3160 -0
  121. lib/Zend/Locale/Data/es_AR.xml +37 -0
  122. lib/Zend/Locale/Data/es_BO.xml +11 -0
  123. lib/Zend/Locale/Data/es_CL.xml +94 -0
  124. lib/Zend/Locale/Data/es_CO.xml +59 -0
  125. lib/Zend/Locale/Data/es_CR.xml +11 -0
  126. lib/Zend/Locale/Data/es_DO.xml +17 -0
  127. lib/Zend/Locale/Data/es_EC.xml +53 -0
  128. lib/Zend/Locale/Data/es_ES.xml +106 -0
  129. lib/Zend/Locale/Data/es_GT.xml +35 -0
  130. lib/Zend/Locale/Data/es_HN.xml +35 -0
  131. lib/Zend/Locale/Data/es_MX.xml +22 -0
  132. lib/Zend/Locale/Data/es_NI.xml +17 -0
  133. lib/Zend/Locale/Data/es_PA.xml +40 -0
  134. lib/Zend/Locale/Data/es_PE.xml +36 -0
  135. lib/Zend/Locale/Data/es_PR.xml +45 -0
  136. lib/Zend/Locale/Data/es_PY.xml +20 -0
  137. lib/Zend/Locale/Data/es_SV.xml +17 -0
  138. lib/Zend/Locale/Data/es_US.xml +61 -0
  139. lib/Zend/Locale/Data/es_UY.xml +25 -0
  140. lib/Zend/Locale/Data/es_VE.xml +20 -0
  141. lib/Zend/Locale/Data/et.xml +1869 -0
  142. lib/Zend/Locale/Data/et_EE.xml +11 -0
  143. lib/Zend/Locale/Data/eu.xml +584 -0
  144. lib/Zend/Locale/Data/eu_ES.xml +11 -0
  145. lib/Zend/Locale/Data/fa.xml +1803 -0
  146. lib/Zend/Locale/Data/fa_AF.xml +279 -0
  147. lib/Zend/Locale/Data/fa_IR.xml +10 -0
  148. lib/Zend/Locale/Data/fi.xml +2995 -0
  149. lib/Zend/Locale/Data/fi_FI.xml +11 -0
  150. lib/Zend/Locale/Data/fil.xml +705 -0
  151. lib/Zend/Locale/Data/fo.xml +450 -0
  152. lib/Zend/Locale/Data/fo_FO.xml +11 -0
  153. lib/Zend/Locale/Data/fr.xml +3074 -0
  154. lib/Zend/Locale/Data/fr_BE.xml +36 -0
  155. lib/Zend/Locale/Data/fr_CA.xml +88 -0
  156. lib/Zend/Locale/Data/fr_CH.xml +59 -0
  157. lib/Zend/Locale/Data/fr_FR.xml +11 -0
  158. lib/Zend/Locale/Data/fr_LU.xml +23 -0
  159. lib/Zend/Locale/Data/fr_MC.xml +11 -0
  160. lib/Zend/Locale/Data/fur.xml +896 -0
  161. lib/Zend/Locale/Data/fur_IT.xml +11 -0
  162. lib/Zend/Locale/Data/ga.xml +1609 -0
  163. lib/Zend/Locale/Data/ga_IE.xml +11 -0
  164. lib/Zend/Locale/Data/gaa.xml +201 -0
  165. lib/Zend/Locale/Data/gaa_GH.xml +11 -0
  166. lib/Zend/Locale/Data/gez.xml +514 -0
  167. lib/Zend/Locale/Data/gez_ER.xml +11 -0
  168. lib/Zend/Locale/Data/gez_ET.xml +21 -0
  169. lib/Zend/Locale/Data/gl.xml +595 -0
  170. lib/Zend/Locale/Data/gl_ES.xml +11 -0
  171. lib/Zend/Locale/Data/gu.xml +352 -0
  172. lib/Zend/Locale/Data/gu_IN.xml +11 -0
  173. lib/Zend/Locale/Data/gv.xml +205 -0
  174. lib/Zend/Locale/Data/gv_GB.xml +11 -0
  175. lib/Zend/Locale/Data/ha.xml +310 -0
  176. lib/Zend/Locale/Data/ha_Arab.xml +93 -0
  177. lib/Zend/Locale/Data/ha_Arab_NG.xml +12 -0
  178. lib/Zend/Locale/Data/ha_GH.xml +12 -0
  179. lib/Zend/Locale/Data/ha_Latn.xml +11 -0
  180. lib/Zend/Locale/Data/ha_Latn_GH.xml +12 -0
  181. lib/Zend/Locale/Data/ha_Latn_NE.xml +12 -0
  182. lib/Zend/Locale/Data/ha_Latn_NG.xml +12 -0
  183. lib/Zend/Locale/Data/ha_NE.xml +12 -0
  184. lib/Zend/Locale/Data/ha_NG.xml +12 -0
  185. lib/Zend/Locale/Data/haw.xml +224 -0
  186. lib/Zend/Locale/Data/haw_US.xml +11 -0
  187. lib/Zend/Locale/Data/he.xml +2567 -0
  188. lib/Zend/Locale/Data/he_IL.xml +11 -0
  189. lib/Zend/Locale/Data/hi.xml +1637 -0
  190. lib/Zend/Locale/Data/hi_IN.xml +11 -0
  191. lib/Zend/Locale/Data/hr.xml +1652 -0
  192. lib/Zend/Locale/Data/hr_HR.xml +10 -0
  193. lib/Zend/Locale/Data/hu.xml +4359 -0
  194. lib/Zend/Locale/Data/hu_HU.xml +11 -0
  195. lib/Zend/Locale/Data/hy.xml +520 -0
  196. lib/Zend/Locale/Data/hy_AM.xml +11 -0
  197. lib/Zend/Locale/Data/hy_AM_REVISED.xml +40 -0
  198. lib/Zend/Locale/Data/ia.xml +559 -0
  199. lib/Zend/Locale/Data/id.xml +1317 -0
  200. lib/Zend/Locale/Data/id_ID.xml +11 -0
  201. lib/Zend/Locale/Data/ig.xml +194 -0
  202. lib/Zend/Locale/Data/ig_NG.xml +11 -0
  203. lib/Zend/Locale/Data/ii.xml +256 -0
  204. lib/Zend/Locale/Data/ii_CN.xml +11 -0
  205. lib/Zend/Locale/Data/is.xml +1898 -0
  206. lib/Zend/Locale/Data/is_IS.xml +11 -0
  207. lib/Zend/Locale/Data/it.xml +3224 -0
  208. lib/Zend/Locale/Data/it_CH.xml +76 -0
  209. lib/Zend/Locale/Data/it_IT.xml +11 -0
  210. lib/Zend/Locale/Data/iu.xml +188 -0
  211. lib/Zend/Locale/Data/ja.xml +3711 -0
  212. lib/Zend/Locale/Data/ja_JP.xml +11 -0
  213. lib/Zend/Locale/Data/ka.xml +1606 -0
  214. lib/Zend/Locale/Data/ka_GE.xml +11 -0
  215. lib/Zend/Locale/Data/kaj.xml +195 -0
  216. lib/Zend/Locale/Data/kaj_NG.xml +11 -0
  217. lib/Zend/Locale/Data/kam.xml +195 -0
  218. lib/Zend/Locale/Data/kam_KE.xml +11 -0
  219. lib/Zend/Locale/Data/kcg.xml +195 -0
  220. lib/Zend/Locale/Data/kcg_NG.xml +11 -0
  221. lib/Zend/Locale/Data/kfo.xml +195 -0
  222. lib/Zend/Locale/Data/kfo_NG.xml +11 -0
  223. lib/Zend/Locale/Data/kk.xml +328 -0
  224. lib/Zend/Locale/Data/kk_KZ.xml +11 -0
  225. lib/Zend/Locale/Data/kl.xml +213 -0
  226. lib/Zend/Locale/Data/kl_GL.xml +11 -0
  227. lib/Zend/Locale/Data/km.xml +587 -0
  228. lib/Zend/Locale/Data/km_KH.xml +11 -0
  229. lib/Zend/Locale/Data/kn.xml +348 -0
  230. lib/Zend/Locale/Data/kn_IN.xml +11 -0
  231. lib/Zend/Locale/Data/ko.xml +3003 -0
  232. lib/Zend/Locale/Data/ko_KR.xml +11 -0
  233. lib/Zend/Locale/Data/kok.xml +371 -0
  234. lib/Zend/Locale/Data/kok_IN.xml +11 -0
  235. lib/Zend/Locale/Data/kpe.xml +182 -0
  236. lib/Zend/Locale/Data/kpe_GN.xml +11 -0
  237. lib/Zend/Locale/Data/kpe_LR.xml +11 -0
  238. lib/Zend/Locale/Data/ku.xml +256 -0
  239. lib/Zend/Locale/Data/ku_Arab.xml +122 -0
  240. lib/Zend/Locale/Data/ku_IQ.xml +12 -0
  241. lib/Zend/Locale/Data/ku_IR.xml +12 -0
  242. lib/Zend/Locale/Data/ku_Latn.xml +11 -0
  243. lib/Zend/Locale/Data/ku_Latn_IQ.xml +12 -0
  244. lib/Zend/Locale/Data/ku_Latn_IR.xml +12 -0
  245. lib/Zend/Locale/Data/ku_Latn_SY.xml +12 -0
  246. lib/Zend/Locale/Data/ku_Latn_TR.xml +12 -0
  247. lib/Zend/Locale/Data/ku_SY.xml +12 -0
  248. lib/Zend/Locale/Data/ku_TR.xml +12 -0
  249. lib/Zend/Locale/Data/kw.xml +205 -0
  250. lib/Zend/Locale/Data/kw_GB.xml +11 -0
  251. lib/Zend/Locale/Data/ky.xml +282 -0
  252. lib/Zend/Locale/Data/ky_KG.xml +11 -0
  253. lib/Zend/Locale/Data/ln.xml +414 -0
  254. lib/Zend/Locale/Data/ln_CD.xml +11 -0
  255. lib/Zend/Locale/Data/ln_CG.xml +11 -0
  256. lib/Zend/Locale/Data/lo.xml +620 -0
  257. lib/Zend/Locale/Data/lo_LA.xml +11 -0
  258. lib/Zend/Locale/Data/lt.xml +1422 -0
  259. lib/Zend/Locale/Data/lt_LT.xml +11 -0
  260. lib/Zend/Locale/Data/lv.xml +1529 -0
  261. lib/Zend/Locale/Data/lv_LV.xml +11 -0
  262. lib/Zend/Locale/Data/mk.xml +1199 -0
  263. lib/Zend/Locale/Data/mk_MK.xml +11 -0
  264. lib/Zend/Locale/Data/ml.xml +770 -0
  265. lib/Zend/Locale/Data/ml_IN.xml +11 -0
  266. lib/Zend/Locale/Data/mn.xml +326 -0
  267. lib/Zend/Locale/Data/mn_MN.xml +11 -0
  268. lib/Zend/Locale/Data/mr.xml +391 -0
  269. lib/Zend/Locale/Data/mr_IN.xml +11 -0
  270. lib/Zend/Locale/Data/ms.xml +563 -0
  271. lib/Zend/Locale/Data/ms_BN.xml +69 -0
  272. lib/Zend/Locale/Data/ms_MY.xml +11 -0
  273. lib/Zend/Locale/Data/mt.xml +1077 -0
  274. lib/Zend/Locale/Data/mt_MT.xml +10 -0
  275. lib/Zend/Locale/Data/my.xml +182 -0
  276. lib/Zend/Locale/Data/my_MM.xml +10 -0
  277. lib/Zend/Locale/Data/nb.xml +2281 -0
  278. lib/Zend/Locale/Data/nb_NO.xml +10 -0
  279. lib/Zend/Locale/Data/ne.xml +302 -0
  280. lib/Zend/Locale/Data/ne_NP.xml +10 -0
  281. lib/Zend/Locale/Data/nl.xml +2534 -0
  282. lib/Zend/Locale/Data/nl_BE.xml +54 -0
  283. lib/Zend/Locale/Data/nl_NL.xml +10 -0
  284. lib/Zend/Locale/Data/nn.xml +1454 -0
  285. lib/Zend/Locale/Data/nn_NO.xml +10 -0
  286. lib/Zend/Locale/Data/nr.xml +204 -0
  287. lib/Zend/Locale/Data/nr_ZA.xml +10 -0
  288. lib/Zend/Locale/Data/nso.xml +205 -0
  289. lib/Zend/Locale/Data/nso_ZA.xml +10 -0
  290. lib/Zend/Locale/Data/ny.xml +195 -0
  291. lib/Zend/Locale/Data/ny_MW.xml +10 -0
  292. lib/Zend/Locale/Data/om.xml +336 -0
  293. lib/Zend/Locale/Data/om_ET.xml +10 -0
  294. lib/Zend/Locale/Data/om_KE.xml +17 -0
  295. lib/Zend/Locale/Data/or.xml +221 -0
  296. lib/Zend/Locale/Data/or_IN.xml +10 -0
  297. lib/Zend/Locale/Data/pa.xml +322 -0
  298. lib/Zend/Locale/Data/pa_Arab.xml +122 -0
  299. lib/Zend/Locale/Data/pa_Arab_PK.xml +11 -0
  300. lib/Zend/Locale/Data/pa_Guru.xml +10 -0
  301. lib/Zend/Locale/Data/pa_Guru_IN.xml +11 -0
  302. lib/Zend/Locale/Data/pa_IN.xml +11 -0
  303. lib/Zend/Locale/Data/pa_PK.xml +11 -0
  304. lib/Zend/Locale/Data/pl.xml +3008 -0
  305. lib/Zend/Locale/Data/pl_PL.xml +10 -0
  306. lib/Zend/Locale/Data/ps.xml +433 -0
  307. lib/Zend/Locale/Data/ps_AF.xml +10 -0
  308. lib/Zend/Locale/Data/pt.xml +3518 -0
  309. lib/Zend/Locale/Data/pt_BR.xml +10 -0
  310. lib/Zend/Locale/Data/pt_PT.xml +663 -0
  311. lib/Zend/Locale/Data/ro.xml +1700 -0
  312. lib/Zend/Locale/Data/ro_RO.xml +10 -0
  313. lib/Zend/Locale/Data/root.xml +1240 -0
  314. lib/Zend/Locale/Data/ru.xml +3458 -0
  315. lib/Zend/Locale/Data/ru_RU.xml +10 -0
  316. lib/Zend/Locale/Data/ru_UA.xml +84 -0
  317. lib/Zend/Locale/Data/rw.xml +312 -0
  318. lib/Zend/Locale/Data/rw_RW.xml +10 -0
  319. lib/Zend/Locale/Data/sa.xml +227 -0
  320. lib/Zend/Locale/Data/sa_IN.xml +10 -0
  321. lib/Zend/Locale/Data/se.xml +625 -0
  322. lib/Zend/Locale/Data/se_FI.xml +252 -0
  323. lib/Zend/Locale/Data/se_NO.xml +10 -0
  324. lib/Zend/Locale/Data/sh.xml +10 -0
  325. lib/Zend/Locale/Data/sh_BA.xml +11 -0
  326. lib/Zend/Locale/Data/sh_CS.xml +11 -0
  327. lib/Zend/Locale/Data/sh_YU.xml +11 -0
  328. lib/Zend/Locale/Data/sid.xml +257 -0
  329. lib/Zend/Locale/Data/sid_ET.xml +10 -0
  330. lib/Zend/Locale/Data/sk.xml +1593 -0
  331. lib/Zend/Locale/Data/sk_SK.xml +10 -0
  332. lib/Zend/Locale/Data/sl.xml +1231 -0
  333. lib/Zend/Locale/Data/sl_SI.xml +10 -0
  334. lib/Zend/Locale/Data/so.xml +491 -0
  335. lib/Zend/Locale/Data/so_DJ.xml +20 -0
  336. lib/Zend/Locale/Data/so_ET.xml +20 -0
  337. lib/Zend/Locale/Data/so_KE.xml +17 -0
  338. lib/Zend/Locale/Data/so_SO.xml +10 -0
  339. lib/Zend/Locale/Data/sq.xml +518 -0
  340. lib/Zend/Locale/Data/sq_AL.xml +10 -0
  341. lib/Zend/Locale/Data/sr.xml +1798 -0
  342. lib/Zend/Locale/Data/sr_BA.xml +11 -0
  343. lib/Zend/Locale/Data/sr_CS.xml +11 -0
  344. lib/Zend/Locale/Data/sr_Cyrl.xml +11 -0
  345. lib/Zend/Locale/Data/sr_Cyrl_BA.xml +77 -0
  346. lib/Zend/Locale/Data/sr_Cyrl_CS.xml +12 -0
  347. lib/Zend/Locale/Data/sr_Cyrl_ME.xml +11 -0
  348. lib/Zend/Locale/Data/sr_Cyrl_RS.xml +11 -0
  349. lib/Zend/Locale/Data/sr_Cyrl_YU.xml +12 -0
  350. lib/Zend/Locale/Data/sr_Latn.xml +1703 -0
  351. lib/Zend/Locale/Data/sr_Latn_BA.xml +11 -0
  352. lib/Zend/Locale/Data/sr_Latn_CS.xml +12 -0
  353. lib/Zend/Locale/Data/sr_Latn_ME.xml +41 -0
  354. lib/Zend/Locale/Data/sr_Latn_RS.xml +41 -0
  355. lib/Zend/Locale/Data/sr_Latn_YU.xml +12 -0
  356. lib/Zend/Locale/Data/sr_ME.xml +11 -0
  357. lib/Zend/Locale/Data/sr_RS.xml +11 -0
  358. lib/Zend/Locale/Data/sr_YU.xml +11 -0
  359. lib/Zend/Locale/Data/ss.xml +204 -0
  360. lib/Zend/Locale/Data/ss_ZA.xml +10 -0
  361. lib/Zend/Locale/Data/ssy.xml +38 -0
  362. lib/Zend/Locale/Data/st.xml +296 -0
  363. lib/Zend/Locale/Data/st_ZA.xml +10 -0
  364. lib/Zend/Locale/Data/supplementalData.xml +4638 -0
  365. lib/Zend/Locale/Data/sv.xml +3004 -0
  366. lib/Zend/Locale/Data/sv_FI.xml +120 -0
  367. lib/Zend/Locale/Data/sv_SE.xml +10 -0
  368. lib/Zend/Locale/Data/sw.xml +409 -0
  369. lib/Zend/Locale/Data/sw_KE.xml +19 -0
  370. lib/Zend/Locale/Data/sw_TZ.xml +10 -0
  371. lib/Zend/Locale/Data/syr.xml +218 -0
  372. lib/Zend/Locale/Data/syr_SY.xml +10 -0
  373. lib/Zend/Locale/Data/ta.xml +556 -0
  374. lib/Zend/Locale/Data/ta_IN.xml +10 -0
  375. lib/Zend/Locale/Data/te.xml +336 -0
  376. lib/Zend/Locale/Data/te_IN.xml +10 -0
  377. lib/Zend/Locale/Data/tg.xml +269 -0
  378. lib/Zend/Locale/Data/tg_TJ.xml +10 -0
  379. lib/Zend/Locale/Data/th.xml +3663 -0
  380. lib/Zend/Locale/Data/th_TH.xml +10 -0
  381. lib/Zend/Locale/Data/ti.xml +332 -0
  382. lib/Zend/Locale/Data/ti_ER.xml +81 -0
  383. lib/Zend/Locale/Data/ti_ET.xml +10 -0
  384. lib/Zend/Locale/Data/tig.xml +510 -0
  385. lib/Zend/Locale/Data/tig_ER.xml +10 -0
  386. lib/Zend/Locale/Data/tn.xml +284 -0
  387. lib/Zend/Locale/Data/tn_ZA.xml +10 -0
  388. lib/Zend/Locale/Data/to.xml +473 -0
  389. lib/Zend/Locale/Data/to_TO.xml +10 -0
  390. lib/Zend/Locale/Data/tr.xml +4214 -0
  391. lib/Zend/Locale/Data/tr_TR.xml +10 -0
  392. lib/Zend/Locale/Data/ts.xml +228 -0
  393. lib/Zend/Locale/Data/ts_ZA.xml +10 -0
  394. lib/Zend/Locale/Data/tt.xml +215 -0
  395. lib/Zend/Locale/Data/tt_RU.xml +10 -0
  396. lib/Zend/Locale/Data/ug.xml +187 -0
  397. lib/Zend/Locale/Data/uk.xml +3502 -0
  398. lib/Zend/Locale/Data/uk_UA.xml +10 -0
  399. lib/Zend/Locale/Data/und.xml +9 -0
  400. lib/Zend/Locale/Data/und_ZZ.xml +10 -0
  401. lib/Zend/Locale/Data/ur.xml +805 -0
  402. lib/Zend/Locale/Data/ur_IN.xml +10 -0
  403. lib/Zend/Locale/Data/ur_PK.xml +10 -0
  404. lib/Zend/Locale/Data/uz.xml +268 -0
  405. lib/Zend/Locale/Data/uz_AF.xml +11 -0
  406. lib/Zend/Locale/Data/uz_Arab.xml +163 -0
  407. lib/Zend/Locale/Data/uz_Arab_AF.xml +11 -0
  408. lib/Zend/Locale/Data/uz_Cyrl.xml +10 -0
  409. lib/Zend/Locale/Data/uz_Cyrl_UZ.xml +11 -0
  410. lib/Zend/Locale/Data/uz_Latn.xml +169 -0
  411. lib/Zend/Locale/Data/uz_Latn_UZ.xml +11 -0
  412. lib/Zend/Locale/Data/uz_UZ.xml +11 -0
  413. lib/Zend/Locale/Data/ve.xml +205 -0
  414. lib/Zend/Locale/Data/ve_ZA.xml +10 -0
  415. lib/Zend/Locale/Data/vi.xml +880 -0
  416. lib/Zend/Locale/Data/vi_VN.xml +10 -0
  417. lib/Zend/Locale/Data/wal.xml +381 -0
  418. lib/Zend/Locale/Data/wal_ET.xml +10 -0
  419. lib/Zend/Locale/Data/wo.xml +199 -0
  420. lib/Zend/Locale/Data/wo_Arab.xml +10 -0
  421. lib/Zend/Locale/Data/wo_Arab_SN.xml +11 -0
  422. lib/Zend/Locale/Data/wo_Latn.xml +10 -0
  423. lib/Zend/Locale/Data/wo_Latn_SN.xml +11 -0
  424. lib/Zend/Locale/Data/wo_SN.xml +10 -0
  425. lib/Zend/Locale/Data/xh.xml +317 -0
  426. lib/Zend/Locale/Data/xh_ZA.xml +10 -0
  427. lib/Zend/Locale/Data/yo.xml +305 -0
  428. lib/Zend/Locale/Data/yo_NG.xml +10 -0
  429. lib/Zend/Locale/Data/zh.xml +4516 -0
  430. lib/Zend/Locale/Data/zh_CN.xml +11 -0
  431. lib/Zend/Locale/Data/zh_HK.xml +11 -0
  432. lib/Zend/Locale/Data/zh_Hans.xml +11 -0
  433. lib/Zend/Locale/Data/zh_Hans_CN.xml +11 -0
  434. lib/Zend/Locale/Data/zh_Hans_SG.xml +48 -0
  435. lib/Zend/Locale/Data/zh_Hant.xml +3667 -0
  436. lib/Zend/Locale/Data/zh_Hant_HK.xml +66 -0
  437. lib/Zend/Locale/Data/zh_Hant_MO.xml +71 -0
  438. lib/Zend/Locale/Data/zh_Hant_TW.xml +11 -0
  439. lib/Zend/Locale/Data/zh_MO.xml +11 -0
  440. lib/Zend/Locale/Data/zh_SG.xml +11 -0
  441. lib/Zend/Locale/Data/zh_TW.xml +11 -0
  442. lib/Zend/Locale/Data/zu.xml +311 -0
  443. lib/Zend/Locale/Data/zu_ZA.xml +10 -0
  444. lib/Zend/Locale/Exception.php +37 -0
  445. lib/Zend/Locale/Format.php +1080 -0
  446. lib/Zend/Locale/Math.php +154 -0
  447. lib/Zend/Locale/Math/Exception.php +53 -0
  448. lib/Zend/Locale/Math/PhpMath.php +247 -0
  449. package.xml +19 -0
lib/Zend/Locale.php ADDED
@@ -0,0 +1,837 @@
1
+ <?php
2
+ /**
3
+ * Zend Framework
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the new BSD license that is bundled
8
+ * with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://framework.zend.com/license/new-bsd
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@zend.com so we can send you a copy immediately.
14
+ *
15
+ * @category Zend
16
+ * @package Zend_Locale
17
+ * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
18
+ * @version $Id: Locale.php 8855 2008-03-16 11:15:58Z thomas $
19
+ * @license http://framework.zend.com/license/new-bsd New BSD License
20
+ */
21
+
22
+
23
+ /**
24
+ * @category Zend
25
+ * @package Zend_Locale
26
+ * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
27
+ * @license http://framework.zend.com/license/new-bsd New BSD License
28
+ */
29
+ class Zend_Locale {
30
+
31
+ // Class wide Locale Constants
32
+ private static $_localeData = array(
33
+ 'root' => true, 'aa_DJ' => true, 'aa_ER' => true, 'aa_ET' => true, 'aa' => true, 'af_NA' => true, 'af_ZA' => true, 'af' => true, 'ak_GH' => true, 'ak' => true,
34
+ 'am_ET' => true, 'am' => true, 'ar_AE' => true, 'ar_BH' => true, 'ar_DZ' => true, 'ar_EG' => true, 'ar_IQ' => true, 'ar_JO' => true, 'ar_KW' => true, 'ar_LB' => true,
35
+ 'ar_LY' => true, 'ar_MA' => true, 'ar_OM' => true, 'ar_QA' => true, 'ar_SA' => true, 'ar_SD' => true, 'ar_SY' => true, 'ar_TN' => true, 'ar_YE' => true, 'ar' => true,
36
+ 'as_IN' => true, 'as' => true, 'az_AZ' => true, 'az' => true, 'be_BY' => true, 'be' => true, 'bg_BG' => true, 'bg' => true, 'bn_BD' => true, 'bn_IN' => true,
37
+ 'bn' => true, 'bo_CN' => true, 'bo_IN' => true, 'bo' => true, 'bs_BA' => true, 'bs' => true, 'byn_ER'=> true, 'byn' => true, 'ca_ES' => true, 'ca' => true,
38
+ 'cch_NG'=> true, 'cch' => true, 'cop_EG'=> true, 'cop_US'=> true, 'cop' => true, 'cs_CZ' => true, 'cs' => true, 'cy_GB' => true, 'cy' => true, 'da_DK' => true,
39
+ 'da' => true, 'de_AT' => true, 'de_BE' => true, 'de_CH' => true, 'de_DE' => true, 'de_LI' => true, 'de_LU' => true, 'de' => true, 'dv_MV' => true, 'dv' => true,
40
+ 'dz_BT' => true, 'dz' => true, 'ee_GH' => true, 'ee_TG' => true, 'ee' => true, 'el_CY' => true, 'el_GR' => true, 'el' => true, 'en_AS' => true, 'en_AU' => true,
41
+ 'en_BE' => true, 'en_BW' => true, 'en_BZ' => true, 'en_CA' => true, 'en_GB' => true, 'en_GU' => true, 'en_HK' => true, 'en_IE' => true, 'en_IN' => true, 'en_JM' => true,
42
+ 'en_MH' => true, 'en_MP' => true, 'en_MT' => true, 'en_NZ' => true, 'en_PH' => true, 'en_PK' => true, 'en_SG' => true, 'en_TT' => true, 'en_UM' => true, 'en_US' => true,
43
+ 'en_VI' => true, 'en_ZA' => true, 'en_ZW' => true, 'en' => true, 'eo' => true, 'es_AR' => true, 'es_BO' => true, 'es_CL' => true, 'es_CO' => true, 'es_CR' => true,
44
+ 'es_DO' => true, 'es_EC' => true, 'es_ES' => true, 'es_GT' => true, 'es_HN' => true, 'es_MX' => true, 'es_NI' => true, 'es_PA' => true, 'es_PE' => true, 'es_PR' => true,
45
+ 'es_PY' => true, 'es_SV' => true, 'es_US' => true, 'es_UY' => true, 'es_VE' => true, 'es' => true, 'et_EE' => true, 'et' => true, 'eu_ES' => true, 'eu' => true,
46
+ 'fa_AF' => true, 'fa_IR' => true, 'fa' => true, 'fi_FI' => true, 'fi' => true, 'fil' => true, 'fo_FO' => true, 'fo' => true, 'fr_BE' => true, 'fr_CA' => true,
47
+ 'fr_CH' => true, 'fr_FR' => true, 'fr_LU' => true, 'fr_MC' => true, 'fr' => true, 'fur_IT'=> true, 'fur' => true, 'ga_IE' => true, 'ga' => true, 'gaa_GH'=> true,
48
+ 'gaa' => true, 'gez_ER'=> true, 'gez_ET'=> true, 'gez' => true, 'gl_ES' => true, 'gl' => true, 'gu_IN' => true, 'gu' => true, 'gv_GB' => true, 'gv' => true,
49
+ 'ha_GH' => true, 'ha_NE' => true, 'ha_NG' => true, 'ha' => true, 'haw_US'=> true, 'haw' => true, 'he_IL' => true, 'he' => true, 'hi_IN' => true, 'hi' => true,
50
+ 'hr_HR' => true, 'hr' => true, 'hu_HU' => true, 'hu' => true, 'hy_AM' => true, 'hy' => true, 'ia' => true, 'id_ID' => true, 'id' => true, 'ig_NG' => true,
51
+ 'ig' => true, 'ii_CN' => true, 'ii' => true, 'is_IS' => true, 'is' => true, 'it_CH' => true, 'it_IT' => true, 'it' => true, 'iu' => true, 'ja_JP' => true,
52
+ 'ja' => true, 'ka_GE' => true, 'ka' => true, 'kaj_NG'=> true, 'kaj' => true, 'kam_KE'=> true, 'kam' => true, 'kcg_NG'=> true, 'kcg' => true, 'kfo_NG'=> true,
53
+ 'kfo' => true, 'kk_KZ' => true, 'kk' => true, 'kl_GL' => true, 'kl' => true, 'km_KH' => true, 'km' => true, 'kn_IN' => true, 'kn' => true, 'ko_KR' => true,
54
+ 'ko' => true, 'kok_IN'=> true, 'kok' => true, 'kpe_GN'=> true, 'kpe_LR'=> true, 'kpe' => true, 'ku_IQ' => true, 'ku_IR' => true, 'ku_SY' => true, 'ku_TR' => true,
55
+ 'ku' => true, 'kw_GB' => true, 'kw' => true, 'ky_KG' => true, 'ky' => true, 'ln_CD' => true, 'ln_CG' => true, 'ln' => true, 'lo_LA' => true, 'lo' => true,
56
+ 'lt_LT' => true, 'lt' => true, 'lv_LV' => true, 'lv' => true, 'mk_MK' => true, 'mk' => true, 'ml_IN' => true, 'ml' => true, 'mn_MN' => true, 'mn' => true,
57
+ 'mr_IN' => true, 'mr' => true, 'ms_BN' => true, 'ms_MY' => true, 'ms' => true, 'mt_MT' => true, 'mt' => true, 'my_MM' => true, 'my' => true, 'nb_NO' => true,
58
+ 'nb' => true, 'ne_NP' => true, 'ne' => true, 'nl_BE' => true, 'nl_NL' => true, 'nl' => true, 'nn_NO' => true, 'nn' => true, 'nr_ZA' => true, 'nr' => true,
59
+ 'nso_ZA'=> true, 'nso' => true, 'ny_MW' => true, 'ny' => true, 'om_ET' => true, 'om_KE' => true, 'om' => true, 'or_IN' => true, 'or' => true, 'pa_IN' => true,
60
+ 'pa_PK' => true, 'pa' => true, 'pl_PL' => true, 'pl' => true, 'ps_AF' => true, 'ps' => true, 'pt_BR' => true, 'pt_PT' => true, 'pt' => true, 'ro_RO' => true,
61
+ 'ro' => true, 'ru_RU' => true, 'ru_UA' => true, 'ru' => true, 'rw_RW' => true, 'rw' => true, 'sa_IN' => true, 'sa' => true, 'se_FI' => true, 'se_NO' => true,
62
+ 'se' => true, 'sh_BA' => true, 'sh_CS' => true, 'sh_YU' => true, 'sh' => true, 'sid_ET'=> true, 'sid' => true, 'sk_SK' => true, 'sk' => true, 'sl_SI' => true,
63
+ 'sl' => true, 'so_DJ' => true, 'so_ET' => true, 'so_KE' => true, 'so_SO' => true, 'so' => true, 'sq_AL' => true, 'sq' => true, 'sr_BA' => true, 'sr_CS' => true,
64
+ 'sr_ME' => true, 'sr_RS' => true, 'sr_YU' => true, 'sr' => true, 'ss_ZA' => true, 'ss' => true, 'ssy' => true, 'st_ZA' => true, 'st' => true, 'sv_FI' => true,
65
+ 'sv_SE' => true, 'sv' => true, 'sw_KE' => true, 'sw_TZ' => true, 'sw' => true, 'syr_SY'=> true, 'syr' => true, 'ta_IN' => true, 'ta' => true, 'te_IN' => true,
66
+ 'te' => true, 'tg_TJ' => true, 'tg' => true, 'th_TH' => true, 'th' => true, 'ti_ER' => true, 'ti_ET' => true, 'ti' => true, 'tig_ER'=> true, 'tig' => true,
67
+ 'tn_ZA' => true, 'tn' => true, 'to_TO' => true, 'to' => true, 'tr_TR' => true, 'tr' => true, 'ts_ZA' => true, 'ts' => true, 'tt_RU' => true, 'tt' => true,
68
+ 'ug' => true, 'uk_UA' => true, 'uk' => true, 'und_ZZ'=> true, 'und' => true, 'ur_IN' => true, 'ur_PK' => true, 'ur' => true, 'uz_AF' => true, 'uz_UZ' => true,
69
+ 'uz' => true, 've_ZA' => true, 've' => true, 'vi_VN' => true, 'vi' => true, 'wal_ET'=> true, 'wal' => true, 'wo_SN' => true, 'wo' => true, 'xh_ZA' => true,
70
+ 'xh' => true, 'yo_NG' => true, 'yo' => true, 'zh_CN' => true, 'zh_HK' => true, 'zh_MO' => true, 'zh_SG' => true, 'zh_TW' => true, 'zh' => true, 'zu_ZA' => true,
71
+ 'zu' => true,
72
+ 'auto' => false, 'browser' => false, 'environment' => false
73
+ );
74
+
75
+
76
+ /**
77
+ * Autosearch constants
78
+ */
79
+ const BROWSER = 1;
80
+ const ENVIRONMENT = 2;
81
+ const FRAMEWORK = 3;
82
+
83
+
84
+ /**
85
+ * Actual set locale
86
+ */
87
+ private $_Locale;
88
+
89
+
90
+ /**
91
+ * Actual set Codeset
92
+ */
93
+ private $_Codeset;
94
+
95
+ /**
96
+ * Automatic detected locale
97
+ */
98
+ private static $_auto;
99
+ private static $_browser;
100
+ private static $_environment;
101
+
102
+ private static $_Default = "en";
103
+
104
+ /**
105
+ * Generates a locale object
106
+ * If no locale is given a automatic search is done
107
+ * Then the most probable locale will be automatically set
108
+ * Search order is
109
+ * 1. Given Locale
110
+ * 2. HTTP Client
111
+ * 3. Server Environment
112
+ * 4. Framework Standard
113
+ *
114
+ * @param string $locale OPTIONAL locale for parsing input
115
+ * @throws Zend_Locale_Exception
116
+ */
117
+ public function __construct($locale = null)
118
+ {
119
+ if (empty(self::$_auto)) {
120
+ self::$_auto = $this->getDefault(null, false);
121
+ self::$_browser = $this->getDefault(self::BROWSER, false);
122
+ self::$_environment = $this->getDefault(self::ENVIRONMENT, false);
123
+ if (empty($locale) and empty(self::$_auto) and empty(self::$_Default)) {
124
+ require_once 'Zend/Locale/Exception.php';
125
+ throw new Zend_Locale_Exception('Autodetection of Locale has been failed!');
126
+ }
127
+ }
128
+
129
+ if ($locale instanceof Zend_Locale) {
130
+ $locale = $locale->toString();
131
+ }
132
+ $this->setLocale($locale);
133
+ }
134
+
135
+
136
+ /**
137
+ * Serialization Interface
138
+ *
139
+ * @return string
140
+ */
141
+ public function serialize()
142
+ {
143
+ return serialize($this);
144
+ }
145
+
146
+
147
+ /**
148
+ * Returns a string representation of the object
149
+ *
150
+ * @return string
151
+ */
152
+ public function toString()
153
+ {
154
+ return (string) $this->_Locale;
155
+ }
156
+
157
+
158
+ /**
159
+ * Returns a string representation of the object
160
+ * Alias for toString
161
+ *
162
+ * @return string
163
+ */
164
+ public function __toString()
165
+ {
166
+ return $this->toString();
167
+ }
168
+
169
+
170
+ /**
171
+ * Search the locale automatically and return all used locales
172
+ * ordered by quality
173
+ *
174
+ * Standard Searchorder is
175
+ * - getBrowser
176
+ * - getEnvironment
177
+ * - getFramework
178
+ *
179
+ * @param $searchorder - OPTIONAL searchorder
180
+ * @param $fastsearch - OPTIONAL returnes the first found locale array when true
181
+ * otherwise all found default locales will be returned
182
+ * @return locale - returns an array of all the mosta locale string
183
+ */
184
+ public function getDefault($searchorder = null, $fastsearch = null)
185
+ {
186
+ $languages = array();
187
+ if ($searchorder == self::ENVIRONMENT) {
188
+
189
+ $languages = $this->getEnvironment();
190
+ if (empty($languages) or !$fastsearch) {
191
+ $languages = array_merge($languages, $this->getFramework());
192
+ }
193
+ if (empty($languages) or !$fastsearch) {
194
+ $languages = array_merge($languages, $this->getBrowser());
195
+ }
196
+
197
+ } else if ($searchorder == self::FRAMEWORK) {
198
+
199
+ $languages = $this->getFramework();
200
+ if (empty($languages) or !$fastsearch) {
201
+ $languages = array_merge($languages, $this->getEnvironment());
202
+ }
203
+ if (empty($languages) or !$fastsearch) {
204
+ $languages = array_merge($languages, $this->getBrowser());
205
+ }
206
+
207
+ } else {
208
+
209
+ $languages = $this->getBrowser();
210
+ if (empty($languages) or !$fastsearch) {
211
+ $languages = array_merge($languages, $this->getEnvironment());
212
+ }
213
+ if (empty($languages) or !$fastsearch) {
214
+ $languages = array_merge($languages, $this->getFramework());
215
+ }
216
+
217
+ }
218
+
219
+ if (!array_key_exists(self::$_Default, $languages)) {
220
+ $languages[self::$_Default] = 0.1;
221
+ }
222
+ return $languages;
223
+ }
224
+
225
+
226
+ /**
227
+ * Sets a new default locale
228
+ *
229
+ * @param String $locale
230
+ * @return boolean
231
+ * @throws Zend_Locale_Exception
232
+ */
233
+ public static function setDefault($locale)
234
+ {
235
+ if (($locale == "auto") or ($locale == "root") or
236
+ ($locale == "environment") or ($locale == "browser")) {
237
+ require_once 'Zend/Locale/Exception.php';
238
+ throw new Zend_Locale_Exception('Only full qualified locales can be used as default!');
239
+ }
240
+ if (array_key_exists($locale, self::$_localeData)) {
241
+ self::$_Default = $locale;
242
+ return true;
243
+ } else {
244
+ $locale = explode('_', $locale);
245
+ if (array_key_exists($locale[0], self::$_localeData)) {
246
+ self::$_Default = $locale[0];
247
+ return true;
248
+ }
249
+ }
250
+ require_once 'Zend/Locale/Exception.php';
251
+ throw new Zend_Locale_Exception("Unknown locale '$locale' can not be set as default!");
252
+ }
253
+
254
+
255
+ /**
256
+ * Expects the Systems standard locale
257
+ *
258
+ * For Windows:
259
+ * f.e.: LC_COLLATE=C;LC_CTYPE=German_Austria.1252;LC_MONETARY=C
260
+ * would be recognised as de_AT
261
+ *
262
+ * @return array
263
+ */
264
+ public function getEnvironment()
265
+ {
266
+ require_once 'Zend/Locale/Data/Translation.php';
267
+
268
+ $language = setlocale(LC_ALL, 0);
269
+ $languages = explode(';', $language);
270
+
271
+ $languagearray = array();
272
+
273
+ foreach ($languages as $locale) {
274
+
275
+ if (strpos($locale, '=') !== false) {
276
+ $language = substr($locale, strpos($locale, '='));
277
+ $language = substr($language, 1);
278
+ }
279
+
280
+ if ($language != 'C') {
281
+ if (strpos($language, '.') !== false) {
282
+ $language = substr($language, 0, strpos($language, '.') - 1);
283
+ } else if (strpos($language, '@') !== false) {
284
+ $language = substr($language, 0, strpos($language, '@') - 1);
285
+ }
286
+ $splitted = explode('_', $language);
287
+ if (array_key_exists((string) $language, self::$_localeData)) {
288
+ $languagearray[$language] = 1;
289
+ if (strlen($language) > 4) {
290
+ $languagearray[substr($language, 0, 2)] = 1;
291
+ }
292
+ continue;
293
+ }
294
+
295
+ if (!empty(Zend_Locale_Data_Translation::$localeTranslation[$splitted[0]])) {
296
+ if (!empty(Zend_Locale_Data_Translation::$localeTranslation[$splitted[1]])) {
297
+ $languagearray[Zend_Locale_Data_Translation::$localeTranslation[$splitted[0]] . '_'
298
+ . Zend_Locale_Data_Translation::$localeTranslation[$splitted[1]]] = 1;
299
+ }
300
+ $languagearray[Zend_Locale_Data_Translation::$localeTranslation[$splitted[0]]] = 1;
301
+ }
302
+ }
303
+ }
304
+ return $languagearray;
305
+ }
306
+
307
+ /**
308
+ * Return an array of all accepted languages of the client
309
+ * Expects RFC compilant Header !!
310
+ *
311
+ * The notation can be :
312
+ * de,en-UK-US;q=0.5,fr-FR;q=0.2
313
+ *
314
+ * @return array - list of accepted languages including quality
315
+ */
316
+ public function getBrowser()
317
+ {
318
+ $httplanguages = getenv("HTTP_ACCEPT_LANGUAGE");
319
+
320
+ $languages = array();
321
+ if (empty($httplanguages)) {
322
+ return $languages;
323
+ }
324
+
325
+ $accepted = preg_split('/,\s*/', $httplanguages);
326
+
327
+ foreach ($accepted as $accept) {
328
+ $result = preg_match('/^([a-z]{1,8}(?:[-_][a-z]{1,8})*)(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?#x2F;i',
329
+ $accept, $match);
330
+
331
+ if (!$result) {
332
+ continue;
333
+ }
334
+
335
+ if (isset($match[2])) {
336
+ $quality = (float) $match[2];
337
+ } else {
338
+ $quality = 1.0;
339
+ }
340
+
341
+ $countrys = explode('-', $match[1]);
342
+ $region = array_shift($countrys);
343
+
344
+ $country2 = explode('_', $region);
345
+ $region = array_shift($country2);
346
+
347
+ foreach($countrys as $country) {
348
+ $languages[$region . '_' . strtoupper($country)] = $quality;
349
+ }
350
+ foreach($country2 as $country) {
351
+ $languages[$region . '_' . strtoupper($country)] = $quality;
352
+ }
353
+ if (!isset($languages[$region]) || ($languages[$region] < $quality)) {
354
+ $languages[$region] = $quality;
355
+ }
356
+ }
357
+ return $languages;
358
+ }
359
+
360
+
361
+ /**
362
+ * Returns the locale which the framework is set to
363
+ *
364
+ * @return array
365
+ */
366
+ public function getFramework()
367
+ {
368
+ $languages = array();
369
+ return $languages;
370
+ }
371
+
372
+
373
+ /**
374
+ * Sets a new locale
375
+ *
376
+ * @param mixed $locale OPTIONAL new locale to set
377
+ */
378
+ public function setLocale($locale = null)
379
+ {
380
+ if (($locale == self::BROWSER) or ($locale == self::ENVIRONMENT) or ($locale === null)) {
381
+ $locale = $this->getDefault($locale, true);
382
+ }
383
+
384
+ if (($locale == 'auto') or ($locale === null)) {
385
+ $locale = self::$_auto;
386
+ }
387
+ if ($locale == 'browser') {
388
+ $locale = self::$_browser;
389
+ }
390
+ if ($locale == 'environment') {
391
+ $locale = self::$_environment;
392
+ }
393
+ if (is_array($locale)) {
394
+ $locale = key($locale);
395
+ }
396
+ if (!array_key_exists((string) $locale, self::$_localeData)) {
397
+ $region = substr($locale, 0, 3);
398
+ if (isset($region[2])) {
399
+ if (($region[2] == '_') or ($region[2] == '-')) {
400
+ $region = substr($region, 0, 2);
401
+ }
402
+ }
403
+ if (array_key_exists((string) $region, self::$_localeData)) {
404
+ $this->_Locale = $region;
405
+ } else {
406
+ $this->_Locale = 'root';
407
+ }
408
+
409
+ } else {
410
+ $this->_Locale = $locale;
411
+ }
412
+ }
413
+
414
+
415
+ /**
416
+ * Returns the language part of the locale
417
+ *
418
+ * @return language
419
+ */
420
+ public function getLanguage()
421
+ {
422
+ $locale = explode('_', $this->_Locale);
423
+ return $locale[0];
424
+ }
425
+
426
+
427
+ /**
428
+ * Returns the region part of the locale if available
429
+ *
430
+ * @return string|false - Regionstring
431
+ */
432
+ public function getRegion()
433
+ {
434
+ $locale = explode('_', $this->_Locale);
435
+ if (isset($locale[1])) {
436
+ return $locale[1];
437
+ }
438
+
439
+ return false;
440
+ }
441
+
442
+
443
+ /**
444
+ * Return the accepted charset of the client
445
+ *
446
+ * @return string
447
+ */
448
+ public function getHttpCharset()
449
+ {
450
+ $httpcharsets = getenv("HTTP_ACCEPT_CHARSET");
451
+
452
+ $charsets = array();
453
+ if ($httpcharsets === false) {
454
+ return $charsets;
455
+ }
456
+
457
+ $accepted = preg_split('/,\s*/', $httpcharsets);
458
+ foreach ($accepted as $accept)
459
+ {
460
+ if (empty($accept)) {
461
+ continue;
462
+ }
463
+
464
+ if (strpos($accept, ';'))
465
+ {
466
+ $quality = (float) substr($accept, strpos($accept, '=') + 1);
467
+ $charsets[substr($accept, 0, strpos($accept, ';'))] = $quality;
468
+ } else {
469
+ $quality = 1.0;
470
+ $charsets[$accept] = $quality;
471
+ }
472
+
473
+ }
474
+
475
+ return $charsets;
476
+ }
477
+
478
+
479
+ /**
480
+ * Returns true if both locales are equal
481
+ *
482
+ * @return boolean
483
+ */
484
+ public function equals($object)
485
+ {
486
+ if ($object->toString() == $this->toString()) {
487
+ return true;
488
+ }
489
+
490
+ return false;
491
+ }
492
+
493
+
494
+ /**
495
+ * Returns localized informations as array, supported are several
496
+ * types of informations.
497
+ * For detailed information about the types look into the documentation
498
+ *
499
+ * @param string $path OPTIONAL Type of information to return
500
+ * @param string|locale $locale OPTIONAL Locale|Language for which this informations should be returned
501
+ * @param string $value OPTIONAL Value for detail list
502
+ * @return array Array with the wished information in the given language
503
+ */
504
+ public function getTranslationList($path = null, $locale = null, $value = null)
505
+ {
506
+ // load class within method for speed
507
+ require_once 'Zend/Locale/Data.php';
508
+ require_once 'Zend/Locale/Exception.php';
509
+
510
+ if ($locale === null) {
511
+ $locale = $this->_Locale;
512
+ }
513
+
514
+ if ($locale == 'auto') {
515
+ $locale = self::$_auto;
516
+ }
517
+ if ($locale == 'browser') {
518
+ $locale = self::$_browser;
519
+ }
520
+ if ($locale == 'environment') {
521
+ $locale = self::$_environment;
522
+ }
523
+ if (is_array($locale)) {
524
+ $locale = key($locale);
525
+ }
526
+ $result = Zend_Locale_Data::getList($locale, $path, $value);
527
+ if (empty($result)) {
528
+ return false;
529
+ }
530
+ return $result;
531
+ }
532
+
533
+
534
+ /**
535
+ * Returns an array with the name of all languages translated to the given language
536
+ *
537
+ * @param string $locale OPTIONAL locale for language translation
538
+ * @return array
539
+ */
540
+ public function getLanguageTranslationList($locale = null)
541
+ {
542
+ return $this->getTranslationList('language', $locale);
543
+ }
544
+
545
+
546
+ /**
547
+ * Returns an array with the name of all scripts translated to the given language
548
+ *
549
+ * @param string $locale OPTIONAL locale for script translation
550
+ * @return array
551
+ */
552
+ public function getScriptTranslationList($locale = null)
553
+ {
554
+ return $this->getTranslationList('script', $locale);
555
+ }
556
+
557
+
558
+ /**
559
+ * Returns an array with the name of all countries translated to the given language
560
+ *
561
+ * @param string $locale OPTIONAL locale for country translation
562
+ * @return array
563
+ */
564
+ public function getCountryTranslationList($locale = null)
565
+ {
566
+ return $this->getTranslationList('territory', $locale, 2);
567
+ }
568
+
569
+
570
+ /**
571
+ * Returns an array with the name of all territories translated to the given language
572
+ * All territories contains other countries.
573
+ *
574
+ * @param string $locale OPTIONAL locale for territory translation
575
+ * @return array
576
+ */
577
+ public function getTerritoryTranslationList($locale = null)
578
+ {
579
+ return $this->getTranslationList('territory', $locale, 1);
580
+ }
581
+
582
+
583
+ /**
584
+ * Returns a localized information string, supported are several types of informations.
585
+ * For detailed information about the types look into the documentation
586
+ *
587
+ * @param string $value Name to get detailed information about
588
+ * @param string $path OPTIONAL Type of information to return
589
+ * @param string|locale $locale OPTIONAL Locale|Language for which this informations should be returned
590
+ * @return string The wished information in the given language
591
+ */
592
+ public function getTranslation($value = null, $path = null, $locale = null)
593
+ {
594
+ // load class within method for speed
595
+ require_once 'Zend/Locale/Data.php';
596
+ require_once 'Zend/Locale/Exception.php';
597
+
598
+ if ($locale === null) {
599
+ $locale = $this->_Locale;
600
+ }
601
+
602
+ if ($locale == 'auto') {
603
+ $locale = self::$_auto;
604
+ }
605
+ if ($locale == 'browser') {
606
+ $locale = self::$_browser;
607
+ }
608
+ if ($locale == 'environment') {
609
+ $locale = self::$_environment;
610
+ }
611
+ if (is_array($locale)) {
612
+ $locale = key($locale);
613
+ }
614
+ $result = Zend_Locale_Data::getContent($locale, $path, $value);
615
+ if (empty($result)) {
616
+ return false;
617
+ }
618
+ return $result;
619
+ }
620
+
621
+
622
+ /**
623
+ * Returns the localized language name
624
+ *
625
+ * @param string $value Name to get detailed information about
626
+ * @param string $locale OPTIONAL locale for language translation
627
+ * @return array
628
+ */
629
+ public function getLanguageTranslation($value, $locale = null)
630
+ {
631
+ return $this->getTranslation($value, 'language', $locale);
632
+ }
633
+
634
+
635
+ /**
636
+ * Returns the localized script name
637
+ *
638
+ * @param string $what Name to get detailed information about
639
+ * @param string $locale OPTIONAL locale for script translation
640
+ * @return array
641
+ */
642
+ public function getScriptTranslation($value, $locale = null)
643
+ {
644
+ return $this->getTranslation($value, 'script', $locale);
645
+ }
646
+
647
+
648
+ /**
649
+ * Returns the localized country name
650
+ *
651
+ * @param string $what Name to get detailed information about
652
+ * @param string $locale OPTIONAL locale for country translation
653
+ * @return array
654
+ */
655
+ public function getCountryTranslation($value, $locale = null)
656
+ {
657
+ return $this->getTranslation($value, 'country', $locale);
658
+ }
659
+
660
+
661
+ /**
662
+ * Returns the localized territory name
663
+ * All territories contains other countries.
664
+ *
665
+ * @param string $what Name to get detailed information about
666
+ * @param string $locale OPTIONAL locale for territory translation
667
+ * @return array
668
+ */
669
+ public function getTerritoryTranslation($value, $locale = null)
670
+ {
671
+ return $this->getTranslation($value, 'territory', $locale);
672
+ }
673
+
674
+
675
+ /**
676
+ * Returns an array with translated yes strings
677
+ *
678
+ * @param string $locale OPTIONAL locale for language translation (defaults to $this locale)
679
+ * @return array
680
+ */
681
+ public function getQuestion($locale = null)
682
+ {
683
+ // load class within method for speed
684
+ require_once 'Zend/Locale/Data.php';
685
+
686
+ if ($locale === null) {
687
+ $locale = $this->_Locale;
688
+ }
689
+
690
+ if ($locale == 'auto') {
691
+ $locale = self::$_auto;
692
+ }
693
+ if ($locale == 'browser') {
694
+ $locale = self::$_browser;
695
+ }
696
+ if ($locale == 'environment') {
697
+ $locale = self::$_environment;
698
+ }
699
+ if (is_array($locale)) {
700
+ $locale = key($locale);
701
+ }
702
+ $quest = Zend_Locale_Data::getList($locale, 'question');
703
+ $yes = explode(':', $quest['yes']);
704
+ $no = explode(':', $quest['no']);
705
+ $quest['yes'] = $yes[0];
706
+ $quest['yesarray'] = $yes;
707
+ $quest['no'] = $no[0];
708
+ $quest['noarray'] = $no;
709
+ $quest['yesexpr'] = $this->_getRegex($yes);
710
+ $quest['noexpr'] = $this->_getRegex($no);
711
+
712
+ return $quest;
713
+ }
714
+
715
+
716
+ /**
717
+ * Internal function for creating a regex
718
+ *
719
+ * @param string $input
720
+ * @return string
721
+ */
722
+ private function _getRegex($input)
723
+ {
724
+ $regex = "";
725
+ if (is_array($input)) {
726
+ $regex = "^";
727
+ $start = true;
728
+ foreach($input as $row) {
729
+ if ($start === false) {
730
+ $regex .= "|";
731
+ }
732
+ $start = false;
733
+ $regex .= "(";
734
+ $one = null;
735
+ if (strlen($row) > 2) {
736
+ $one = true;
737
+ }
738
+ foreach (str_split($row, 1) as $char) {
739
+ $regex .= "[" . $char;
740
+ $regex .= strtoupper($char) . "]";
741
+ if ($one === true) {
742
+ $one = false;
743
+ $regex .= "(";
744
+ }
745
+ }
746
+ if ($one === false) {
747
+ $regex .= ")";
748
+ }
749
+ $regex .= "?)";
750
+ }
751
+ }
752
+ return $regex;
753
+ }
754
+
755
+
756
+ /**
757
+ * Checks if a locale identifier is a real locale or not
758
+ * Examples:
759
+ * "en_XX" refers to "en", which returns true
760
+ * "XX_yy" refers to "root", which returns false
761
+ *
762
+ * @param string|Zend_Locale $locale Locale to check for
763
+ * @param boolean $create If true, create a default locale, if $locale is empty
764
+ * @return false|string false if given locale is not a locale, else the locale identifier is returned
765
+ */
766
+ public static function isLocale($locale, $create = false)
767
+ {
768
+ if (empty($locale) and ($create === true)) {
769
+ $locale = new self();
770
+ }
771
+ if ($locale instanceof Zend_Locale) {
772
+ return $locale->toString();
773
+ }
774
+ if (!is_string($locale)) {
775
+ return false;
776
+ }
777
+ if (empty(self::$_auto)) {
778
+ $temp = new self($locale);
779
+ self::$_auto = $temp->getDefault(null, false);
780
+ self::$_browser = $temp->getDefault(self::BROWSER, false);
781
+ self::$_environment = $temp->getDefault(self::ENVIRONMENT, false);
782
+ }
783
+ if ($locale == 'auto') {
784
+ $locale = self::$_auto;
785
+ }
786
+ if ($locale == 'browser') {
787
+ $locale = self::$_browser;
788
+ }
789
+ if ($locale == 'environment') {
790
+ $locale = self::$_environment;
791
+ }
792
+ if (is_array($locale)) {
793
+ $locale = key($locale);
794
+ }
795
+
796
+ if (array_key_exists($locale, self::$_localeData)) {
797
+ return $locale;
798
+ } else {
799
+ $locale = explode('_', $locale);
800
+ if (array_key_exists($locale[0], self::$_localeData)) {
801
+ return $locale[0];
802
+ }
803
+ }
804
+ return false;
805
+ }
806
+
807
+
808
+ /**
809
+ * Returns a list of all known locales where the locale is the key
810
+ * Only real locales are returned, the internal locales 'root', 'auto', 'browser'
811
+ * and 'environment' are suppressed
812
+ *
813
+ * @return array
814
+ */
815
+ public static function getLocaleList()
816
+ {
817
+ $list = self::$_localeData;
818
+ unset($list['root']);
819
+ unset($list['auto']);
820
+ unset($list['browser']);
821
+ unset($list['environment']);
822
+ return $list;
823
+ }
824
+
825
+
826
+ /**
827
+ * Sets a cache
828
+ *
829
+ * @param Zend_Cache_Core $cache
830
+ */
831
+ public static function setCache(Zend_Cache_Core $cache)
832
+ {
833
+ // load class within method for speed
834
+ require_once 'Zend/Locale/Data.php';
835
+ Zend_Locale_Data::setCache($cache);
836
+ }
837
+ }
lib/Zend/Locale/Data.php ADDED
@@ -0,0 +1,1169 @@
1
+ <?php
2
+ /**
3
+ * Zend Framework
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the new BSD license that is bundled
8
+ * with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://framework.zend.com/license/new-bsd
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@zend.com so we can send you a copy immediately.
14
+ *
15
+ * @category Zend
16
+ * @package Zend_Locale
17
+ * @subpackage Data
18
+ * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
+ * @version $Id: Data.php 8064 2008-02-16 10:58:39Z thomas $
20
+ * @license http://framework.zend.com/license/new-bsd New BSD License
21
+ */
22
+
23
+
24
+ /**
25
+ * include needed classes
26
+ */
27
+ require_once 'Zend/Locale.php';
28
+
29
+
30
+ /**
31
+ * @category Zend
32
+ * @package Zend_Locale
33
+ * @subpackage Data
34
+ * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
35
+ * @license http://framework.zend.com/license/new-bsd New BSD License
36
+ */
37
+ class Zend_Locale_Data
38
+ {
39
+ /**
40
+ * locale files
41
+ *
42
+ * @var ressource
43
+ * @access private
44
+ */
45
+ private static $_ldml = array();
46
+
47
+
48
+ /**
49
+ * list of values which are collected
50
+ *
51
+ * @var array
52
+ * @access private
53
+ */
54
+ private static $_list = array();
55
+
56
+
57
+ /**
58
+ * internal cache for ldml values
59
+ *
60
+ * @var Zend_Cache_Core
61
+ * @access private
62
+ */
63
+ private static $_cache = null;
64
+
65
+
66
+ /**
67
+ * Read the content from locale
68
+ *
69
+ * Can be called like:
70
+ * <ldml>
71
+ * <delimiter>test</delimiter>
72
+ * <second type='myone'>content</second>
73
+ * <second type='mysecond'>content2</second>
74
+ * <third type='mythird' />
75
+ * </ldml>
76
+ *
77
+ * Case 1: _readFile('ar','/ldml/delimiter') -> returns [] = test
78
+ * Case 1: _readFile('ar','/ldml/second[@type=myone]') -> returns [] = content
79
+ * Case 2: _readFile('ar','/ldml/second','type') -> returns [myone] = content; [mysecond] = content2
80
+ * Case 3: _readFile('ar','/ldml/delimiter',,'right') -> returns [right] = test
81
+ * Case 4: _readFile('ar','/ldml/third','type','myone') -> returns [myone] = mythird
82
+ *
83
+ * @param string $locale
84
+ * @param string $path
85
+ * @param string $attribute
86
+ * @param string $value
87
+ * @access private
88
+ * @return array
89
+ */
90
+ private static function _readFile($locale, $path, $attribute, $value, $temp)
91
+ {
92
+ // without attribute - read all values
93
+ // with attribute - read only this value
94
+ if (!empty(self::$_ldml[(string) $locale])) {
95
+
96
+ $result = self::$_ldml[(string) $locale]->xpath($path);
97
+ if (!empty($result)) {
98
+ foreach ($result as &$found) {
99
+
100
+ if (empty($value)) {
101
+
102
+ if (empty($attribute)) {
103
+ // Case 1
104
+ $temp[] = (string) $found;
105
+ } else if (empty($temp[(string) $found[$attribute]])){
106
+ // Case 2
107
+ $temp[(string) $found[$attribute]] = (string) $found;
108
+ }
109
+
110
+ } else if (empty ($temp[$value])) {
111
+
112
+ if (empty($attribute)) {
113
+ // Case 3
114
+ $temp[$value] = (string) $found;
115
+ } else {
116
+ // Case 4
117
+ $temp[$value] = (string) $found[$attribute];
118
+ }
119
+
120
+ }
121
+ }
122
+ }
123
+ }
124
+ return $temp;
125
+ }
126
+
127
+ /**
128
+ * Find possible routing to other path or locale
129
+ *
130
+ * @param string $locale
131
+ * @param string $path
132
+ * @param string $attribute
133
+ * @param string $value
134
+ * @param array $temp
135
+ * @throws Zend_Locale_Exception
136
+ * @access private
137
+ */
138
+ private static function _findRoute($locale, $path, $attribute, $value, &$temp)
139
+ {
140
+ // load locale file if not already in cache
141
+ // needed for alias tag when referring to other locale
142
+ if (empty(self::$_ldml[(string) $locale])) {
143
+ $filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
144
+ if (!file_exists($filename)) {
145
+ require_once 'Zend/Locale/Exception.php';
146
+ throw new Zend_Locale_Exception("Missing locale file '$filename' for '$locale' locale.");
147
+ }
148
+
149
+ self::$_ldml[(string) $locale] = simplexml_load_file($filename);
150
+ }
151
+
152
+ // search for 'alias' tag in the search path for redirection
153
+ $search = '';
154
+ $tok = strtok($path, '/');
155
+
156
+ // parse the complete path
157
+ if (!empty(self::$_ldml[(string) $locale])) {
158
+ while ($tok !== false) {
159
+ $search .= '/' . $tok;
160
+ if (strpos($search, '[@') !== false) {
161
+ while (strrpos($search, '[@') > strrpos($search, ']')) {
162
+ $tok = strtok('/');
163
+ if (empty($tok)) {
164
+ $search .= '/';
165
+ }
166
+ $search = $search . '/' . $tok;
167
+ }
168
+ }
169
+ $result = self::$_ldml[(string) $locale]->xpath($search . '/alias');
170
+
171
+ // alias found
172
+ if (!empty($result)) {
173
+
174
+ $source = $result[0]['source'];
175
+ $newpath = $result[0]['path'];
176
+
177
+ // new path - path //ldml is to ignore
178
+ if ($newpath != '//ldml') {
179
+ // other path - parse to make real path
180
+
181
+ while (substr($newpath,0,3) == '../') {
182
+ $newpath = substr($newpath, 3);
183
+ $search = substr($search, 0, strrpos($search, '/'));
184
+ }
185
+
186
+ // truncate ../ to realpath otherwise problems with alias
187
+ $path = $search . '/' . $newpath;
188
+ while (($tok = strtok('/'))!== false) {
189
+ $path = $path . '/' . $tok;
190
+ }
191
+ }
192
+
193
+ // reroute to other locale
194
+ if ($source != 'locale') {
195
+ $locale = $source;
196
+ }
197
+
198
+ $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
199
+ return false;
200
+ }
201
+
202
+ $tok = strtok('/');
203
+ }
204
+ }
205
+ return true;
206
+ }
207
+
208
+
209
+ /**
210
+ * Read the right LDML file
211
+ *
212
+ * @param string $locale
213
+ * @param string $path
214
+ * @param string $attribute
215
+ * @param string $value
216
+ * @access private
217
+ */
218
+ private static function _getFile($locale, $path, $attribute = false, $value = false, $temp = array())
219
+ {
220
+ $result = self::_findRoute($locale, $path, $attribute, $value, $temp);
221
+ if ($result) {
222
+ $temp = self::_readFile($locale, $path, $attribute, $value, $temp);
223
+ }
224
+
225
+ // parse required locales reversive
226
+ // example: when given zh_Hans_CN
227
+ // 1. -> zh_Hans_CN
228
+ // 2. -> zh_Hans
229
+ // 3. -> zh
230
+ // 4. -> root
231
+ if (($locale != 'root') && ($result)) {
232
+ $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
233
+ if (!empty($locale)) {
234
+ $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
235
+ } else {
236
+ $temp = self::_getFile('root', $path, $attribute, $value, $temp);
237
+ }
238
+ }
239
+ return $temp;
240
+ }
241
+
242
+
243
+ /**
244
+ * Find the details for supplemental calendar datas
245
+ *
246
+ * @param string $locale Locale for Detaildata
247
+ * @param array $list List to search
248
+ * @return string Key for Detaildata
249
+ */
250
+ private static function _calendarDetail($locale, $list)
251
+ {
252
+ $ret = "001";
253
+ foreach ($list as $key => $value) {
254
+ if (strpos($locale, '_') !== false) {
255
+ $locale = substr($locale, strpos($locale, '_') + 1);
256
+ }
257
+ if (strpos($key, $locale) !== false) {
258
+ $ret = $key;
259
+ break;
260
+ }
261
+ }
262
+ return $ret;
263
+ }
264
+
265
+ /**
266
+ * Internal function for checking the locale
267
+ *
268
+ * @param string|Zend_Locale $locale Locale to check
269
+ * @return string
270
+ */
271
+ private static function _checkLocale($locale)
272
+ {
273
+ if (empty($locale)) {
274
+ $locale = new Zend_Locale();
275
+ }
276
+
277
+ if ($locale instanceof Zend_Locale) {
278
+ $locale = $locale->toString();
279
+ }
280
+
281
+ if (!($locale = Zend_Locale::isLocale($locale))) {
282
+ require_once 'Zend/Locale/Exception.php';
283
+ throw new Zend_Locale_Exception("Locale ($locale) is a unknown locale");
284
+ }
285
+ return $locale;
286
+ }
287
+
288
+ /**
289
+ * Read the LDML file, get a array of multipath defined value
290
+ *
291
+ * @param string $locale
292
+ * @param string $path
293
+ * @param string $value
294
+ * @return array
295
+ * @access public
296
+ */
297
+ public static function getList($locale, $path, $value = false)
298
+ {
299
+ $locale = self::_checkLocale($locale);
300
+
301
+ if (isset(self::$_cache)) {