Permalink
Browse files

translate french to english

  • Loading branch information...
1 parent 941129b commit c296eeac78e1031189ff6985fe462349ceceb03a @lenybernard lenybernard committed Sep 25, 2012
Showing with 25 additions and 30 deletions.
  1. +4 −1 config/app.yml
  2. +17 −17 lib/form/formSlotEditForm.class.php
  3. +4 −12 modules/formSlot/actions/actions.class.php
View
5 config/app.yml
@@ -1,6 +1,9 @@
all:
- form:
+ formSlot:
+ default_email_address: "contact@star.war"
+ default_email_label: "Anakin"
customer_mail_author: "Anakin Skywalker"
customer_mail_footer: "please don't print this email unless you really need to"
+ website_domain: "appventus.com"
recaptcha:
public_key: "azertyuiopqsdfghjklmwxcvbn1234567890"
View
34 lib/form/formSlotEditForm.class.php
@@ -67,13 +67,13 @@ public function configure()
$this->setValidators(
array(
'title' => new sfValidatorString(array('required' => false)),
- 'attachment_url' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
- 'attachment_url_2' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
- 'attachment_url_3' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
- 'attachment_url_4' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
- 'attachment_url_5' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
- 'attachment_url_6' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
- 'attachment_url_7' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/patrimea.com\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://patrimea.com/uploads")),
+ 'attachment_url' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
+ 'attachment_url_2' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
+ 'attachment_url_3' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
+ 'attachment_url_4' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
+ 'attachment_url_5' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
+ 'attachment_url_6' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
+ 'attachment_url_7' => new sfValidatorRegex(array('required' => false,'pattern'=>'/^http:\/\/'.sfConfig::get('app_formSlot_website_domain').'\/uploads(.)+/'),array('invalid'=>"L'adresse du fichier doit commencer par http://'.sfConfig::get('app_formSlot_website_domain').'/uploads")),
'target_email' => new sfValidatorEmail(array('required' => false)),
'message' => new sfValidatorString(array('required' => false)),
'subject' => new sfValidatorString(array('required' => false)),
@@ -84,26 +84,26 @@ public function configure()
);
$this->widgetSchema->setLabels(
array(
- 'title' => 'Titre',
- 'attachment_url' => 'Fichiers joints',
+ 'title' => 'Title',
+ 'attachment_url' => 'Attachments',
'attachment_url_2' => ' ',
'attachment_url_3' => ' ',
'attachment_url_4' => ' ',
'attachment_url_5' => ' ',
'attachment_url_6' => ' ',
'attachment_url_7' => ' ',
- 'subject' => "Sujet de l'email de confirmation",
- 'target_email' => 'Votre email',
- 'message' => 'Contenu du message',
- 'auto_answer' => 'Réponse automatique ?',
- 'captcha' => 'Système anti-spam ?',
+ 'subject' => "Confirmation email subject",
+ 'target_email' => 'Admin email',
+ 'message' => 'Message content',
+ 'auto_answer' => 'Automatic answer ?',
+ 'captcha' => 'Anti-spam enabled ?',
)
);
$this->widgetSchema->setHelps(
array(
- 'title' => 'Le titre apparaitra en haut du formulaire',
- 'attachment_url_5' => 'Fournissez l\'url des fichiers à inclure dans le mail (doivent commencer par http://patrimea.com/uploads/)',
- 'message' => 'Vous pouvez y insérer des variable entre accolades. <br/>Par exemple, pour insérer le prénom du sondé, il faut écrire {prenom}',
+ 'title' => 'The title will be displayed in the top of the form',
+ 'attachment_url_5' => 'Give the url of the files to attach in the automatic email (must begin by http://'.sfConfig::get('app_formSlot_website_domain').'/uploads/)',
+ 'message' => 'You can insert variables between double accolade. <br/>For example, to insert the form filler firstname, you should write {{firstname}}. Easy mode huu ?',
)
);
View
16 modules/formSlot/actions/actions.class.php
@@ -37,7 +37,7 @@ public function executeVerify(sfWebRequest $request) {
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
//Errors : incorrect-captcha-sol
- $errors = array("incorrect-captcha-sol"=>"Le module antispam n'a pas été remplis correctement. Merci de réessayer.");
+ $errors = array("incorrect-captcha-sol"=>"The antispam filter didn't filled properly. Please retry.");
return $this->renderText(json_encode(array("data"=>"<div class='alert alert-error' style='padding:5px;margin:5px 0;text-align:center;'>".$errors[$resp->error]."</div>","update"=>"captcha-error-".$request->getParameter("formId"),"callbackjs"=>"$('#canvasloader-container').fadeOut();Recaptcha.reload();")));
} else {
return $this->renderText(json_encode(array("success"=>true,"callbackjs"=>"makeUpForm('".$request->getParameter("formId")."');")));
@@ -60,11 +60,6 @@ public function executeAddFormAnswer(sfWebRequest $request) {
}
}
- $defensio = new Defensio(sfConfig::get('app_defensio_key'));
- $content = !empty($data['Message'])?$data['Message']:(!empty($data['Contenu'])?$data['Contenu']:(!empty($data['Remarque'])?$data['Remarque']:implode(',',$data)));
- $document = array('type' => 'article', 'content' => $content, 'author_email'=> $data['Email'],'author_name'=>$data['Prénom']." ".$data['Nom'],'client'=>'avDefensioPlugin | 1.0 | Leny Bernard | leny@appventus.com','platform' => 'patrimea_contact', 'async' => 'true');
- $result = $defensio->postDocument($document);
- if($result[1]->allow && strlen($content)>10 ){
if (!empty($taintedValues['target_email'])) {
if(Utils::check_email_address($taintedValues['target_email'])){
@@ -79,7 +74,7 @@ public function executeAddFormAnswer(sfWebRequest $request) {
sfConfig::get('app_formSlot_default_email_label')
);
$message->setFrom($from);
- $message->setSubject("Contact Site Internet");
+ $message->setSubject("Contact");
$message->setBody($this->getPartial('formSlot/managerMailTemplate',
array(
'title' => $taintedValues['title'],
@@ -91,7 +86,7 @@ public function executeAddFormAnswer(sfWebRequest $request) {
echo $exc->getTraceAsString();
}
}else{
- $this->getUser()->setFlash("error","L'email entré n'est pas correct");
+ $this->getUser()->setFlash("error","The email entered is not correct");
}
}
@@ -131,7 +126,7 @@ public function executeAddFormAnswer(sfWebRequest $request) {
)), 'text/html');
foreach(array('attachment_url','attachment_url_2','attachment_url_3','attachment_url_4','attachment_url_5','attachment_url_6','attachment_url_7') as $field){
if(!empty($taintedValues[$field])){
- $taintedValues[$field] = preg_replace("/^http:\/\/patrimea.com/", "", $taintedValues[$field]);
+ $taintedValues[$field] = preg_replace("/^http:\/\/".sfConfig::get('app_formSlot_website_domain')."/", "", $taintedValues[$field]);
$filenameParts = explode("/",$taintedValues[$field]);
$filename = preg_replace("/.original/","",$filenameParts[count($filenameParts)-1]);
if(file_exists(sfConfig::get('sf_web_dir').$taintedValues[$field])){
@@ -151,9 +146,6 @@ public function executeAddFormAnswer(sfWebRequest $request) {
$this->getUser()->setFlash("error","The entered email ".$taintedValues['questions']['email'][0]." is incorrect");
}
}
- }else{
- $this->getUser()->setFlash("error","Our antispam system blocked your message");
- }
$this->redirect($request->getReferer());
}

0 comments on commit c296eea

Please sign in to comment.