ENHANCEMENT Making confirmation message in ConfirmedFormAction translatable

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64252 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-10-14 23:07:05 +00:00
parent 3b16fe9b59
commit ff93176f70
3 changed files with 15 additions and 4 deletions

View File

@ -12,11 +12,16 @@ class ConfirmedFormAction extends FormAction {
* Create a new action button.
* @param action The method to call when the button is clicked
* @param title The label on the button
* @param confirmation The message to display in the confirmation box?
* @param confirmation The message to display in the confirmation box
* @param form The parent form, auto-set when the field is placed inside a form
*/
function __construct($action, $title = "", $confirmation = "Are you sure?", $form = null) {
$this->confirmation = $confirmation;
function __construct($action, $title = "", $confirmation = null, $form = null) {
if($confirmation) {
$this->confirmation = $confirmation;
} else {
$this->confirmation = _t('ConfirmedFormAction.CONFIRMATION', "Are you sure?", PR_MEDIUM, 'Confirmation popup before executing the form action');
}
parent::__construct($action, $title, $form);
}

View File

@ -461,5 +461,5 @@ $lang['de_DE']['TypeDropdown']['NONE'] = 'Keine';
$lang['de_DE']['VirtualPage']['CHOOSE'] = 'Wählen Sie eine Seite auf die Sie verweisen möchten';
$lang['de_DE']['VirtualPage']['EDITCONTENT'] = 'drücken Sie hier um den Inhalt abzuändern';
$lang['de_DE']['VirtualPage']['HEADER'] = 'Dies ist eine virtuelle Seite';
$lang['de_DE']['ConfirmedFormAction']['CONFIRMATION'] = 'Sind Sie sicher?';
?>

View File

@ -205,6 +205,11 @@ $lang['en_US']['CompositeDateField']['YEARJS'] = 'year';
$lang['en_US']['Form']['VALIDATIONALLDATEVALUES'] = 'Please ensure you have set all date values';
$lang['en_US']['Form']['DATENOTSET'] = '(No date set)';
$lang['en_US']['Form']['NOTSET'] = '(not set)';
$lang['en_US']['ConfirmedFormAction']['CONFIRMATION'] = array(
'Are you sure?',
PR_MEDIUM,
'Confirmation popup before executing the form action'
);
$lang['en_US']['Member']['CONFIRMPASSWORD'] = 'Confirm Password';
$lang['en_US']['ConfirmedPasswordField']['HAVETOMATCH'] = 'Passwords have to match.';
$lang['en_US']['ConfirmedPasswordField']['NOEMPTY'] = 'Passwords can\'t be empty.';
@ -531,6 +536,7 @@ $lang['en_US']['Security']['ENCRYPTWITHOUTSALT'] = 'without using a salt to incr
$lang['en_US']['Security']['ENCRYPTEDMEMBERS'] = 'Encrypted credentials for member "';
$lang['en_US']['Security']['ID'] = 'ID:';
$lang['en_US']['Security']['EMAIL'] = 'E-Mail:';
$lang['en_US']['EmailField']['VALIDATION'] = 'Please enter an email address.';
$lang['en_US']['SecurityAdmin']['CODE'] = 'Code';
$lang['en_US']['SecurityAdmin']['OPTIONALID'] = 'Optional ID';
$lang['en_US']['ComplexTableField.ss']['SORTASC'] = 'Sort ascending';