Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Removing "." from the end of validation messages

  • Loading branch information...
commit 5462cdaab2282e63f521f0729ad5317888ef2b4c 1 parent 7fe0858
@halkyon halkyon authored
View
2  filesystem/Upload.php
@@ -498,7 +498,7 @@ public function validate() {
$arg = File::format_size($this->getAllowedMaxFileSize($ext));
$this->errors[] = _t(
'File.TOOLARGE',
- 'Filesize is too large, maximum {size} allowed.',
+ 'Filesize is too large, maximum {size} allowed',
'Argument 1: Filesize (e.g. 1MB)',
array('size' => $arg)
);
View
2  forms/ConfirmedPasswordField.php
@@ -280,7 +280,7 @@ function validate($validator) {
if(!preg_match('/^(([a-zA-Z]+\d+)|(\d+[a-zA-Z]+))[a-zA-Z0-9]*$/',$value)) {
$validator->validationError(
'Password',
- _t('Form.VALIDATIONSTRONGPASSWORD', "Passwords must have at least one digit and one alphanumeric character."),
+ _t('Form.VALIDATIONSTRONGPASSWORD', "Passwords must have at least one digit and one alphanumeric character"),
"validation",
false
);
View
2  forms/CreditCardField.php
@@ -53,7 +53,7 @@ function validate($validator){
$this->name,
_t(
'Form.VALIDATIONCREDITNUMBER',
- "Please ensure you have entered the {number} credit card number correctly.",
+ "Please ensure you have entered the {number} credit card number correctly",
array('number' => $number)
),
"validation",
View
2  forms/CurrencyField.php
@@ -44,7 +44,7 @@ function performReadonlyTransformation() {
function validate($validator) {
if(!empty ($this->value) && !preg_match('/^\s*(\-?\$?|\$\-?)?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?\s*$/', $this->value)) {
- $validator->validationError($this->name, _t('Form.VALIDCURRENCY', "Please enter a valid currency."), "validation", false);
+ $validator->validationError($this->name, _t('Form.VALIDCURRENCY', "Please enter a valid currency"), "validation", false);
return false;
}
return true;
View
2  forms/DateField.php
@@ -311,7 +311,7 @@ function validate($validator) {
$validator->validationError(
$this->name,
_t(
- 'DateField.VALIDDATEFORMAT2', "Please enter a valid date format ({format}).",
+ 'DateField.VALIDDATEFORMAT2', "Please enter a valid date format ({format})",
array('format' => $this->getConfig('dateformat'))
),
"validation",
View
2  forms/EmailField.php
@@ -39,7 +39,7 @@ function validate($validator) {
if($this->value && !preg_match('/' . $pregSafePattern . '/i', $this->value)){
$validator->validationError(
$this->name,
- _t('EmailField.VALIDATION', "Please enter an email address."),
+ _t('EmailField.VALIDATION', "Please enter an email address"),
"validation"
);
return false;
View
2  forms/RequiredFields.php
@@ -85,7 +85,7 @@ function php($data) {
}
if($formField && $error) {
- $errorMessage = sprintf(_t('Form.FIELDISREQUIRED', '%s is required').'.', strip_tags('"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'));
+ $errorMessage = sprintf(_t('Form.FIELDISREQUIRED', '%s is required'), strip_tags('"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'));
if($msg = $formField->getCustomValidationMessage()) {
$errorMessage = $msg;
}
View
2  forms/TableField.php
@@ -521,7 +521,7 @@ function validate($validator) {
if(!trim($fieldObj->Value())){
$title = $fieldObj->Title();
$errorMessage .= sprintf(
- _t('TableField.ISREQUIRED', "In %s '%s' is required."),
+ _t('TableField.ISREQUIRED', "In %s '%s' is required"),
$this->name,
$title
);
View
4 forms/Validator.php
@@ -103,10 +103,10 @@ function getErrors() {
function requireField($fieldName, $data) {
if(is_array($data[$fieldName]) && count($data[$fieldName])) {
foreach($data[$fieldName] as $componentkey => $componentVal){
- if(!strlen($componentVal)) $this->validationError($fieldName, "$fieldName $componentkey is required.", "required");
+ if(!strlen($componentVal)) $this->validationError($fieldName, "$fieldName $componentkey is required", "required");
}
- }else if(!strlen($data[$fieldName])) $this->validationError($fieldName, "$fieldName is required.", "required");
+ }else if(!strlen($data[$fieldName])) $this->validationError($fieldName, "$fieldName is required", "required");
}
/**
View
14 lang/en.yml
@@ -122,7 +122,7 @@ en:
DateField:
NOTSET: 'not set'
TODAY: today
- VALIDDATEFORMAT2: 'Please enter a valid date format ({format}).'
+ VALIDDATEFORMAT2: 'Please enter a valid date format ({format})'
VALIDDATEMAXDATE: 'Your date has to be older or matching the maximum allowed date ({date})'
VALIDDATEMINDATE: 'Your date has to be newer or matching the minimum allowed date ({date})'
Director:
@@ -130,7 +130,7 @@ en:
DropdownField:
CHOOSE: (Choose)
EmailField:
- VALIDATION: 'Please enter an email address.'
+ VALIDATION: 'Please enter an email address'
Email_BounceRecord:
PLURALNAME: 'Email Bounce Records'
SINGULARNAME: 'Email Bounce Record'
@@ -146,7 +146,7 @@ en:
Name: Name
PLURALNAME: Files
SINGULARNAME: File
- TOOLARGE: 'Filesize is too large, maximum {size} allowed.'
+ TOOLARGE: 'Filesize is too large, maximum {size} allowed'
TOOLARGESHORT: 'Filesize exceeds {size}'
Title: Title
FileIFrameField:
@@ -170,13 +170,13 @@ en:
TEXT3: for
Form:
FIELDISREQUIRED: '%s is required'
- VALIDATIONCREDITNUMBER: 'Please ensure you have entered the {number} credit card number correctly.'
+ VALIDATIONCREDITNUMBER: 'Please ensure you have entered the {number} credit card number correctly'
VALIDATIONNOTUNIQUE: 'The value entered is not unique'
VALIDATIONPASSWORDSDONTMATCH: 'Passwords don''t match'
VALIDATIONPASSWORDSNOTEMPTY: 'Passwords can''t be empty'
- VALIDATIONSTRONGPASSWORD: 'Passwords must have at least one digit and one alphanumeric character.'
+ VALIDATIONSTRONGPASSWORD: 'Passwords must have at least one digit and one alphanumeric character'
VALIDATOR: Validator
- VALIDCURRENCY: 'Please enter a valid currency.'
+ VALIDCURRENCY: 'Please enter a valid currency'
FormField:
NONE: none
GridAction:
@@ -455,7 +455,7 @@ en:
SiteTree:
TABMAIN: Main
TableField:
- ISREQUIRED: 'In %s ''%s'' is required.'
+ ISREQUIRED: 'In %s ''%s'' is required'
TableField.ss:
ADD: 'Add a new row'
TableListField:
View
14 lang/en_GB.yml
@@ -98,7 +98,7 @@ en_GB:
DropdownField:
CHOOSE: "(Choose)"
EmailField:
- VALIDATION: "Please enter an email address."
+ VALIDATION: "Please enter an email address"
File:
Content: "Content"
Filename: "Filename"
@@ -107,7 +107,7 @@ en_GB:
Name: "Name"
PLURALNAME: "Files"
SINGULARNAME: "File"
- TOOLARGE: "Filesize is too large; maximum %s is allowed."
+ TOOLARGE: "Filesize is too large; maximum %s is allowed"
Title: "Title"
ForgotPasswordEmail.ss:
HELLO: "Hello"
@@ -115,15 +115,15 @@ en_GB:
TEXT2: "password reset link"
TEXT3: "for"
Form:
- FIELDISREQUIRED: "%s is required."
- VALIDATIONCREDITNUMBER: "Please ensure you have entered the %s credit card number correctly."
+ FIELDISREQUIRED: "%s is required"
+ VALIDATIONCREDITNUMBER: "Please ensure you have entered the %s credit card number correctly"
VALIDATIONFAILED: "Validation failed"
VALIDATIONNOTUNIQUE: "The value entered is not unique"
VALIDATIONPASSWORDSDONTMATCH: "Passwords don't match"
VALIDATIONPASSWORDSNOTEMPTY: "Passwords can't be empty"
- VALIDATIONSTRONGPASSWORD: "Passwords must have at least one digit and one alphanumeric character."
+ VALIDATIONSTRONGPASSWORD: "Passwords must have at least one digit and one alphanumeric character"
VALIDATOR: "Validator"
- VALIDCURRENCY: "Please enter a valid currency."
+ VALIDCURRENCY: "Please enter a valid currency"
FormField:
NONE: "none"
Group:
@@ -265,7 +265,7 @@ en_GB:
SiteTree:
TABMAIN: "Main"
TableField:
- ISREQUIRED: "In %s '%s' is required."
+ ISREQUIRED: "In %s '%s' is required"
TableField.ss:
ADD: "Add a new row"
TableListField:
View
2  tests/filesystem/UploadTest.php
@@ -335,7 +335,7 @@ public function validate() {
$arg = File::format_size($this->getAllowedMaxFileSize($ext));
$this->errors[] = _t(
'File.TOOLARGE',
- 'Filesize is too large, maximum {size} allowed.',
+ 'Filesize is too large, maximum {size} allowed',
'Argument 1: Filesize (e.g. 1MB)',
array('size' => $arg)
);
View
4 tests/forms/FormTest.php
@@ -204,14 +204,14 @@ function testSessionValidationMessage() {
$this->assertPartialMatchBySelector(
'#Email span.message',
array(
- _t('EmailField.VALIDATION', "Please enter an email address.")
+ 'Please enter an email address'
),
'Formfield validation shows note on field if invalid'
);
$this->assertPartialMatchBySelector(
'#SomeRequiredField span.required',
array(
- sprintf(_t('Form.FIELDISREQUIRED').'.','"SomeRequiredField"')
+ '"SomeRequiredField" is required'
),
'Required fields show a notification on field when left blank'
);
Please sign in to comment.
Something went wrong with that request. Please try again.