From 215baf74978f16d3f49f2f36ef296333b78c843a Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 29 Jan 2016 14:24:12 +0000 Subject: [PATCH] fix for some untranslated messages in ajax - calls --- mail/inc/class.mail_ui.inc.php | 15 ++++++++++++--- mail/lang/egw_de.lang | 2 +- mail/lang/egw_en.lang | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 60b836e21e..013cb346a7 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -4346,6 +4346,7 @@ class mail_ui function ajax_flagMessages($_flag, $_messageList, $_sendJsonResponse=true) { if(mail_bo::$debug) error_log(__METHOD__."->".$_flag.':'.array2string($_messageList)); + translation::add_app('mail'); $alreadyFlagged=false; $flag2check=''; $filter2toggle = $query = array(); @@ -4479,18 +4480,25 @@ class mail_ui if ($_sendJsonResponse) { + $flag=array( + 'label1' => 'important',//lang('important'), + 'label2' => 'job', //lang('job'), + 'label3' => 'personal',//lang('personal'), + 'label4' => 'to do', //lang('to do'), + 'label5' => 'later', //lang('later'), + ); $response = egw_json_response::get(); if (isset($_messageList['msg']) && $_messageList['popup']) { - $response->call('egw.refresh',lang('flagged %1 message as %2 in %3',$_messageList['msg'],lang($_flag),$folder),'mail', $_messageList['msg'], 'update'); + $response->call('egw.refresh',lang('flagged %1 messages as %2 in %3',$_messageList['msg'],lang(($flag[$_flag]?$flag[$_flag]:$_flag)),$folder),'mail', $_messageList['msg'], 'update'); } else if ((isset($_messageList['all']) && $_messageList['all']) || ($query['filter'] && ($flag2check==$query['filter'] || stripos($query['filter'],$flag2check)!==false))) { - $response->call('egw.refresh',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang($_flag),$folder),'mail'); + $response->call('egw.refresh',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang(($flag[$_flag]?$flag[$_flag]:$_flag)),$folder),'mail'); } else { - $response->call('egw.message',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang($_flag),$folder)); + $response->call('egw.message',lang('flagged %1 messages as %2 in %3',(isset($_messageList['all']) && $_messageList['all']?lang('all'):count($_messageList['msg'])),lang(($flag[$_flag]?$flag[$_flag]:$_flag)),$folder)); } } } @@ -4608,6 +4616,7 @@ class mail_ui function ajax_copyMessages($_folderName, $_messageList, $_copyOrMove='copy') { if(mail_bo::$debug) error_log(__METHOD__."->".$_folderName.':'.print_r($_messageList,true).' Method:'.$_copyOrMove); + translation::add_app('mail'); $_folderName = $this->mail_bo->decodeEntityFolderName($_folderName); // only copy or move are supported as method if (!($_copyOrMove=='copy' || $_copyOrMove=='move')) $_copyOrMove='copy'; diff --git a/mail/lang/egw_de.lang b/mail/lang/egw_de.lang index 03a04dae11..0777d93628 100644 --- a/mail/lang/egw_de.lang +++ b/mail/lang/egw_de.lang @@ -187,7 +187,7 @@ files mail de Anhang flag / unflag mail de Markieren flag or unflag a mail mail de Markierung setzten oder entfernen flagged mail de markiert -flagged %1 messages as %2 in %3 mail de %1 Nachrichten wurden als %2 in %3 markiert +flagged %1 messages as %2 in %3 mail de %1 Nachricht(en) wurden als %2 in %3 markiert flagged %1 messages as flagged in %2 mail de %1 Nachricht(en) markiert in %2 flagged %1 messages as unflagged in %2 mail de Bei %1 Nachricht(en) wurde die Markierung in %2 entfernt flagged / unflagged mail de Markierung diff --git a/mail/lang/egw_en.lang b/mail/lang/egw_en.lang index 048fd8bce9..fd675b56ed 100644 --- a/mail/lang/egw_en.lang +++ b/mail/lang/egw_en.lang @@ -186,9 +186,9 @@ files mail en Files flag / unflag mail en Flag / Unflag flag or unflag a mail mail en Flag or Unflag a mail flagged mail en flagged -flagged %1 messages as %2 in %3 mail en flagged %1 messages as %2 in %3 -flagged %1 messages as flagged in %2 mail en flagged %1 messages as flagged in %2 -flagged %1 messages as unflagged in %2 mail en flagged %1 messages as unflagged in %2 +flagged %1 messages as %2 in %3 mail en flagged %1 message(s) as %2 in %3 +flagged %1 messages as flagged in %2 mail en flagged %1 message(s) as flagged in %2 +flagged %1 messages as unflagged in %2 mail en flagged %1 message(s) as unflagged in %2 flagged / unflagged mail en Flagged / Unflagged folder mail en Folder folder %1 %2 failed! mail en Folder %1 %2 failed!