1
0
Fork 0

Finish t() for mod

finished mod folder
This commit is contained in:
Adam Magness 2018-01-22 09:16:25 -05:00
commit 407b2397cb
38 changed files with 851 additions and 810 deletions

View file

@ -12,7 +12,7 @@ use Friendica\Model\Profile;
function wallmessage_post(App $a) {
$replyto = Profile::getMyURL();
if(! $replyto) {
if (!$replyto) {
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -21,7 +21,7 @@ function wallmessage_post(App $a) {
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
$recipient = (($a->argc > 1) ? notags($a->argv[1]) : '');
if((! $recipient) || (! $body)) {
if ((! $recipient) || (! $body)) {
return;
}
@ -36,7 +36,7 @@ function wallmessage_post(App $a) {
$user = $r[0];
if(! intval($user['unkmail'])) {
if (! intval($user['unkmail'])) {
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -45,32 +45,31 @@ function wallmessage_post(App $a) {
intval($user['uid'])
);
if($r[0]['total'] > $user['cntunkmail']) {
notice( sprintf( t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
if ($r[0]['total'] > $user['cntunkmail']) {
notice(sprintf(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
return;
}
$ret = Mail::sendWall($user, $body, $subject, $replyto);
switch($ret){
switch ($ret) {
case -1:
notice(L10n::t('No recipient selected.') . EOL );
notice(L10n::t('No recipient selected.') . EOL);
break;
case -2:
notice(L10n::t('Unable to check your home location.') . EOL );
notice(L10n::t('Unable to check your home location.') . EOL);
break;
case -3:
notice(L10n::t('Message could not be sent.') . EOL );
notice(L10n::t('Message could not be sent.') . EOL);
break;
case -4:
notice(L10n::t('Message collection failure.') . EOL );
notice(L10n::t('Message collection failure.') . EOL);
break;
default:
info(L10n::t('Message sent.') . EOL );
info(L10n::t('Message sent.') . EOL);
}
goaway('profile/'.$user['nickname']);
}
@ -83,7 +82,7 @@ function wallmessage_content(App $a) {
$recipient = (($a->argc > 1) ? $a->argv[1] : '');
if(! $recipient) {
if (!$recipient) {
notice(L10n::t('No recipient.') . EOL);
return;
}
@ -100,7 +99,7 @@ function wallmessage_content(App $a) {
$user = $r[0];
if(! intval($user['unkmail'])) {
if (!intval($user['unkmail'])) {
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -109,8 +108,8 @@ function wallmessage_content(App $a) {
intval($user['uid'])
);
if($r[0]['total'] > $user['cntunkmail']) {
notice( sprintf( t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
if ($r[0]['total'] > $user['cntunkmail']) {
notice(sprintf(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
return;
}
@ -118,33 +117,33 @@ function wallmessage_content(App $a) {
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
'$linkurl' => t('Please enter a link URL:')
'$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('wallmsg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
'$linkurl' => t('Please enter a link URL:')
'$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('wallmessage.tpl');
$o .= replace_macros($tpl,[
'$header' => t('Send Private Message'),
'$subheader' => sprintf( t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
'$to' => t('To:'),
'$subject' => t('Subject:'),
$o .= replace_macros($tpl, [
'$header' => L10n::t('Send Private Message'),
'$subheader' => sprintf(L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
'$to' => L10n::t('To:'),
'$subject' => L10n::t('Subject:'),
'$recipname' => $user['username'],
'$nickname' => $user['nickname'],
'$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
'$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
'$subjtxt' => ((x($_REQUEST, 'subject')) ? strip_tags($_REQUEST['subject']) : ''),
'$text' => ((x($_REQUEST, 'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
'$readonly' => '',
'$yourmessage' => t('Your message:'),
'$yourmessage' => L10n::t('Your message:'),
'$select' => $select,
'$parent' => '',
'$upload' => t('Upload photo'),
'$insert' => t('Insert web link'),
'$wait' => t('Please wait')
'$upload' => L10n::t('Upload photo'),
'$insert' => L10n::t('Insert web link'),
'$wait' => L10n::t('Please wait')
]);
return $o;