Skip to content
This repository
Browse code

MINOR Removing "." from the end of validation messages

  • Loading branch information...
commit 5462cdaab2282e63f521f0729ad5317888ef2b4c 1 parent 7fe0858
Sean Harvey authored June 01, 2012
2  filesystem/Upload.php
@@ -498,7 +498,7 @@ public function validate() {
498 498
 			$arg = File::format_size($this->getAllowedMaxFileSize($ext));
499 499
 			$this->errors[] = _t(
500 500
 				'File.TOOLARGE', 
501  
-				'Filesize is too large, maximum {size} allowed.',
  501
+				'Filesize is too large, maximum {size} allowed',
502 502
 				'Argument 1: Filesize (e.g. 1MB)',
503 503
 				array('size' => $arg)
504 504
 			);
2  forms/ConfirmedPasswordField.php
@@ -280,7 +280,7 @@ function validate($validator) {
280 280
 			if(!preg_match('/^(([a-zA-Z]+\d+)|(\d+[a-zA-Z]+))[a-zA-Z0-9]*$/',$value)) {
281 281
 				$validator->validationError(
282 282
 					'Password', 
283  
-					_t('Form.VALIDATIONSTRONGPASSWORD', "Passwords must have at least one digit and one alphanumeric character."), 
  283
+					_t('Form.VALIDATIONSTRONGPASSWORD', "Passwords must have at least one digit and one alphanumeric character"), 
284 284
 					"validation", 
285 285
 					false
286 286
 				);
2  forms/CreditCardField.php
@@ -53,7 +53,7 @@ function validate($validator){
53 53
 					$this->name,
54 54
 					_t(
55 55
 						'Form.VALIDATIONCREDITNUMBER', 
56  
-						"Please ensure you have entered the {number} credit card number correctly.",
  56
+						"Please ensure you have entered the {number} credit card number correctly",
57 57
 						array('number' => $number)
58 58
 					),
59 59
 					"validation",
2  forms/CurrencyField.php
@@ -44,7 +44,7 @@ function performReadonlyTransformation() {
44 44
 
45 45
 	function validate($validator) {
46 46
 		if(!empty ($this->value) && !preg_match('/^\s*(\-?\$?|\$\-?)?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?\s*$/', $this->value)) {
47  
-			$validator->validationError($this->name, _t('Form.VALIDCURRENCY', "Please enter a valid currency."), "validation", false);
  47
+			$validator->validationError($this->name, _t('Form.VALIDCURRENCY', "Please enter a valid currency"), "validation", false);
48 48
 			return false;
49 49
 		}
50 50
 		return true;
2  forms/DateField.php
@@ -311,7 +311,7 @@ function validate($validator) {
311 311
 			$validator->validationError(
312 312
 				$this->name, 
313 313
 				_t(
314  
-					'DateField.VALIDDATEFORMAT2', "Please enter a valid date format ({format}).", 
  314
+					'DateField.VALIDDATEFORMAT2', "Please enter a valid date format ({format})", 
315 315
 					array('format' => $this->getConfig('dateformat'))
316 316
 				), 
317 317
 				"validation", 
2  forms/EmailField.php
@@ -39,7 +39,7 @@ function validate($validator) {
39 39
 		if($this->value && !preg_match('/' . $pregSafePattern . '/i', $this->value)){
40 40
 			$validator->validationError(
41 41
 				$this->name,
42  
-				_t('EmailField.VALIDATION', "Please enter an email address."),
  42
+				_t('EmailField.VALIDATION', "Please enter an email address"),
43 43
 				"validation"
44 44
 			);
45 45
 			return false;
2  forms/RequiredFields.php
@@ -85,7 +85,7 @@ function php($data) {
85 85
 				}
86 86
 
87 87
 				if($formField && $error) {
88  
-					$errorMessage = sprintf(_t('Form.FIELDISREQUIRED', '%s is required').'.', strip_tags('"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'));
  88
+					$errorMessage = sprintf(_t('Form.FIELDISREQUIRED', '%s is required'), strip_tags('"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'));
89 89
 					if($msg = $formField->getCustomValidationMessage()) {
90 90
 						$errorMessage = $msg;
91 91
 					}
2  forms/TableField.php
@@ -521,7 +521,7 @@ function validate($validator) {
521 521
 						if(!trim($fieldObj->Value())){
522 522
 							$title = $fieldObj->Title();
523 523
 							$errorMessage .= sprintf(
524  
-								_t('TableField.ISREQUIRED', "In %s '%s' is required."),
  524
+								_t('TableField.ISREQUIRED', "In %s '%s' is required"),
525 525
 								$this->name,
526 526
 								$title
527 527
 							);
4  forms/Validator.php
@@ -103,10 +103,10 @@ function getErrors() {
103 103
 	function requireField($fieldName, $data) {
104 104
 		if(is_array($data[$fieldName]) && count($data[$fieldName])) {
105 105
 			foreach($data[$fieldName] as $componentkey => $componentVal){
106  
-				if(!strlen($componentVal)) $this->validationError($fieldName, "$fieldName $componentkey is required.", "required");
  106
+				if(!strlen($componentVal)) $this->validationError($fieldName, "$fieldName $componentkey is required", "required");
107 107
 			}
108 108
 			
109  
-		}else if(!strlen($data[$fieldName])) $this->validationError($fieldName, "$fieldName is required.", "required");
  109
+		}else if(!strlen($data[$fieldName])) $this->validationError($fieldName, "$fieldName is required", "required");
110 110
 	}
111 111
 	
112 112
 	/**
14  lang/en.yml
@@ -122,7 +122,7 @@ en:
122 122
   DateField:
123 123
     NOTSET: 'not set'
124 124
     TODAY: today
125  
-    VALIDDATEFORMAT2: 'Please enter a valid date format ({format}).'
  125
+    VALIDDATEFORMAT2: 'Please enter a valid date format ({format})'
126 126
     VALIDDATEMAXDATE: 'Your date has to be older or matching the maximum allowed date ({date})'
127 127
     VALIDDATEMINDATE: 'Your date has to be newer or matching the minimum allowed date ({date})'
128 128
   Director:
@@ -130,7 +130,7 @@ en:
130 130
   DropdownField:
131 131
     CHOOSE: (Choose)
132 132
   EmailField:
133  
-    VALIDATION: 'Please enter an email address.'
  133
+    VALIDATION: 'Please enter an email address'
134 134
   Email_BounceRecord:
135 135
     PLURALNAME: 'Email Bounce Records'
136 136
     SINGULARNAME: 'Email Bounce Record'
@@ -146,7 +146,7 @@ en:
146 146
     Name: Name
147 147
     PLURALNAME: Files
148 148
     SINGULARNAME: File
149  
-    TOOLARGE: 'Filesize is too large, maximum {size} allowed.'
  149
+    TOOLARGE: 'Filesize is too large, maximum {size} allowed'
150 150
     TOOLARGESHORT: 'Filesize exceeds {size}'
151 151
     Title: Title
152 152
   FileIFrameField:
@@ -170,13 +170,13 @@ en:
170 170
     TEXT3: for
171 171
   Form:
172 172
     FIELDISREQUIRED: '%s is required'
173  
-    VALIDATIONCREDITNUMBER: 'Please ensure you have entered the {number} credit card number correctly.'
  173
+    VALIDATIONCREDITNUMBER: 'Please ensure you have entered the {number} credit card number correctly'
174 174
     VALIDATIONNOTUNIQUE: 'The value entered is not unique'
175 175
     VALIDATIONPASSWORDSDONTMATCH: 'Passwords don''t match'
176 176
     VALIDATIONPASSWORDSNOTEMPTY: 'Passwords can''t be empty'
177  
-    VALIDATIONSTRONGPASSWORD: 'Passwords must have at least one digit and one alphanumeric character.'
  177
+    VALIDATIONSTRONGPASSWORD: 'Passwords must have at least one digit and one alphanumeric character'
178 178
     VALIDATOR: Validator
179  
-    VALIDCURRENCY: 'Please enter a valid currency.'
  179
+    VALIDCURRENCY: 'Please enter a valid currency'
180 180
   FormField:
181 181
     NONE: none
182 182
   GridAction:
@@ -455,7 +455,7 @@ en:
455 455
   SiteTree:
456 456
     TABMAIN: Main
457 457
   TableField:
458  
-    ISREQUIRED: 'In %s ''%s'' is required.'
  458
+    ISREQUIRED: 'In %s ''%s'' is required'
459 459
   TableField.ss:
460 460
     ADD: 'Add a new row'
461 461
   TableListField:
14  lang/en_GB.yml
@@ -98,7 +98,7 @@ en_GB:
98 98
   DropdownField:
99 99
     CHOOSE: "(Choose)"
100 100
   EmailField:
101  
-    VALIDATION: "Please enter an email address."
  101
+    VALIDATION: "Please enter an email address"
102 102
   File:
103 103
     Content: "Content"
104 104
     Filename: "Filename"
@@ -107,7 +107,7 @@ en_GB:
107 107
     Name: "Name"
108 108
     PLURALNAME: "Files"
109 109
     SINGULARNAME: "File"
110  
-    TOOLARGE: "Filesize is too large; maximum %s is allowed."
  110
+    TOOLARGE: "Filesize is too large; maximum %s is allowed"
111 111
     Title: "Title"
112 112
   ForgotPasswordEmail.ss:
113 113
     HELLO: "Hello"
@@ -115,15 +115,15 @@ en_GB:
115 115
     TEXT2: "password reset link"
116 116
     TEXT3: "for"
117 117
   Form:
118  
-    FIELDISREQUIRED: "%s is required."
119  
-    VALIDATIONCREDITNUMBER: "Please ensure you have entered the %s credit card number correctly."
  118
+    FIELDISREQUIRED: "%s is required"
  119
+    VALIDATIONCREDITNUMBER: "Please ensure you have entered the %s credit card number correctly"
120 120
     VALIDATIONFAILED: "Validation failed"
121 121
     VALIDATIONNOTUNIQUE: "The value entered is not unique"
122 122
     VALIDATIONPASSWORDSDONTMATCH: "Passwords don't match"
123 123
     VALIDATIONPASSWORDSNOTEMPTY: "Passwords can't be empty"
124  
-    VALIDATIONSTRONGPASSWORD: "Passwords must have at least one digit and one alphanumeric character."
  124
+    VALIDATIONSTRONGPASSWORD: "Passwords must have at least one digit and one alphanumeric character"
125 125
     VALIDATOR: "Validator"
126  
-    VALIDCURRENCY: "Please enter a valid currency."
  126
+    VALIDCURRENCY: "Please enter a valid currency"
127 127
   FormField:
128 128
     NONE: "none"
129 129
   Group:
@@ -265,7 +265,7 @@ en_GB:
265 265
   SiteTree:
266 266
     TABMAIN: "Main"
267 267
   TableField:
268  
-    ISREQUIRED: "In %s '%s' is required."
  268
+    ISREQUIRED: "In %s '%s' is required"
269 269
   TableField.ss:
270 270
     ADD: "Add a new row"
271 271
   TableListField:
2  tests/filesystem/UploadTest.php
@@ -335,7 +335,7 @@ public function validate() {
335 335
 			$arg = File::format_size($this->getAllowedMaxFileSize($ext));
336 336
 			$this->errors[] = _t(
337 337
 				'File.TOOLARGE', 
338  
-				'Filesize is too large, maximum {size} allowed.',
  338
+				'Filesize is too large, maximum {size} allowed',
339 339
 				'Argument 1: Filesize (e.g. 1MB)',
340 340
 				array('size' => $arg)
341 341
 			);
4  tests/forms/FormTest.php
@@ -204,14 +204,14 @@ function testSessionValidationMessage() {
204 204
 		$this->assertPartialMatchBySelector(
205 205
 			'#Email span.message',
206 206
 			array(
207  
-				_t('EmailField.VALIDATION', "Please enter an email address.")
  207
+				'Please enter an email address'
208 208
 			),
209 209
 			'Formfield validation shows note on field if invalid'
210 210
 		);
211 211
 		$this->assertPartialMatchBySelector(
212 212
 			'#SomeRequiredField span.required',
213 213
 			array(
214  
-				sprintf(_t('Form.FIELDISREQUIRED').'.','"SomeRequiredField"')
  214
+				'"SomeRequiredField" is required'
215 215
 			),
216 216
 			'Required fields show a notification on field when left blank'
217 217
 		);

0 notes on commit 5462cda

Please sign in to comment.
Something went wrong with that request. Please try again.