fix for some untranslated messages in ajax - calls

This commit is contained in:
Klaus Leithoff 2016-01-29 14:24:12 +00:00
parent ae0de2f967
commit 215baf7497
3 changed files with 16 additions and 7 deletions

View File

@ -4346,6 +4346,7 @@ class mail_ui
function ajax_flagMessages($_flag, $_messageList, $_sendJsonResponse=true) function ajax_flagMessages($_flag, $_messageList, $_sendJsonResponse=true)
{ {
if(mail_bo::$debug) error_log(__METHOD__."->".$_flag.':'.array2string($_messageList)); if(mail_bo::$debug) error_log(__METHOD__."->".$_flag.':'.array2string($_messageList));
translation::add_app('mail');
$alreadyFlagged=false; $alreadyFlagged=false;
$flag2check=''; $flag2check='';
$filter2toggle = $query = array(); $filter2toggle = $query = array();
@ -4479,18 +4480,25 @@ class mail_ui
if ($_sendJsonResponse) 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(); $response = egw_json_response::get();
if (isset($_messageList['msg']) && $_messageList['popup']) 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))) 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 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') function ajax_copyMessages($_folderName, $_messageList, $_copyOrMove='copy')
{ {
if(mail_bo::$debug) error_log(__METHOD__."->".$_folderName.':'.print_r($_messageList,true).' Method:'.$_copyOrMove); if(mail_bo::$debug) error_log(__METHOD__."->".$_folderName.':'.print_r($_messageList,true).' Method:'.$_copyOrMove);
translation::add_app('mail');
$_folderName = $this->mail_bo->decodeEntityFolderName($_folderName); $_folderName = $this->mail_bo->decodeEntityFolderName($_folderName);
// only copy or move are supported as method // only copy or move are supported as method
if (!($_copyOrMove=='copy' || $_copyOrMove=='move')) $_copyOrMove='copy'; if (!($_copyOrMove=='copy' || $_copyOrMove=='move')) $_copyOrMove='copy';

View File

@ -187,7 +187,7 @@ files mail de Anhang
flag / unflag mail de Markieren flag / unflag mail de Markieren
flag or unflag a mail mail de Markierung setzten oder entfernen flag or unflag a mail mail de Markierung setzten oder entfernen
flagged mail de markiert 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 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 %1 messages as unflagged in %2 mail de Bei %1 Nachricht(en) wurde die Markierung in %2 entfernt
flagged / unflagged mail de Markierung flagged / unflagged mail de Markierung

View File

@ -186,9 +186,9 @@ files mail en Files
flag / unflag mail en Flag / Unflag flag / unflag mail en Flag / Unflag
flag or unflag a mail mail en Flag or Unflag a mail flag or unflag a mail mail en Flag or Unflag a mail
flagged mail en flagged flagged mail en flagged
flagged %1 messages as %2 in %3 mail en flagged %1 messages as %2 in %3 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 messages as flagged in %2 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 messages as unflagged 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 flagged / unflagged mail en Flagged / Unflagged
folder mail en Folder folder mail en Folder
folder %1 %2 failed! mail en Folder %1 %2 failed! folder %1 %2 failed! mail en Folder %1 %2 failed!