Zend_Validate-Messages.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 16087 -->
  4. <sect1 id="zend.validate.messages">
  5. <title>検証メッセージ</title>
  6. <para>
  7. <classname>Zend_Validate</classname> を継承したバリデータには、
  8. 検証に失敗したときに使用するメッセージが用意されています。
  9. ここにまとめた情報をもとに、
  10. 独自のメッセージを設定したりバリデータが返すメッセージを翻訳したりすることができます。
  11. 次の表は、各バリデータが返すすべてのメッセージをまとめたものです。
  12. </para>
  13. <table id="zend.validate.messages.table">
  14. <title>利用可能な検証メッセージ</title>
  15. <tgroup cols="4">
  16. <thead>
  17. <row>
  18. <entry>バリデータ</entry>
  19. <entry>定数</entry>
  20. <entry>メッセージ</entry>
  21. </row>
  22. </thead>
  23. <tbody>
  24. <row>
  25. <entry morerows="1" valign="middle">Alnum</entry>
  26. <entry>NOT_ALNUM</entry>
  27. <entry>'%value%' has not only alphabetic and digit characters</entry>
  28. </row>
  29. <row>
  30. <entry>STRING_EMPTY</entry>
  31. <entry>'%value%' is an empty string</entry>
  32. </row>
  33. <row>
  34. <entry morerows="1" valign="middle">Alpha</entry>
  35. <entry>NOT_ALPHA</entry>
  36. <entry>'%value%' has not only alphabetic characters</entry>
  37. </row>
  38. <row>
  39. <entry>STRING_EMPTY</entry>
  40. <entry>'%value%' is an empty string</entry>
  41. </row>
  42. <row>
  43. <entry>Barcode</entry>
  44. <entry>---</entry>
  45. <entry>messages are thrown by a subclass</entry>
  46. </row>
  47. <row>
  48. <entry morerows="2" valign="middle">Barcode_Ean13</entry>
  49. <entry>INVALID</entry>
  50. <entry>'%value%' is an invalid EAN-13 barcode</entry>
  51. </row>
  52. <row>
  53. <entry>INVALID_LENGTH</entry>
  54. <entry>'%value%' should be 13 characters</entry>
  55. </row>
  56. <row>
  57. <entry>NOT_NUMERIC</entry>
  58. <entry>'%value%' should contain only numeric characters</entry>
  59. </row>
  60. <row>
  61. <entry morerows="1" valign="middle">Barcode_UpcA</entry>
  62. <entry>INVALID</entry>
  63. <entry>'%value%' is an invalid UPC-A barcode</entry>
  64. </row>
  65. <row>
  66. <entry>INVALID_LENGTH</entry>
  67. <entry>'%value%' should be 12 characters</entry>
  68. </row>
  69. <row>
  70. <entry morerows="1" valign="middle">Between</entry>
  71. <entry>NOT_BETWEEN</entry>
  72. <entry>'%value%' is not between '%min%' and '%max%', inclusively</entry>
  73. </row>
  74. <row>
  75. <entry>NOT_BETWEEN_STRICT</entry>
  76. <entry>'%value%' is not strictly between '%min%' and '%max%'</entry>
  77. </row>
  78. <row>
  79. <entry morerows="1" valign="middle">Ccnum</entry>
  80. <entry>LENGTH</entry>
  81. <entry>'%value%' must contain between 13 and 19 digits</entry>
  82. </row>
  83. <row>
  84. <entry>CHECKSUM</entry>
  85. <entry>Luhn algorithm (mod-10 checksum) failed on '%value%'</entry>
  86. </row>
  87. <row>
  88. <entry morerows="2" valign="middle">Date</entry>
  89. <entry>FALSEFORMAT</entry>
  90. <entry>'%value%' does not fit given date format</entry>
  91. </row>
  92. <row>
  93. <entry>INVALID</entry>
  94. <entry>'%value%' does not appear to be a valid date</entry>
  95. </row>
  96. <row>
  97. <entry>NOT_YYYY_MM_DD</entry>
  98. <entry>'%value%' is not of the format YYYY-MM-DD</entry>
  99. </row>
  100. <row>
  101. <entry morerows="1" valign="middle">Db_Abstract</entry>
  102. <entry>ERROR_NO_RECORD_FOUND</entry>
  103. <entry>No record matching %value% was found</entry>
  104. </row>
  105. <row>
  106. <entry>ERROR_RECORD_FOUND</entry>
  107. <entry>A record matching %value% was found</entry>
  108. </row>
  109. <row>
  110. <entry morerows="1" valign="middle">Digits</entry>
  111. <entry>NOT_DIGITS</entry>
  112. <entry>'%value%' contains not only digit characters</entry>
  113. </row>
  114. <row>
  115. <entry>STRING_EMPTY</entry>
  116. <entry>'%value%' is an empty string</entry>
  117. </row>
  118. <row>
  119. <entry morerows="6" valign="middle">EmailAddress</entry>
  120. <entry>INVALID</entry>
  121. <entry>'%value%' is not a valid email address in the basic format local-part@hostname</entry>
  122. </row>
  123. <row>
  124. <entry>INVALID_HOSTNAME</entry>
  125. <entry>'%hostname%' is not a valid hostname for email address '%value%'</entry>
  126. </row>
  127. <row>
  128. <entry>INVALID_MX_RECORD</entry>
  129. <entry>'%hostname%' does not appear to have a valid MX record for the email address '%value%'</entry>
  130. </row>
  131. <row>
  132. <entry>DOT_ATOM</entry>
  133. <entry>'%localPart%' not matched against dot-atom format</entry>
  134. </row>
  135. <row>
  136. <entry>QUOTED_STRING</entry>
  137. <entry>'%localPart%' not matched against quoted-string format</entry>
  138. </row>
  139. <row>
  140. <entry>INVALID_LOCAL_PART</entry>
  141. <entry>'%localPart%' is not a valid local part for email address '%value%'</entry>
  142. </row>
  143. <row>
  144. <entry>LENGTH_EXCEEDED</entry>
  145. <entry>'%value%' exceeds the allowed length</entry>
  146. </row>
  147. <row>
  148. <entry morerows="1" valign="middle">File_Count</entry>
  149. <entry>TOO_MUCH</entry>
  150. <entry>Too much files, maximum '%max%' are allowed but '%count%' are given</entry>
  151. </row>
  152. <row>
  153. <entry>TOO_LESS</entry>
  154. <entry>Too less files, minimum '%min%' are expected but '%count%' are given</entry>
  155. </row>
  156. <row>
  157. <entry morerows="2" valign="middle">File_Crc32</entry>
  158. <entry>DOES_NOT_MATCH</entry>
  159. <entry>The file '%value%' does not match the given crc32 hashes</entry>
  160. </row>
  161. <row>
  162. <entry>NOT_DETECTED</entry>
  163. <entry>There was no crc32 hash detected for the given file</entry>
  164. </row>
  165. <row>
  166. <entry>NOT_FOUND</entry>
  167. <entry>The file '%value%' could not be found</entry>
  168. </row>
  169. <row>
  170. <entry morerows="1" valign="middle">File_ExcludeExtension</entry>
  171. <entry>FALSE_EXTENSION</entry>
  172. <entry>The file '%value%' has a false extension</entry>
  173. </row>
  174. <row>
  175. <entry>NOT_FOUND</entry>
  176. <entry>The file '%value%' was not found</entry>
  177. </row>
  178. <row>
  179. <entry morerows="2" valign="middle">File_ExcludeMimeType</entry>
  180. <entry>FALSE_TYPE</entry>
  181. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  182. </row>
  183. <row>
  184. <entry>NOT_DETECTED</entry>
  185. <entry>The mimetype of file '%value%' could not been detected</entry>
  186. </row>
  187. <row>
  188. <entry>NOT_READABLE</entry>
  189. <entry>The file '%value%' can not be read</entry>
  190. </row>
  191. <row>
  192. <entry morerows="2" valign="middle">File_Exists</entry>
  193. <entry>DOES_NOT_EXIST</entry>
  194. <entry>The file '%value%' does not exist</entry>
  195. </row>
  196. <row>
  197. <entry morerows="1" valign="middle">File_Extension</entry>
  198. <entry>FALSE_EXTENSION</entry>
  199. <entry>The file '%value%' has a false extension</entry>
  200. </row>
  201. <row>
  202. <entry>NOT_FOUND</entry>
  203. <entry>The file '%value%' was not found</entry>
  204. </row>
  205. <row>
  206. <entry morerows="2" valign="middle">File_FilesSize</entry>
  207. <entry>TOO_BIG</entry>
  208. <entry>All files in sum should have a maximum size of '%max%' but '%size%' were detected</entry>
  209. </row>
  210. <row>
  211. <entry>TOO_SMALL</entry>
  212. <entry>All files in sum should have a minimum size of '%min%' but '%size%' were detected</entry>
  213. </row>
  214. <row>
  215. <entry>NOT_READABLE</entry>
  216. <entry>One or more files can not be read</entry>
  217. </row>
  218. <row>
  219. <entry morerows="2" valign="middle">File_Hash</entry>
  220. <entry>DOES_NOT_MATCH</entry>
  221. <entry>The file '%value%' does not match the given hashes</entry>
  222. </row>
  223. <row>
  224. <entry>NOT_DETECTED</entry>
  225. <entry>There was no hash detected for the given file</entry>
  226. </row>
  227. <row>
  228. <entry>NOT_FOUND</entry>
  229. <entry>The file '%value%' could not be found</entry>
  230. </row>
  231. <row>
  232. <entry morerows="5" valign="middle">File_ImageSize</entry>
  233. <entry>WIDTH_TOO_BIG</entry>
  234. <entry>Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected</entry>
  235. </row>
  236. <row>
  237. <entry>WIDTH_TOO_SMALL</entry>
  238. <entry>Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected</entry>
  239. </row>
  240. <row>
  241. <entry>HEIGHT_TOO_BIG</entry>
  242. <entry>Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected</entry>
  243. </row>
  244. <row>
  245. <entry>HEIGHT_TOO_SMALL</entry>
  246. <entry>Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected</entry>
  247. </row>
  248. <row>
  249. <entry>NOT_DETECTED</entry>
  250. <entry>The size of image '%value%' could not be detected</entry>
  251. </row>
  252. <row>
  253. <entry>NOT_READABLE</entry>
  254. <entry>The image '%value%' can not be read</entry>
  255. </row>
  256. <row>
  257. <entry morerows="2" valign="middle">File_IsCompressed</entry>
  258. <entry>FALSE_TYPE</entry>
  259. <entry>The file '%value%' is not compressed, '%type%' detected</entry>
  260. </row>
  261. <row>
  262. <entry>NOT_DETECTED</entry>
  263. <entry>The mimetype of file '%value%' could not been detected</entry>
  264. </row>
  265. <row>
  266. <entry>NOT_READABLE</entry>
  267. <entry>The file '%value%' can not be read</entry>
  268. </row>
  269. <row>
  270. <entry morerows="2" valign="middle">File_IsImage</entry>
  271. <entry>FALSE_TYPE</entry>
  272. <entry>The file '%value%' is no image, '%type%' detected</entry>
  273. </row>
  274. <row>
  275. <entry>NOT_DETECTED</entry>
  276. <entry>The mimetype of file '%value%' could not been detected</entry>
  277. </row>
  278. <row>
  279. <entry>NOT_READABLE</entry>
  280. <entry>The file '%value%' can not be read</entry>
  281. </row>
  282. <row>
  283. <entry morerows="2" valign="middle">File_Md5</entry>
  284. <entry>DOES_NOT_MATCH</entry>
  285. <entry>The file '%value%' does not match the given md5 hashes</entry>
  286. </row>
  287. <row>
  288. <entry>NOT_DETECTED</entry>
  289. <entry>There was no md5 hash detected for the given file</entry>
  290. </row>
  291. <row>
  292. <entry>NOT_FOUND</entry>
  293. <entry>The file '%value%' could not be found</entry>
  294. </row>
  295. <row>
  296. <entry morerows="2" valign="middle">File_MimeType</entry>
  297. <entry>FALSE_TYPE</entry>
  298. <entry>The file '%value%' has a false mimetype of '%type%'</entry>
  299. </row>
  300. <row>
  301. <entry>NOT_DETECTED</entry>
  302. <entry>The mimetype of file '%value%' could not been detected</entry>
  303. </row>
  304. <row>
  305. <entry>NOT_READABLE</entry>
  306. <entry>The file '%value%' can not be read</entry>
  307. </row>
  308. <row>
  309. <entry>File_NotExists</entry>
  310. <entry>DOES_EXIST</entry>
  311. <entry>The file '%value%' does exist</entry>
  312. </row>
  313. <row>
  314. <entry morerows="2" valign="middle">File_Sha1</entry>
  315. <entry>DOES_NOT_MATCH</entry>
  316. <entry>The file '%value%' does not match the given sha1 hashes</entry>
  317. </row>
  318. <row>
  319. <entry>NOT_DETECTED</entry>
  320. <entry>There was no sha1 hash detected for the given file</entry>
  321. </row>
  322. <row>
  323. <entry>NOT_FOUND</entry>
  324. <entry>The file '%value%' could not be found</entry>
  325. </row>
  326. <row>
  327. <entry morerows="2" valign="middle">File_Size</entry>
  328. <entry>TOO_BIG</entry>
  329. <entry>Maximum allowed size for file '%value%' is '%max%' but '%size%' detected</entry>
  330. </row>
  331. <row>
  332. <entry>TOO_SMALL</entry>
  333. <entry>Minimum expected size for file '%value%' is '%min%' but '%size%' detected</entry>
  334. </row>
  335. <row>
  336. <entry>NOT_FOUND</entry>
  337. <entry>The file '%value%' could not be found</entry>
  338. </row>
  339. <row>
  340. <entry morerows="9" valign="middle">File_Upload</entry>
  341. <entry>INI_SIZE</entry>
  342. <entry>The file '%value%' exceeds the defined ini size</entry>
  343. </row>
  344. <row>
  345. <entry>FORM_SIZE</entry>
  346. <entry>The file '%value%' exceeds the defined form size</entry>
  347. </row>
  348. <row>
  349. <entry>PARTIAL</entry>
  350. <entry>The file '%value%' was only partially uploaded</entry>
  351. </row>
  352. <row>
  353. <entry>NO_FILE</entry>
  354. <entry>The file '%value%' was not uploaded</entry>
  355. </row>
  356. <row>
  357. <entry>NO_TMP_DIR</entry>
  358. <entry>No temporary directory was found for the file '%value%'</entry>
  359. </row>
  360. <row>
  361. <entry>CANT_WRITE</entry>
  362. <entry>The file '%value%' can't be written</entry>
  363. </row>
  364. <row>
  365. <entry>EXTENSION</entry>
  366. <entry>The extension returned an error while uploading the file '%value%'</entry>
  367. </row>
  368. <row>
  369. <entry>ATTACK</entry>
  370. <entry>The file '%value%' was illegal uploaded, possible attack</entry>
  371. </row>
  372. <row>
  373. <entry>FILE_NOT_FOUND</entry>
  374. <entry>The file '%value%' was not found</entry>
  375. </row>
  376. <row>
  377. <entry>UNKNOWN</entry>
  378. <entry>Unknown error while uploading the file '%value%'</entry>
  379. </row>
  380. <row>
  381. <entry morerows="2" valign="middle">File_WordCount</entry>
  382. <entry>TOO_MUCH</entry>
  383. <entry>Too much words, maximum '%max%' are allowed but '%count%' were counted</entry>
  384. </row>
  385. <row>
  386. <entry>TOO_LESS</entry>
  387. <entry>Too less words, minimum '%min%' are expected but '%count%' were counted</entry>
  388. </row>
  389. <row>
  390. <entry>NOT_FOUND</entry>
  391. <entry>The file '%value%' could not be found</entry>
  392. </row>
  393. <row>
  394. <entry>Float</entry>
  395. <entry>NOT_FLOAT</entry>
  396. <entry>'%value%' does not appear to be a float</entry>
  397. </row>
  398. <row>
  399. <entry>GreaterThan</entry>
  400. <entry>NOT_GREATER</entry>
  401. <entry>'%value%' is not greater than '%min%'</entry>
  402. </row>
  403. <row>
  404. <entry>Hex</entry>
  405. <entry>NOT_HEX</entry>
  406. <entry>'%value%' has not only hexadecimal digit characters</entry>
  407. </row>
  408. <row>
  409. <entry morerows="7" valign="middle">Hostname</entry>
  410. <entry>IP_ADDRESS_NOT_ALLOWED</entry>
  411. <entry>'%value%' appears to be an IP address, but IP addresses are not allowed</entry>
  412. </row>
  413. <row>
  414. <entry>UNKNOWN_TLD</entry>
  415. <entry>'%value%' appears to be a DNS hostname but cannot match TLD against known list</entry>
  416. </row>
  417. <row>
  418. <entry>INVALID_DASH</entry>
  419. <entry>'%value%' appears to be a DNS hostname but contains a dash (-) in an invalid position</entry>
  420. </row>
  421. <row>
  422. <entry>INVALID_HOSTNAME_SCHEMA</entry>
  423. <entry>'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'</entry>
  424. </row>
  425. <row>
  426. <entry>UNDECIPHERABLE_TLD</entry>
  427. <entry>'%value%' appears to be a DNS hostname but cannot extract TLD part</entry>
  428. </row>
  429. <row>
  430. <entry>INVALID_HOSTNAME</entry>
  431. <entry>'%value%' does not match the expected structure for a DNS hostname</entry>
  432. </row>
  433. <row>
  434. <entry>INVALID_LOCAL_NAME</entry>
  435. <entry>'%value%' does not appear to be a valid local network name</entry>
  436. </row>
  437. <row>
  438. <entry>LOCAL_NAME_NOT_ALLOWED</entry>
  439. <entry>'%value%' appears to be a local network name but local network names are not allowed</entry>
  440. </row>
  441. <row>
  442. <entry morerows="2" valign="middle">Iban</entry>
  443. <entry>NOTSUPPORTED</entry>
  444. <entry>'%value%' does not have IBAN</entry>
  445. </row>
  446. <row>
  447. <entry>FALSEFORMAT</entry>
  448. <entry>'%value%' has a false format</entry>
  449. </row>
  450. <row>
  451. <entry>CHECKFAILED</entry>
  452. <entry>'%value%' has failed the IBAN check</entry>
  453. </row>
  454. <row>
  455. <entry morerows="1" valign="middle">Identical</entry>
  456. <entry>NOT_SAME</entry>
  457. <entry>The token '%token%' does not match the given token '%value%'</entry>
  458. </row>
  459. <row>
  460. <entry>MISSING_TOKEN</entry>
  461. <entry>No token was provided to match against</entry>
  462. </row>
  463. <row>
  464. <entry>InArray</entry>
  465. <entry>NOT_IN_ARRAY</entry>
  466. <entry>'%value%' was not found in the haystack</entry>
  467. </row>
  468. <row>
  469. <entry>Int</entry>
  470. <entry>NOT_INT</entry>
  471. <entry>'%value%' does not appear to be an integer</entry>
  472. </row>
  473. <row>
  474. <entry>Ip</entry>
  475. <entry>NOT_IP_ADDRESS</entry>
  476. <entry>'%value%' does not appear to be a valid IP address</entry>
  477. </row>
  478. <row>
  479. <entry>LessThan</entry>
  480. <entry>NOT_LESS</entry>
  481. <entry>'%value%' is not less than '%max%'</entry>
  482. </row>
  483. <row>
  484. <entry>NotEmpty</entry>
  485. <entry>IS_EMPTY</entry>
  486. <entry>Value is required and can't be empty</entry>
  487. </row>
  488. <row>
  489. <entry>Regex</entry>
  490. <entry>NOT_MATCH</entry>
  491. <entry>'%value%' does not match against pattern '%pattern%'</entry>
  492. </row>
  493. <row>
  494. <entry morerows="1" valign="middle">StringLength</entry>
  495. <entry>TOO_SHORT</entry>
  496. <entry>'%value%' is less than %min% characters long</entry>
  497. </row>
  498. <row>
  499. <entry>TOO_LONG</entry>
  500. <entry>'%value%' is greater than %max% characters long</entry>
  501. </row>
  502. </tbody>
  503. </tgroup>
  504. </table>
  505. <para>
  506. さらに、<code>getMessageTemplates()</code>
  507. メソッドを使うとバリデータの全メッセージテンプレートを取得することができます。
  508. これは、検証に失敗したときにバリデータが返す可能性のあるメッセージを配列で返します。
  509. </para>
  510. <programlisting language="php"><![CDATA[
  511. $validator = new Zend_Validate_Alnum();
  512. $messages = $validator->getMessageTemplates();
  513. ]]></programlisting>
  514. </sect1>
  515. <!--
  516. vim:se ts=4 sw=4 et:
  517. -->