From ff93176f7078c47398041c480b2f4a765b03a8dc Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 14 Oct 2008 23:07:05 +0000 Subject: [PATCH] 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 --- forms/ConfirmedFormAction.php | 11 ++++++++--- lang/de_DE.php | 2 +- lang/en_US.php | 6 ++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/forms/ConfirmedFormAction.php b/forms/ConfirmedFormAction.php index d19fb28b9..01cce6794 100755 --- a/forms/ConfirmedFormAction.php +++ b/forms/ConfirmedFormAction.php @@ -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); } diff --git a/lang/de_DE.php b/lang/de_DE.php index ff640be4f..64fdf1951 100644 --- a/lang/de_DE.php +++ b/lang/de_DE.php @@ -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?'; ?> \ No newline at end of file diff --git a/lang/en_US.php b/lang/en_US.php index a9e0aae12..16486f550 100644 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -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';