mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Removed direct sprintf() usage from _t() calls
Parameterized strings are easier to understand, and more fail-proof, don't fatal out when not enough sprintf() args
This commit is contained in:
parent
c054ab49a2
commit
661a4a2492
@ -85,8 +85,15 @@ class RequiredFields extends Validator {
|
||||
}
|
||||
|
||||
if($formField && $error) {
|
||||
$errorMessage = sprintf(_t('Form.FIELDISREQUIRED', '%s is required'),
|
||||
strip_tags('"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'));
|
||||
$errorMessage = _t(
|
||||
'Form.FIELDISREQUIRED',
|
||||
'{name} is required',
|
||||
array(
|
||||
'name' => strip_tags(
|
||||
'"' . ($formField->Title() ? $formField->Title() : $fieldName) . '"'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if($msg = $formField->getCustomValidationMessage()) {
|
||||
$errorMessage = $msg;
|
||||
|
@ -412,10 +412,16 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
|
||||
|
||||
// TODO Save this item into the given relationship
|
||||
|
||||
$message = sprintf(
|
||||
_t('GridFieldDetailForm.Saved', 'Saved %s %s'),
|
||||
$this->record->singular_name(),
|
||||
'<a href="' . $this->Link('edit') . '">"' . htmlspecialchars($this->record->Title, ENT_QUOTES) . '"</a>'
|
||||
$link = '<a href="' . $this->Link('edit') . '">"'
|
||||
. htmlspecialchars($this->record->Title, ENT_QUOTES)
|
||||
. '"</a>';
|
||||
$message = _t(
|
||||
'GridFieldDetailForm.Saved',
|
||||
'Saved {name} {link}',
|
||||
array(
|
||||
'name' => $this->record->singular_name(),
|
||||
'link' => $link
|
||||
)
|
||||
);
|
||||
|
||||
$form->sessionMessage($message, 'good');
|
||||
|
@ -1,6 +1,5 @@
|
||||
en:
|
||||
AssetAdmin:
|
||||
ALLOWEDEXTS: 'Allowed extensions'
|
||||
NEWFOLDER: NewFolder
|
||||
AssetTableField:
|
||||
CREATED: 'First uploaded'
|
||||
@ -198,7 +197,7 @@ en:
|
||||
TEXT2: 'password reset link'
|
||||
TEXT3: for
|
||||
Form:
|
||||
FIELDISREQUIRED: '%s is required'
|
||||
FIELDISREQUIRED: '{name} is required'
|
||||
SubmitBtnLabel: Go
|
||||
VALIDATIONCREDITNUMBER: 'Please ensure you have entered the {number} credit card number correctly'
|
||||
VALIDATIONNOTUNIQUE: 'The value entered is not unique'
|
||||
@ -237,7 +236,9 @@ en:
|
||||
DeletePermissionsFailure: 'No delete permissions'
|
||||
Deleted: 'Deleted %s %s'
|
||||
Save: Save
|
||||
Saved: 'Saved %s %s'
|
||||
Saved: 'Saved {name} {link}'
|
||||
GridFieldEditButton.ss:
|
||||
EDIT: Edit
|
||||
GridFieldItemEditView.ss:
|
||||
'Go back': 'Go back'
|
||||
Group:
|
||||
@ -368,6 +369,7 @@ en:
|
||||
NEWPASSWORD: 'New Password'
|
||||
PASSWORD: Password
|
||||
PLURALNAME: Members
|
||||
PROFILESAVESUCCESS: 'Successfully saved.'
|
||||
REMEMBERME: 'Remember me next time?'
|
||||
SINGULARNAME: Member
|
||||
SUBJECTPASSWORDCHANGED: 'Your password has been changed'
|
||||
|
Loading…
Reference in New Issue
Block a user