PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/files/validation.engine/2.2.4/languages/jquery.validationEngine-zh_CN.js

https://gitlab.com/Mirros/jsdelivr
JavaScript | 167 lines | 150 code | 1 blank | 16 comment | 0 complexity | ebed0e3c4d0c15a1d4bdcf407c699fe8 MD5 | raw file
  1. (function($){
  2. $.fn.validationEngineLanguage = function(){
  3. };
  4. $.validationEngineLanguage = {
  5. newLang: function(){
  6. $.validationEngineLanguage.allRules = {
  7. "required": { // Add your regex rules here, you can take telephone as an example
  8. "regex": "none",
  9. "alertText": "* 此处不可空白",
  10. "alertTextCheckboxMultiple": "* 请选择一个项目",
  11. "alertTextCheckboxe": "* 您必须钩选此栏",
  12. "alertTextDateRange": "* 日期范围不可空白"
  13. },
  14. "dateRange": {
  15. "regex": "none",
  16. "alertText": "* 无效的 ",
  17. "alertText2": " 日期范围"
  18. },
  19. "dateTimeRange": {
  20. "regex": "none",
  21. "alertText": "* 无效的 ",
  22. "alertText2": " 时间范围"
  23. },
  24. "minSize": {
  25. "regex": "none",
  26. "alertText": "* 最少 ",
  27. "alertText2": " 个字符"
  28. },
  29. "maxSize": {
  30. "regex": "none",
  31. "alertText": "* 最多 ",
  32. "alertText2": " 个字符"
  33. },
  34. "groupRequired": {
  35. "regex": "none",
  36. "alertText": "* 你必需选填其中一个栏位"
  37. },
  38. "min": {
  39. "regex": "none",
  40. "alertText": "* 最小值為 "
  41. },
  42. "max": {
  43. "regex": "none",
  44. "alertText": "* 最大值为 "
  45. },
  46. "past": {
  47. "regex": "none",
  48. "alertText": "* 日期必需早于 "
  49. },
  50. "future": {
  51. "regex": "none",
  52. "alertText": "* 日期必需晚于 "
  53. },
  54. "maxCheckbox": {
  55. "regex": "none",
  56. "alertText": "* 最多选取 ",
  57. "alertText2": " 个项目"
  58. },
  59. "minCheckbox": {
  60. "regex": "none",
  61. "alertText": "* 请选择 ",
  62. "alertText2": " 个项目"
  63. },
  64. "equals": {
  65. "regex": "none",
  66. "alertText": "* 请输入与上面相同的密码"
  67. },
  68. "phone": {
  69. // credit: jquery.h5validate.js / orefalo
  70. "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
  71. "alertText": "* 无效的电话号码"
  72. },
  73. "email": {
  74. // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
  75. "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,
  76. "alertText": "* 邮件地址无效"
  77. },
  78. "integer": {
  79. "regex": /^[\-\+]?\d+$/,
  80. "alertText": "* 不是有效的整数"
  81. },
  82. "number": {
  83. // Number, including positive, negative, and floating decimal. credit: orefalo
  84. "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
  85. "alertText": "* 无效的数字"
  86. },
  87. "date": {
  88. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
  89. "alertText": "* 无效的日期,格式必需为 YYYY-MM-DD"
  90. },
  91. "ipv4": {
  92. "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
  93. "alertText": "* 无效的 IP 地址"
  94. },
  95. "url": {
  96. "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
  97. "alertText": "* Invalid URL"
  98. },
  99. "onlyNumberSp": {
  100. "regex": /^[0-9\ ]+$/,
  101. "alertText": "* 只能填数字"
  102. },
  103. "onlyLetterSp": {
  104. "regex": /^[a-zA-Z\ \']+$/,
  105. "alertText": "* 只接受英文字母大小写"
  106. },
  107. "onlyLetterNumber": {
  108. "regex": /^[0-9a-zA-Z]+$/,
  109. "alertText": "* 不接受特殊字符"
  110. },
  111. // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
  112. "ajaxUserCall": {
  113. "url": "ajaxValidateFieldUser",
  114. // you may want to pass extra data on the ajax call
  115. "extraData": "name=eric",
  116. "alertText": "* 此名称已被其他人使用",
  117. "alertTextLoad": "* 正在确认名称是否有其他人使用,请稍等。"
  118. },
  119. "ajaxUserCallPhp": {
  120. "url": "phpajax/ajaxValidateFieldUser.php",
  121. // you may want to pass extra data on the ajax call
  122. "extraData": "name=eric",
  123. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  124. "alertTextOk": "* 此帐号名称可以使用",
  125. "alertText": "* 此名称已被其他人使用",
  126. "alertTextLoad": "* 正在确认帐号名称是否有其他人使用,请稍等。"
  127. },
  128. "ajaxNameCall": {
  129. // remote json service location
  130. "url": "ajaxValidateFieldName",
  131. // error
  132. "alertText": "* 此名称可以使用",
  133. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  134. "alertTextOk": "* 此名称已被其他人使用",
  135. // speaks by itself
  136. "alertTextLoad": "* 正在确认名称是否有其他人使用,请稍等。"
  137. },
  138. "ajaxNameCallPhp": {
  139. // remote json service location
  140. "url": "phpajax/ajaxValidateFieldName.php",
  141. // error
  142. "alertText": "* 此名称已被其他人使用",
  143. // speaks by itself
  144. "alertTextLoad": "* 正在确认名称是否有其他人使用,请稍等。"
  145. },
  146. "validate2fields": {
  147. "alertText": "* 请输入 HELLO"
  148. },
  149. //tls warning:homegrown not fielded
  150. "dateFormat":{
  151. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
  152. "alertText": "* 无效的日期格式"
  153. },
  154. //tls warning:homegrown not fielded
  155. "dateTimeFormat": {
  156. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
  157. "alertText": "* 无效的日期或时间格式",
  158. "alertText2": "可接受的格式: ",
  159. "alertText3": "mm/dd/yyyy hh:mm:ss AM|PM 或 ",
  160. "alertText4": "yyyy-mm-dd hh:mm:ss AM|PM"
  161. }
  162. };
  163. }
  164. };
  165. $.validationEngineLanguage.newLang();
  166. })(jQuery);