MINOR Switching _t() calls from sprintf() to using injection parameters (#7170)

This commit is contained in:
Ingo Schommer 2012-05-01 21:44:54 +02:00
parent e949b6f2b0
commit 7b18d9d0da
24 changed files with 228 additions and 235 deletions

View File

@ -70,17 +70,17 @@ class GroupImportForm extends Form {
// result message // result message
$msgArr = array(); $msgArr = array();
if($result->CreatedCount()) $msgArr[] = sprintf( if($result->CreatedCount()) $msgArr[] = _t(
_t('GroupImportForm.ResultCreated', 'Created %d groups'), 'GroupImportForm.ResultCreated', 'Created {count} groups',
$result->CreatedCount() array('count' => $result->CreatedCount())
); );
if($result->UpdatedCount()) $msgArr[] = sprintf( if($result->UpdatedCount()) $msgArr[] = _t(
_t('GroupImportForm.ResultUpdated', 'Updated %d groups'), 'GroupImportForm.ResultUpdated', 'Updated %d groups',
$result->UpdatedCount() array('count' => $result->UpdatedCount())
); );
if($result->DeletedCount()) $msgArr[] = sprintf( if($result->DeletedCount()) $msgArr[] = _t(
_t('GroupImportForm.ResultDeleted', 'Deleted %d groups'), 'GroupImportForm.ResultDeleted', 'Deleted %d groups',
$result->DeletedCount() array('count' => $result->DeletedCount())
); );
$msg = ($msgArr) ? implode(',', $msgArr) : _t('MemberImportForm.ResultNone', 'No changes'); $msg = ($msgArr) ? implode(',', $msgArr) : _t('MemberImportForm.ResultNone', 'No changes');

View File

@ -1299,12 +1299,12 @@ class LeftAndMain extends Controller implements PermissionProvider {
$title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class)); $title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class));
$perms["CMS_ACCESS_" . $class] = array( $perms["CMS_ACCESS_" . $class] = array(
'name' => sprintf(_t( 'name' => _t(
'CMSMain.ACCESS', 'CMSMain.ACCESS',
"Access to '%s' section", "Access to '{title}' section",
"Item in permission selection identifying the admin section. Example: Access to 'Files & Images'",
"Item in permission selection identifying the admin section. Example: Access to 'Files & Images'" array('title' => $title)
), $title, null), ),
'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access') 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')
); );
} }

View File

@ -75,17 +75,17 @@ class MemberImportForm extends Form {
// result message // result message
$msgArr = array(); $msgArr = array();
if($result->CreatedCount()) $msgArr[] = sprintf( if($result->CreatedCount()) $msgArr[] = _t(
_t('MemberImportForm.ResultCreated', 'Created %d members'), 'MemberImportForm.ResultCreated', 'Created {count} members',
$result->CreatedCount() array('count' => $result->CreatedCount())
); );
if($result->UpdatedCount()) $msgArr[] = sprintf( if($result->UpdatedCount()) $msgArr[] = _t(
_t('MemberImportForm.ResultUpdated', 'Updated %d members'), 'MemberImportForm.ResultUpdated', 'Updated {count} members',
$result->UpdatedCount() array('count' => $result->UpdatedCount())
); );
if($result->DeletedCount()) $msgArr[] = sprintf( if($result->DeletedCount()) $msgArr[] = _t(
_t('MemberImportForm.ResultDeleted', 'Deleted %d members'), 'MemberImportForm.ResultDeleted', 'Deleted %d members',
$result->DeletedCount() array('count' => $result->DeletedCount())
); );
$msg = ($msgArr) ? implode(',', $msgArr) : _t('MemberImportForm.ResultNone', 'No changes'); $msg = ($msgArr) ? implode(',', $msgArr) : _t('MemberImportForm.ResultNone', 'No changes');

View File

@ -376,17 +376,17 @@ abstract class ModelAdmin extends LeftAndMain {
$results = $loader->load($_FILES['_CsvFile']['tmp_name']); $results = $loader->load($_FILES['_CsvFile']['tmp_name']);
$message = ''; $message = '';
if($results->CreatedCount()) $message .= sprintf( if($results->CreatedCount()) $message .= _t(
_t('ModelAdmin.IMPORTEDRECORDS', "Imported %s records."), 'ModelAdmin.IMPORTEDRECORDS', "Imported {count} records.",
$results->CreatedCount() array('count' => $results->CreatedCount())
); );
if($results->UpdatedCount()) $message .= sprintf( if($results->UpdatedCount()) $message .= _t(
_t('ModelAdmin.UPDATEDRECORDS', "Updated %s records."), 'ModelAdmin.UPDATEDRECORDS', "Updated {count} records.",
$results->UpdatedCount() array('count' => $results->UpdatedCount())
); );
if($results->DeletedCount()) $message .= sprintf( if($results->DeletedCount()) $message .= _t(
_t('ModelAdmin.DELETEDRECORDS', "Deleted %s records."), 'ModelAdmin.DELETEDRECORDS', "Deleted {count} records.",
$results->DeletedCount() array('count' => $results->DeletedCount())
); );
if(!$results->CreatedCount() && !$results->UpdatedCount()) $message .= _t('ModelAdmin.NOIMPORT', "Nothing to import"); if(!$results->CreatedCount() && !$results->UpdatedCount()) $message .= _t('ModelAdmin.NOIMPORT', "Nothing to import");

View File

@ -219,7 +219,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$title = _t("SecurityAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class)); $title = _t("SecurityAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return array( return array(
"CMS_ACCESS_SecurityAdmin" => array( "CMS_ACCESS_SecurityAdmin" => array(
'name' => sprintf(_t('CMSMain.ACCESS', "Access to '%s' section"), $title), 'name' => _t('CMSMain.ACCESS', "Access to '{title}' section", array('title' => $title)),
'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'), 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'),
'help' => _t( 'help' => _t(
'SecurityAdmin.ACCESS_HELP', 'SecurityAdmin.ACCESS_HELP',

View File

@ -496,28 +496,22 @@ class Upload_Validator {
if(!$this->isValidSize()) { if(!$this->isValidSize()) {
$ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : ''; $ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : '';
$arg = File::format_size($this->getAllowedMaxFileSize($ext)); $arg = File::format_size($this->getAllowedMaxFileSize($ext));
$this->errors[] = sprintf( $this->errors[] = _t(
_t(
'File.TOOLARGE', 'File.TOOLARGE',
'Filesize is too large, maximum %s allowed.', 'Filesize is too large, maximum {size} allowed.',
'Argument 1: Filesize (e.g. 1MB)',
'Argument 1: Filesize (e.g. 1MB)' array('size' => $arg)
),
$arg
); );
return false; return false;
} }
// extension validation // extension validation
if(!$this->isValidExtension()) { if(!$this->isValidExtension()) {
$this->errors[] = sprintf( $this->errors[] = _t(
_t(
'File.INVALIDEXTENSION', 'File.INVALIDEXTENSION',
'Extension is not allowed (valid: %s)', 'Extension is not allowed (valid: {extensions})',
'Argument 1: Comma-separated list of valid extensions',
'Argument 1: Comma-separated list of valid extensions' array('extensions' => wordwrap(implode(', ', $this->allowedExtensions)))
),
wordwrap(implode(', ', $this->allowedExtensions))
); );
return false; return false;
} }

View File

@ -485,12 +485,11 @@ JS;
$editLink = Controller::join_links($this->Link(), 'item/' . $childData->ID . '/edit'); $editLink = Controller::join_links($this->Link(), 'item/' . $childData->ID . '/edit');
$message = sprintf( $message = _t(
_t('ComplexTableField.SUCCESSADD', 'Added %s %s %s'), 'ComplexTableField.SUCCESSADD2', 'Added {name}',
$childData->singular_name(), array('name' => $childData->singular_name())
'<a href="' . $editLink . '">' . $childData->Title . '</a>',
$closeLink
); );
$message .= '<a href="' . $editLink . '">' . $childData->Title . '</a>' . $closeLink;
$form->sessionMessage($message, 'good'); $form->sessionMessage($message, 'good');

View File

@ -247,13 +247,25 @@ class ConfirmedPasswordField extends FormField {
if(($this->minLength || $this->maxLength)) { if(($this->minLength || $this->maxLength)) {
if($this->minLength && $this->maxLength) { if($this->minLength && $this->maxLength) {
$limit = "{{$this->minLength},{$this->maxLength}}"; $limit = "{{$this->minLength},{$this->maxLength}}";
$errorMsg = sprintf(_t('ConfirmedPasswordField.BETWEEN', 'Passwords must be %s to %s characters long.'), $this->minLength, $this->maxLength); $errorMsg = _t(
'ConfirmedPasswordField.BETWEEN',
'Passwords must be {min} to {max} characters long.',
array('min' => $this->minLength, 'max' => $this->maxLength)
);
} elseif($this->minLength) { } elseif($this->minLength) {
$limit = "{{$this->minLength}}.*"; $limit = "{{$this->minLength}}.*";
$errorMsg = sprintf(_t('ConfirmedPasswordField.ATLEAST', 'Passwords must be at least %s characters long.'), $this->minLength); $errorMsg = _t(
'ConfirmedPasswordField.ATLEAST',
'Passwords must be at least {min} characters long.',
array('min' => $this->minLength)
);
} elseif($this->maxLength) { } elseif($this->maxLength) {
$limit = "{0,{$this->maxLength}}"; $limit = "{0,{$this->maxLength}}";
$errorMsg = sprintf(_t('ConfirmedPasswordField.MAXIMUM', 'Passwords must be at most %s characters long.'), $this->maxLength); $errorMsg = _t(
'ConfirmedPasswordField.MAXIMUM',
'Passwords must be at most {max} characters long.',
array('max' => $this->maxLength)
);
} }
$limitRegex = '/^.' . $limit . '$/'; $limitRegex = '/^.' . $limit . '$/';
if(!empty($value) && !preg_match($limitRegex,$value)) { if(!empty($value) && !preg_match($limitRegex,$value)) {

View File

@ -51,9 +51,10 @@ class CreditCardField extends TextField {
} }
$validator->validationError( $validator->validationError(
$this->name, $this->name,
sprintf( _t(
_t('Form.VALIDATIONCREDITNUMBER', "Please ensure you have entered the %s credit card number correctly."), 'Form.VALIDATIONCREDITNUMBER',
$number "Please ensure you have entered the {number} credit card number correctly.",
array('number' => $number)
), ),
"validation", "validation",
false false

View File

@ -310,9 +310,9 @@ class DateField extends TextField {
if(!$valid) { if(!$valid) {
$validator->validationError( $validator->validationError(
$this->name, $this->name,
sprintf( _t(
_t('DateField.VALIDDATEFORMAT2', "Please enter a valid date format (%s)."), 'DateField.VALIDDATEFORMAT2', "Please enter a valid date format ({format}).",
$this->getConfig('dateformat') array('format' => $this->getConfig('dateformat'))
), ),
"validation", "validation",
false false
@ -331,9 +331,9 @@ class DateField extends TextField {
if(!$this->valueObj->isLater($minDate) && !$this->valueObj->equals($minDate)) { if(!$this->valueObj->isLater($minDate) && !$this->valueObj->equals($minDate)) {
$validator->validationError( $validator->validationError(
$this->name, $this->name,
sprintf( _t(
_t('DateField.VALIDDATEMINDATE', "Your date has to be newer or matching the minimum allowed date (%s)"), 'DateField.VALIDDATEMINDATE', "Your date has to be newer or matching the minimum allowed date ({date})",
$minDate->toString($this->getConfig('dateformat')) array('date' => $minDate->toString($this->getConfig('dateformat')))
), ),
"validation", "validation",
false false
@ -351,9 +351,9 @@ class DateField extends TextField {
if(!$this->valueObj->isEarlier($maxDate) && !$this->valueObj->equals($maxDate)) { if(!$this->valueObj->isEarlier($maxDate) && !$this->valueObj->equals($maxDate)) {
$validator->validationError( $validator->validationError(
$this->name, $this->name,
sprintf( _t(
_t('DateField.VALIDDATEMAXDATE', "Your date has to be older or matching the maximum allowed date (%s)"), 'DateField.VALIDDATEMAXDATE', "Your date has to be older or matching the maximum allowed date ({date})",
$maxDate->toString($this->getConfig('dateformat')) array('date' => $maxDate->toString($this->getConfig('dateformat')))
), ),
"validation", "validation",
false false

View File

@ -92,9 +92,11 @@ class FileIFrameField extends FileField {
) )
); );
} else { } else {
return sprintf(_t ( return _t(
'FileIFrameField.ATTACHONCESAVED', '%ss can be attached once you have saved the record for the first time.' 'FileIFrameField.ATTACHONCESAVED',
), $this->FileTypeName()); '{type}s can be attached once you have saved the record for the first time.',
array('type' => $this->FileTypeName())
);
} }
} }
@ -130,9 +132,9 @@ class FileIFrameField extends FileField {
$selectFile = _t('FileIFrameField.FROMFILESTORE', 'From the File Store'); $selectFile = _t('FileIFrameField.FROMFILESTORE', 'From the File Store');
if($this->AttachedFile() && $this->AttachedFile()->ID) { if($this->AttachedFile() && $this->AttachedFile()->ID) {
$title = sprintf(_t('FileIFrameField.REPLACE', 'Replace %s'), $this->FileTypeName()); $title = _t('FileIFrameField.REPLACE', 'Replace {type}', array('type' => $this->FileTypeName()));
} else { } else {
$title = sprintf(_t('FileIFrameField.ATTACH', 'Attach %s'), $this->FileTypeName()); $title = _t('FileIFrameField.ATTACH', 'Attach {type}', array('type' => $this->FileTypeName()));
} }
$fileSources = array(); $fileSources = array();
@ -235,7 +237,7 @@ class FileIFrameField extends FileField {
), ),
new FieldList ( new FieldList (
$deleteButton = new FormAction ( $deleteButton = new FormAction (
'delete', sprintf(_t('FileIFrameField.DELETE', 'Delete %s'), $this->FileTypeName()) 'delete', _t('FileIFrameField.DELETE', 'Delete {type}', array('type' => $this->FileTypeName()))
) )
) )
); );

View File

@ -16,9 +16,9 @@ class NumericField extends TextField{
if($this->value && !is_numeric(trim($this->value))){ if($this->value && !is_numeric(trim($this->value))){
$validator->validationError( $validator->validationError(
$this->name, $this->name,
sprintf( _t(
_t('NumericField.VALIDATION', "'%s' is not a number, only numbers can be accepted for this field"), 'NumericField.VALIDATION', "'{value}' is not a number, only numbers can be accepted for this field",
$this->value array('value' => $this->value)
), ),
"validation" "validation"
); );

View File

@ -143,9 +143,9 @@ class TimeField extends TextField {
if(!Zend_Date::isDate($this->value, $this->getConfig('timeformat'), $this->locale)) { if(!Zend_Date::isDate($this->value, $this->getConfig('timeformat'), $this->locale)) {
$validator->validationError( $validator->validationError(
$this->name, $this->name,
sprintf( _t(
_t('TimeField.VALIDATEFORMAT', "Please enter a valid time format (%s)"), 'TimeField.VALIDATEFORMAT', "Please enter a valid time format ({format})",
$this->getConfig('timeformat') array('format' => $this->getConfig('timeformat'))
), ),
"validation", "validation",
false false

View File

@ -348,23 +348,26 @@ class UploadField extends FileField {
if (count($this->getValidator()->getAllowedExtensions())) { if (count($this->getValidator()->getAllowedExtensions())) {
$allowedExtensions = $this->getValidator()->getAllowedExtensions(); $allowedExtensions = $this->getValidator()->getAllowedExtensions();
$config['acceptFileTypes'] = '(\.|\/)(' . implode('|', $allowedExtensions) . ')$'; $config['acceptFileTypes'] = '(\.|\/)(' . implode('|', $allowedExtensions) . ')$';
$config['errorMessages']['acceptFileTypes'] = sprintf(_t( $config['errorMessages']['acceptFileTypes'] = _t(
'File.INVALIDEXTENSION', 'File.INVALIDEXTENSION',
'Extension is not allowed (valid: %s)' 'Extension is not allowed (valid: {extensions})',
), wordwrap(implode(', ', $allowedExtensions))); array('extensions' => wordwrap(implode(', ', $allowedExtensions)))
);
} }
if ($this->getValidator()->getAllowedMaxFileSize()) { if ($this->getValidator()->getAllowedMaxFileSize()) {
$config['maxFileSize'] = $this->getValidator()->getAllowedMaxFileSize(); $config['maxFileSize'] = $this->getValidator()->getAllowedMaxFileSize();
$config['errorMessages']['maxFileSize'] = sprintf(_t( $config['errorMessages']['maxFileSize'] = _t(
'File.TOOLARGE', 'File.TOOLARGE',
'Filesize is too large, maximum %s allowed.' 'Filesize is too large, maximum {size} allowed.',
), File::format_size($config['maxFileSize'])); array('size' => File::format_size($config['maxFileSize']))
);
} }
if ($config['maxNumberOfFiles'] > 1) { if ($config['maxNumberOfFiles'] > 1) {
$config['errorMessages']['maxNumberOfFiles'] = sprintf(_t( $config['errorMessages']['maxNumberOfFiles'] = _t(
'UploadField.MAXNUMBEROFFILES', 'UploadField.MAXNUMBEROFFILES',
'Max number of %s file(s) exceeded.' 'Max number of {count} file(s) exceeded.',
), $config['maxNumberOfFiles']); array('count' => $config['maxNumberOfFiles'])
);
} }
$configOverwrite = array(); $configOverwrite = array();
if (is_numeric($config['maxNumberOfFiles']) && $this->getItems()->count()) { if (is_numeric($config['maxNumberOfFiles']) && $this->getItems()->count()) {
@ -459,10 +462,11 @@ class UploadField extends FileField {
// Report the constraint violation. // Report the constraint violation.
if ($tooManyFiles) { if ($tooManyFiles) {
if(!$this->getConfig('allowedMaxFileNumber')) $this->setConfig('allowedMaxFileNumber', 1); if(!$this->getConfig('allowedMaxFileNumber')) $this->setConfig('allowedMaxFileNumber', 1);
$return['error'] = sprintf(_t( $return['error'] = _t(
'UploadField.MAXNUMBEROFFILES', 'UploadField.MAXNUMBEROFFILES',
'Max number of %s file(s) exceeded.' 'Max number of {count} file(s) exceeded.',
), $this->getConfig('allowedMaxFileNumber')); array('count' => $this->getConfig('allowedMaxFileNumber'))
);
} }
} }

View File

@ -251,15 +251,15 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
if($label) $labels[] = $label; if($label) $labels[] = $label;
} }
if($labels) { if($labels) {
return sprintf( return _t(
_t('GridField.PlaceHolderWithLabels', 'Find %s by %s', 'Find <object type> by <field names>'), 'GridField.PlaceHolderWithLabels',
singleton($dataClass)->plural_name(), 'Find {type} by {name}',
implode(', ', $labels) array('type' => singleton($dataClass)->plural_name(), 'name' => implode(', ', $labels))
); );
} else { } else {
return sprintf( return _t(
_t('GridField.PlaceHolder', 'Find %s', 'Find <object type>'), 'GridField.PlaceHolder', 'Find {type}',
singleton($dataClass)->plural_name() array('type' => singleton($dataClass)->plural_name())
); );
} }
} }

View File

@ -55,7 +55,7 @@ en:
NO: No NO: No
YES: Yes YES: Yes
CMSMain: CMSMain:
ACCESS: 'Access to ''%s'' section' ACCESS: 'Access to ''{title}'' section'
ACCESSALLINTERFACES: 'Access to all CMS sections' ACCESSALLINTERFACES: 'Access to all CMS sections'
ACCESSALLINTERFACESHELP: 'Overrules more specific access settings.' ACCESSALLINTERFACESHELP: 'Overrules more specific access settings.'
SAVE: Save SAVE: Save
@ -72,7 +72,7 @@ en:
YES: Yes YES: Yes
ComplexTableField: ComplexTableField:
CLOSEPOPUP: 'Close Popup' CLOSEPOPUP: 'Close Popup'
SUCCESSADD: 'Added %s %s %s' SUCCESSADD2: 'Added {name}'
SUCCESSEDIT: 'Saved %s %s %s' SUCCESSEDIT: 'Saved %s %s %s'
SUCCESSEDIT2: 'Deleted %s %s' SUCCESSEDIT2: 'Deleted %s %s'
ComplexTableField.ss: ComplexTableField.ss:
@ -83,9 +83,9 @@ en:
NEXT: Next NEXT: Next
PREVIOUS: Previous PREVIOUS: Previous
ConfirmedPasswordField: ConfirmedPasswordField:
ATLEAST: 'Passwords must be at least %s characters long.' ATLEAST: 'Passwords must be at least {min} characters long.'
BETWEEN: 'Passwords must be %s to %s characters long.' BETWEEN: 'Passwords must be {min} to {max} characters long.'
MAXIMUM: 'Passwords must be at most %s characters long.' MAXIMUM: 'Passwords must be at most {max} characters long.'
SHOWONCLICKTITLE: 'Change Password' SHOWONCLICKTITLE: 'Change Password'
CreditCardField: CreditCardField:
FIRST: first FIRST: first
@ -108,16 +108,16 @@ en:
MONTHS: ' months' MONTHS: ' months'
SEC: ' sec' SEC: ' sec'
SECS: ' secs' SECS: ' secs'
TIMEDIFFAGO: '%s ago' TIMEDIFFAGO: '{difference} ago'
TIMEDIFFIN: 'in %s' TIMEDIFFIN: 'in {difference}'
YEAR: ' year' YEAR: ' year'
YEARS: ' years' YEARS: ' years'
DateField: DateField:
NOTSET: 'not set' NOTSET: 'not set'
TODAY: today TODAY: today
VALIDDATEFORMAT2: 'Please enter a valid date format (%s).' VALIDDATEFORMAT2: 'Please enter a valid date format ({format}).'
VALIDDATEMAXDATE: 'Your date has to be older or matching the maximum allowed date (%s)' 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 (%s)' VALIDDATEMINDATE: 'Your date has to be newer or matching the minimum allowed date ({date})'
DropdownField: DropdownField:
CHOOSE: (Choose) CHOOSE: (Choose)
EmailField: EmailField:
@ -130,24 +130,24 @@ en:
File: File:
Content: Content Content: Content
Filename: Filename Filename: Filename
INVALIDEXTENSION: 'Extension is not allowed (valid: %s)' INVALIDEXTENSION: 'Extension is not allowed (valid: {extensions})'
NOFILESIZE: 'Filesize is zero bytes.' NOFILESIZE: 'Filesize is zero bytes.'
NOVALIDUPLOAD: 'File is not a valid upload' NOVALIDUPLOAD: 'File is not a valid upload'
Name: Name Name: Name
PLURALNAME: Files PLURALNAME: Files
SINGULARNAME: File SINGULARNAME: File
TOOLARGE: 'Filesize is too large, maximum %s allowed.' TOOLARGE: 'Filesize is too large, maximum {size} allowed.'
Title: Title Title: Title
FileIFrameField: FileIFrameField:
ATTACH: 'Attach %s' ATTACH: 'Attach {type}'
ATTACHONCESAVED: '%ss can be attached once you have saved the record for the first time.' ATTACHONCESAVED: '{type}s can be attached once you have saved the record for the first time.'
DELETE: 'Delete %s' DELETE: 'Delete {type}'
DISALLOWEDFILETYPE: 'This filetype is not allowed to be uploaded' DISALLOWEDFILETYPE: 'This filetype is not allowed to be uploaded'
FILE: File FILE: File
FROMCOMPUTER: 'From your Computer' FROMCOMPUTER: 'From your Computer'
FROMFILESTORE: 'From the File Store' FROMFILESTORE: 'From the File Store'
NOSOURCE: 'Please select a source file to attach' NOSOURCE: 'Please select a source file to attach'
REPLACE: 'Replace %s' REPLACE: 'Replace {type}'
FileIFrameField_iframe.ss: FileIFrameField_iframe.ss:
TITLE: 'Image Uploading Iframe' TITLE: 'Image Uploading Iframe'
ForgotPasswordEmail.ss: ForgotPasswordEmail.ss:
@ -157,8 +157,7 @@ en:
TEXT3: for TEXT3: for
Form: Form:
FIELDISREQUIRED: '%s is required' FIELDISREQUIRED: '%s is required'
VALIDATIONCREDITNUMBER: 'Please ensure you have entered the %s credit card number correctly.' VALIDATIONCREDITNUMBER: 'Please ensure you have entered the {number} credit card number correctly.'
VALIDATIONFAILED: 'Validation failed'
VALIDATIONNOTUNIQUE: 'The value entered is not unique' VALIDATIONNOTUNIQUE: 'The value entered is not unique'
VALIDATIONPASSWORDSDONTMATCH: 'Passwords don''t match' VALIDATIONPASSWORDSDONTMATCH: 'Passwords don''t match'
VALIDATIONPASSWORDSNOTEMPTY: 'Passwords can''t be empty' VALIDATIONPASSWORDSNOTEMPTY: 'Passwords can''t be empty'
@ -179,8 +178,8 @@ en:
NoItemsFound: 'No items found' NoItemsFound: 'No items found'
PRINTEDAT: 'Printed at' PRINTEDAT: 'Printed at'
PRINTEDBY: 'Printed by' PRINTEDBY: 'Printed by'
PlaceHolder: 'Find %s' PlaceHolder: 'Find {type}'
PlaceHolderWithLabels: 'Find %s by %s' PlaceHolderWithLabels: 'Find {type} by {name}'
RelationSearch: 'Relation search' RelationSearch: 'Relation search'
ResetFilter: Reset ResetFilter: Reset
GridFieldAction_Delete: GridFieldAction_Delete:
@ -209,16 +208,17 @@ en:
GroupImportForm: GroupImportForm:
Help1: '<p>Import one or more groups in <em>CSV</em> format (comma-separated values). <small><a href="#" class="toggle-advanced">Show advanced usage</a></small></p>' Help1: '<p>Import one or more groups in <em>CSV</em> format (comma-separated values). <small><a href="#" class="toggle-advanced">Show advanced usage</a></small></p>'
Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing groups are matched by their unique <em>Code</em> value, and updated with any new values from the imported file</li>\n <li>Group hierarchies can be created by using a <em>ParentCode</em> column.</li>\n <li>Permission codes can be assigned by the <em>PermissionCode</em> column. Existing permission codes are not cleared.</li>\n </ul>\n</div>" Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing groups are matched by their unique <em>Code</em> value, and updated with any new values from the imported file</li>\n <li>Group hierarchies can be created by using a <em>ParentCode</em> column.</li>\n <li>Permission codes can be assigned by the <em>PermissionCode</em> column. Existing permission codes are not cleared.</li>\n </ul>\n</div>"
ResultCreated: 'Created %d groups' ResultCreated: 'Created {count} groups'
ResultDeleted: 'Deleted %d groups' ResultDeleted: 'Deleted %d groups'
ResultUpdated: 'Updated %d groups' ResultUpdated: 'Updated %d groups'
Hierarchy: Hierarchy:
InfiniteLoopNotAllowed: 'Infinite loop found within the "%s" hierarchy. Please change the parent to resolve this' InfiniteLoopNotAllowed: 'Infinite loop found within the "{type}" hierarchy. Please change the parent to resolve this'
HtmlEditorField: HtmlEditorField:
ANCHORVALUE: Anchor ANCHORVALUE: Anchor
BUTTONINSERT: Insert BUTTONINSERT: Insert
BUTTONINSERTLINK: 'Insert link' BUTTONINSERTLINK: 'Insert link'
BUTTONREMOVELINK: 'Remove link' BUTTONREMOVELINK: 'Remove link'
BUTTONUpdate: Update
CAPTIONTEXT: 'Caption text' CAPTIONTEXT: 'Caption text'
CSSCLASS: 'Alignment / style' CSSCLASS: 'Alignment / style'
CSSCLASSCENTER: 'Centered, on its own.' CSSCLASSCENTER: 'Centered, on its own.'
@ -233,12 +233,12 @@ en:
FROMCMS: 'From the CMS' FROMCMS: 'From the CMS'
FROMCOMPUTER: 'From your computer' FROMCOMPUTER: 'From your computer'
Find: Find Find: Find
IMAGE: 'Insert Image'
IMAGEALTTEXT: 'Alternative text (alt) - shown if image cannot be displayed' IMAGEALTTEXT: 'Alternative text (alt) - shown if image cannot be displayed'
IMAGEDIMENSIONS: Dimensions IMAGEDIMENSIONS: Dimensions
IMAGEHEIGHTPX: Height IMAGEHEIGHTPX: Height
IMAGETITLE: 'Title text (tooltip) - for additional information about the image' IMAGETITLE: 'Title text (tooltip) - for additional information about the image'
IMAGEWIDTHPX: Width IMAGEWIDTHPX: Width
INSERTIMAGE: 'Insert Image'
LINK: 'Insert Link' LINK: 'Insert Link'
LINKANCHOR: 'Anchor on this page' LINKANCHOR: 'Anchor on this page'
LINKDESCR: 'Link description' LINKDESCR: 'Link description'
@ -250,6 +250,7 @@ en:
LINKTO: 'Link to' LINKTO: 'Link to'
PAGE: Page PAGE: Page
URL: URL URL: URL
UpdateIMAGE: 'Update Image'
ImageField: ImageField:
IMAGE: Image IMAGE: Image
Image_iframe.ss: Image_iframe.ss:
@ -270,6 +271,7 @@ en:
IP: 'IP Address' IP: 'IP Address'
Status: Status Status: Status
Member: Member:
ADDGROUP: 'Add group'
ADDRESS: Address ADDRESS: Address
BUTTONCHANGEPASSWORD: 'Change Password' BUTTONCHANGEPASSWORD: 'Change Password'
BUTTONLOGIN: 'Log in' BUTTONLOGIN: 'Log in'
@ -293,8 +295,8 @@ en:
FIRSTNAME: 'First Name' FIRSTNAME: 'First Name'
GREETING: Welcome GREETING: Welcome
INTERFACELANG: 'Interface Language' INTERFACELANG: 'Interface Language'
INVALIDNEWPASSWORD: 'We couldn''t accept that password: %s' INVALIDNEWPASSWORD: 'We couldn''t accept that password: {password}'
LOGGEDINAS: 'You''re logged in as %s.' LOGGEDINAS: 'You''re logged in as {name}.'
MOBILE: Mobile MOBILE: Mobile
NAME: Name NAME: Name
NEWPASSWORD: 'New Password' NEWPASSWORD: 'New Password'
@ -308,8 +310,8 @@ en:
SUBJECTPASSWORDRESET: 'Your password reset link' SUBJECTPASSWORDRESET: 'Your password reset link'
SURNAME: Surname SURNAME: Surname
VALIDATIONMEMBEREXISTS: 'A member already exists with the same %s' VALIDATIONMEMBEREXISTS: 'A member already exists with the same %s'
ValidationIdentifierFailed: 'Can''t overwrite existing member #%d with identical identifier (%s = %s))' ValidationIdentifierFailed: 'Can''t overwrite existing member #{id} with identical identifier ({name} = {value}))'
WELCOMEBACK: 'Welcome Back, %s' WELCOMEBACK: 'Welcome Back, {firstname}'
YOUROLDPASSWORD: 'Your old password' YOUROLDPASSWORD: 'Your old password'
belongs_many_many_Groups: Groups belongs_many_many_Groups: Groups
db_LastVisited: 'Last Visited Date' db_LastVisited: 'Last Visited Date'
@ -343,37 +345,37 @@ en:
MemberImportForm: MemberImportForm:
Help1: '<p>Import users in <em>CSV format</em> (comma-separated values). <small><a href="#" class="toggle-advanced">Show advanced usage</a></small></p>' Help1: '<p>Import users in <em>CSV format</em> (comma-separated values). <small><a href="#" class="toggle-advanced">Show advanced usage</a></small></p>'
Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing users are matched by their unique <em>Code</em> property, and updated with any new values from the imported file.</li>\n <li>Groups can be assigned by the <em>Groups</em> column. Groups are identified by their <em>Code</em> property, multiple groups can be separated by comma. Existing group memberships are not cleared.</li>\n </ul>\n</div>" Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing users are matched by their unique <em>Code</em> property, and updated with any new values from the imported file.</li>\n <li>Groups can be assigned by the <em>Groups</em> column. Groups are identified by their <em>Code</em> property, multiple groups can be separated by comma. Existing group memberships are not cleared.</li>\n </ul>\n</div>"
ResultCreated: 'Created %d members' ResultCreated: 'Created {count} members'
ResultDeleted: 'Deleted %d members' ResultDeleted: 'Deleted %d members'
ResultNone: 'No changes' ResultNone: 'No changes'
ResultUpdated: 'Updated %d members' ResultUpdated: 'Updated {count} members'
MemberTableField: MemberTableField:
'APPLY FILTER': 'Apply Filter' 'APPLY FILTER': 'Apply Filter'
ModelAdmin: ModelAdmin:
DELETE: Delete DELETE: Delete
DELETEDRECORDS: 'Deleted %s records.' DELETEDRECORDS: 'Deleted {count} records.'
IMPORT: 'Import from CSV' IMPORT: 'Import from CSV'
IMPORTEDRECORDS: 'Imported %s records.' IMPORTEDRECORDS: 'Imported {count} records.'
NOCSVFILE: 'Please browse for a CSV file to import' NOCSVFILE: 'Please browse for a CSV file to import'
NOIMPORT: 'Nothing to import' NOIMPORT: 'Nothing to import'
RESET: Reset RESET: Reset
UPDATEDRECORDS: 'Updated %s records.' UPDATEDRECORDS: 'Updated {count} records.'
MoneyField: MoneyField:
FIELDLABELAMOUNT: Amount FIELDLABELAMOUNT: Amount
FIELDLABELCURRENCY: Currency FIELDLABELCURRENCY: Currency
NullableField: NullableField:
IsNullLabel: 'Is Null' IsNullLabel: 'Is Null'
NumericField: NumericField:
VALIDATION: '''%s'' is not a number, only numbers can be accepted for this field' VALIDATION: '''{value}'' is not a number, only numbers can be accepted for this field'
Permission: Permission:
AdminGroup: Administrator AdminGroup: Administrator
CMS_ACCESS_CATEGORY: 'CMS Access' CMS_ACCESS_CATEGORY: 'CMS Access'
FULLADMINRIGHTS: 'Full administrative rights' FULLADMINRIGHTS: 'Full administrative rights'
FULLADMINRIGHTS_HELP: 'Implies and overrules all other assigned permissions.' FULLADMINRIGHTS_HELP: 'Implies and overrules all other assigned permissions.'
PermissionCheckboxSetField: PermissionCheckboxSetField:
AssignedTo: 'assigned to "%s"' AssignedTo: 'assigned to "{title}"'
FromGroup: 'inherited from group "%s"' FromGroup: 'inherited from group "{title}"'
FromRole: 'inherited from role "%s"' FromRole: 'inherited from role "{title}"'
FromRoleOnGroup: 'inherited from role "%s" on group "%s"' FromRoleOnGroup: 'inherited from role "%s" on group "%s"'
Permissions: Permissions:
PERMISSIONS_CATEGORY: 'Roles and access permissions' PERMISSIONS_CATEGORY: 'Roles and access permissions'
@ -391,10 +393,10 @@ en:
LOGGEDOUT: 'You have been logged out. If you would like to log in again, enter your credentials below.' LOGGEDOUT: 'You have been logged out. If you would like to log in again, enter your credentials below.'
LOGIN: 'Log in' LOGIN: 'Log in'
NOTEPAGESECURED: 'That page is secured. Enter your credentials below and we will send you right along.' NOTEPAGESECURED: 'That page is secured. Enter your credentials below and we will send you right along.'
NOTERESETLINKINVALID: '<p>The password reset link is invalid or expired.</p><p>You can request a new one <a href="%s">here</a> or change your password after you <a href="%s">logged in</a>.</p>' NOTERESETLINKINVALID: '<p>The password reset link is invalid or expired.</p><p>You can request a new one <a href="{link1}">here</a> or change your password after you <a href="{link2}">logged in</a>.</p>'
NOTERESETPASSWORD: 'Enter your e-mail address and we will send you a link with which you can reset your password' NOTERESETPASSWORD: 'Enter your e-mail address and we will send you a link with which you can reset your password'
PASSWORDSENTHEADER: 'Password reset link sent to ''%s''' PASSWORDSENTHEADER: 'Password reset link sent to ''{email}'''
PASSWORDSENTTEXT: 'Thank you! A reset link has been sent to ''%s'', provided an account exists for this email address.' PASSWORDSENTTEXT: 'Thank you! A reset link has been sent to ''{email}'', provided an account exists for this email address.'
SecurityAdmin: SecurityAdmin:
ACCESS_HELP: 'Allow viewing, adding and editing users, as well as assigning permissions and roles to them.' ACCESS_HELP: 'Allow viewing, adding and editing users, as well as assigning permissions and roles to them.'
APPLY_ROLES: 'Apply roles to groups' APPLY_ROLES: 'Apply roles to groups'
@ -440,7 +442,7 @@ en:
TextareaField_Readonly.ss: TextareaField_Readonly.ss:
NONE: none NONE: none
TimeField: TimeField:
VALIDATEFORMAT: 'Please enter a valid time format (%s)' VALIDATEFORMAT: 'Please enter a valid time format ({format})'
ToggleCompositeField.ss: ToggleCompositeField.ss:
HIDE: Hide HIDE: Hide
SHOW: Show SHOW: Show
@ -459,7 +461,7 @@ en:
FIELDNOTSET: 'File information not found' FIELDNOTSET: 'File information not found'
FROMCOMPUTER: 'From your computer' FROMCOMPUTER: 'From your computer'
FROMFILES: 'From files' FROMFILES: 'From files'
MAXNUMBEROFFILES: 'Max number of %s file(s) exceeded.' MAXNUMBEROFFILES: 'Max number of {count} file(s) exceeded.'
REMOVEERROR: 'Error removing file' REMOVEERROR: 'Error removing file'
REMOVEINFO: 'Remove this file from here, but do not delete it from the file store' REMOVEINFO: 'Remove this file from here, but do not delete it from the file store'
STARTALL: 'Start all' STARTALL: 'Start all'

View File

@ -44,13 +44,11 @@ class Hierarchy extends DataExtension {
if ($node->ParentID==$this->owner->ID) { if ($node->ParentID==$this->owner->ID) {
// Hierarchy is looping. // Hierarchy is looping.
$validationResult->error( $validationResult->error(
sprintf(
_t( _t(
'Hierarchy.InfiniteLoopNotAllowed', 'Hierarchy.InfiniteLoopNotAllowed',
'Infinite loop found within the "%s" hierarchy. Please change the parent to resolve this', 'Infinite loop found within the "{type}" hierarchy. Please change the parent to resolve this',
'First argument is the class that makes up the hierarchy.' 'First argument is the class that makes up the hierarchy.',
), array('type' => $this->owner->class)
$this->owner->class
), ),
'INFINITE_LOOP' 'INFINITE_LOOP'
); );

View File

@ -191,24 +191,18 @@ class Date extends DBField {
function Ago() { function Ago() {
if($this->value) { if($this->value) {
if(strtotime($this->value) == time() || time() > strtotime($this->value)) { if(strtotime($this->value) == time() || time() > strtotime($this->value)) {
return sprintf( return _t(
_t(
'Date.TIMEDIFFAGO', 'Date.TIMEDIFFAGO',
"%s ago", "{difference} ago",
'Natural language time difference, e.g. 2 hours ago',
'Natural language time difference, e.g. 2 hours ago' array('difference' => $this->TimeDiff())
),
$this->TimeDiff()
); );
} else { } else {
return sprintf( return _t(
_t(
'Date.TIMEDIFFIN', 'Date.TIMEDIFFIN',
"in %s", "in {difference}",
'Natural language time difference, e.g. in 2 hours',
'Natural language time difference, e.g. in 2 hours' array('difference' => $this->TimeDiff())
),
$this->TimeDiff()
); );
} }
} }

View File

@ -117,7 +117,11 @@ class ChangePasswordForm extends Form {
} else { } else {
$this->clearMessage(); $this->clearMessage();
$this->sessionMessage( $this->sessionMessage(
sprintf(_t('Member.INVALIDNEWPASSWORD', "We couldn't accept that password: %s"), nl2br("\n".$isValid->starredList())), _t(
'Member.INVALIDNEWPASSWORD',
"We couldn't accept that password: {password}",
array('password' => nl2br("\n".$isValid->starredList()))
),
"bad" "bad"
); );
Director::redirectBack(); Director::redirectBack();

View File

@ -626,16 +626,15 @@ class Member extends DataObject implements TemplateGlobalProvider {
) )
); );
if($existingRecord) { if($existingRecord) {
throw new ValidationException(new ValidationResult(false, sprintf( throw new ValidationException(new ValidationResult(false, _t(
_t(
'Member.ValidationIdentifierFailed', 'Member.ValidationIdentifierFailed',
'Can\'t overwrite existing member #%d with identical identifier (%s = %s))', 'Can\'t overwrite existing member #{id} with identical identifier ({name} = {value}))',
'The values in brackets show a fieldname mapped to a value, usually denoting an existing email address',
'The values in brackets show a fieldname mapped to a value, usually denoting an existing email address' array(
), 'id' => $existingRecord->ID,
$existingRecord->ID, 'name' => $identifierField,
$identifierField, 'value' => $this->$identifierField
$this->$identifierField )
))); )));
} }
} }
@ -1624,12 +1623,10 @@ class Member_Validator extends RequiredFields {
$uniqueField = $this->form->dataFieldByName($identifierField); $uniqueField = $this->form->dataFieldByName($identifierField);
$this->validationError( $this->validationError(
$uniqueField->id(), $uniqueField->id(),
sprintf(
_t( _t(
'Member.VALIDATIONMEMBEREXISTS', 'Member.VALIDATIONMEMBEREXISTS',
'A member already exists with the same %s' 'A member already exists with the same %s',
), array('identifier' => strtolower($identifierField))
strtolower($identifierField)
), ),
'required' 'required'
); );

View File

@ -105,7 +105,11 @@ JS
protected function getMessageFromSession() { protected function getMessageFromSession() {
parent::getMessageFromSession(); parent::getMessageFromSession();
if(($member = Member::currentUser()) && !Session::get('MemberLoginForm.force_message')) { if(($member = Member::currentUser()) && !Session::get('MemberLoginForm.force_message')) {
$this->message = sprintf(_t('Member.LOGGEDINAS', "You're logged in as %s."), $member->{$this->loggedInAsField}); $this->message = _t(
'Member.LOGGEDINAS',
"You're logged in as {name}.",
array('name' => $member->{$this->loggedInAsField})
);
} }
Session::set('MemberLoginForm.force_message', false); Session::set('MemberLoginForm.force_message', false);
} }
@ -198,7 +202,7 @@ JS
} }
Session::set('Security.Message.message', Session::set('Security.Message.message',
sprintf(_t('Member.WELCOMEBACK', "Welcome Back, %s"), $firstname) _t('Member.WELCOMEBACK', "Welcome Back, {firstname}", array('firstname' => $firstname))
); );
Session::set("Security.Message.type", "good"); Session::set("Security.Message.type", "good");
} }

View File

@ -96,9 +96,9 @@ class PermissionCheckboxSetField extends FormField {
$relationMethod = $this->name; $relationMethod = $this->name;
foreach($record->$relationMethod() as $permission) { foreach($record->$relationMethod() as $permission) {
if(!isset($uninheritedCodes[$permission->Code])) $uninheritedCodes[$permission->Code] = array(); if(!isset($uninheritedCodes[$permission->Code])) $uninheritedCodes[$permission->Code] = array();
$uninheritedCodes[$permission->Code][] = sprintf( $uninheritedCodes[$permission->Code][] = _t(
_t('PermissionCheckboxSetField.AssignedTo', 'assigned to "%s"'), 'PermissionCheckboxSetField.AssignedTo', 'assigned to "{title}"',
$record->Title array('title' => $record->Title)
); );
} }
@ -110,14 +110,11 @@ class PermissionCheckboxSetField extends FormField {
foreach($record->Roles() as $role) { foreach($record->Roles() as $role) {
foreach($role->Codes() as $code) { foreach($role->Codes() as $code) {
if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array(); if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array();
$inheritedCodes[$code->Code][] = sprintf( $inheritedCodes[$code->Code][] = _t(
_t(
'PermissionCheckboxSetField.FromRole', 'PermissionCheckboxSetField.FromRole',
'inherited from role "%s"', 'inherited from role "{title}"',
'A permission inherited from a certain permission role',
'A permission inherited from a certain permission role' array('title' => $role->Title)
),
$role->Title
); );
} }
} }
@ -132,15 +129,11 @@ class PermissionCheckboxSetField extends FormField {
if ($role->Codes()) { if ($role->Codes()) {
foreach($role->Codes() as $code) { foreach($role->Codes() as $code) {
if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array(); if (!isset($inheritedCodes[$code->Code])) $inheritedCodes[$code->Code] = array();
$inheritedCodes[$code->Code][] = sprintf( $inheritedCodes[$code->Code][] = _t(
_t(
'PermissionCheckboxSetField.FromRoleOnGroup', 'PermissionCheckboxSetField.FromRoleOnGroup',
'inherited from role "%s" on group "%s"', 'inherited from role "%s" on group "%s"',
'A permission inherited from a role on a certain group',
'A permission inherited from a role on a certain group' array('roletitle' => $role->Title, 'grouptitle' => $parent->Title)
),
$role->Title,
$parent->Title
); );
} }
} }
@ -149,14 +142,11 @@ class PermissionCheckboxSetField extends FormField {
foreach($parent->Permissions() as $permission) { foreach($parent->Permissions() as $permission) {
if (!isset($inheritedCodes[$permission->Code])) $inheritedCodes[$permission->Code] = array(); if (!isset($inheritedCodes[$permission->Code])) $inheritedCodes[$permission->Code] = array();
$inheritedCodes[$permission->Code][] = $inheritedCodes[$permission->Code][] =
sprintf(
_t( _t(
'PermissionCheckboxSetField.FromGroup', 'PermissionCheckboxSetField.FromGroup',
'inherited from group "%s"', 'inherited from group "{title}"',
'A permission inherited from a certain group',
'A permission inherited from a certain group' array('title' => $parent->Title)
),
$parent->Title
); );
} }
} }

View File

@ -494,10 +494,10 @@ class Security extends Controller {
$email = Convert::raw2xml(rawurldecode($request->param('ID')) . '.' . $request->getExtension()); $email = Convert::raw2xml(rawurldecode($request->param('ID')) . '.' . $request->getExtension());
$customisedController = $controller->customise(array( $customisedController = $controller->customise(array(
'Title' => sprintf(_t('Security.PASSWORDSENTHEADER', "Password reset link sent to '%s'"), $email), 'Title' => _t('Security.PASSWORDSENTHEADER', "Password reset link sent to '{email}'", array('email' => $email)),
'Content' => 'Content' =>
"<p>" . "<p>" .
sprintf(_t('Security.PASSWORDSENTTEXT', "Thank you! A reset link has been sent to '%s', provided an account exists for this email address."), $email) . _t('Security.PASSWORDSENTTEXT', "Thank you! A reset link has been sent to '{email}', provided an account exists for this email address.", array('email' => $email)) .
"</p>", "</p>",
'Email' => $email 'Email' => $email
)); ));
@ -571,12 +571,10 @@ class Security extends Controller {
if(isset($_REQUEST['h'])) { if(isset($_REQUEST['h'])) {
$customisedController = $controller->customise( $customisedController = $controller->customise(
array('Content' => array('Content' =>
sprintf( _t(
_t('Security.NOTERESETLINKINVALID', 'Security.NOTERESETLINKINVALID',
'<p>The password reset link is invalid or expired.</p><p>You can request a new one <a href="%s">here</a> or change your password after you <a href="%s">logged in</a>.</p>' '<p>The password reset link is invalid or expired.</p><p>You can request a new one <a href="{link1}">here</a> or change your password after you <a href="{link2}">logged in</a>.</p>',
), array('link1' => $this->Link('lostpassword'), 'link2' => $this->link('login'))
$this->Link('lostpassword'),
$this->link('login')
) )
) )
); );

View File

@ -333,28 +333,22 @@ class UploadTest_Validator extends Upload_Validator implements TestOnly {
if(!$this->isValidSize()) { if(!$this->isValidSize()) {
$ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : ''; $ext = (isset($pathInfo['extension'])) ? $pathInfo['extension'] : '';
$arg = File::format_size($this->getAllowedMaxFileSize($ext)); $arg = File::format_size($this->getAllowedMaxFileSize($ext));
$this->errors[] = sprintf( $this->errors[] = _t(
_t(
'File.TOOLARGE', 'File.TOOLARGE',
'Filesize is too large, maximum %s allowed.', 'Filesize is too large, maximum {size} allowed.',
'Argument 1: Filesize (e.g. 1MB)',
'Argument 1: Filesize (e.g. 1MB)' array('size' => $arg)
),
$arg
); );
return false; return false;
} }
// extension validation // extension validation
if(!$this->isValidExtension()) { if(!$this->isValidExtension()) {
$this->errors[] = sprintf( $this->errors[] = _t(
_t(
'File.INVALIDEXTENSION', 'File.INVALIDEXTENSION',
'Extension is not allowed (valid: %s)', 'Extension is not allowed (valid: {extensions})',
'Argument 1: Comma-separated list of valid extensions',
'Argument 1: Comma-separated list of valid extensions' array('extensions' => implode(',', $this->allowedExtensions))
),
implode(',', $this->allowedExtensions)
); );
return false; return false;
} }