en-US.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /************************************************
  2. * This is an example localization page. All of these
  3. * messages are the default messages for ko.validation
  4. *
  5. * Currently ko.validation does multiple parameter replacement
  6. * on your message (indicated by the {0}, {1}, etc.).
  7. *
  8. * The parameters that you provide in your validation extender
  9. * are what are passed to your message to do the {0}, {1} etc. replacements.
  10. *
  11. * eg: myProperty.extend({ minLength: 5 });
  12. * ... will provide a message of "Please enter at least 5 characters"
  13. * when validated
  14. *
  15. * eg: myProperty.extend({ between: [1, 5] });
  16. * ... will provide a message of "Please enter between 1 and 5 characters"
  17. * when validated
  18. *
  19. * This message replacement obviously only works with primitives
  20. * such as numbers and strings. We do not stringify complex objects
  21. * or anything like that currently.
  22. */
  23. (function(factory) {
  24. // Module systems magic dance.
  25. /*global require,ko.validation,define,module*/
  26. if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') {
  27. // CommonJS or Node
  28. module.exports = factory(require('../'));
  29. } else if (typeof define === 'function' && define['amd']) {
  30. // AMD anonymous module
  31. define(['knockout.validation'], factory);
  32. } else {
  33. // <script> tag: use the global `ko.validation` object
  34. factory(ko.validation);
  35. }
  36. }(function(kv) {
  37. if (!kv || typeof kv.defineLocale !== 'function') {
  38. throw new Error('Knockout-Validation is required, please ensure it is loaded before this localization file');
  39. }
  40. return kv.defineLocale('en-US', {
  41. required: 'This field is required.',
  42. min: 'Please enter a value greater than or equal to {0}.',
  43. max: 'Please enter a value less than or equal to {0}.',
  44. minLength: 'Please enter at least {0} characters.',
  45. maxLength: 'Please enter no more than {0} characters.',
  46. pattern: 'Please check this value.',
  47. step: 'The value must increment by {0}.',
  48. email: 'Please enter a proper email address.',
  49. date: 'Please enter a proper date.',
  50. dateISO: 'Please enter a proper date.',
  51. number: 'Please enter a number.',
  52. digit: 'Please enter a digit.',
  53. phoneUS: 'Please specify a valid phone number.',
  54. equal: 'Values must equal.',
  55. notEqual: 'Please choose another value.',
  56. unique: 'Please make sure the value is unique.'
  57. });
  58. }));