Browse Source

Finish t() for mod

finished mod folder
pull/4312/head
Adam Magness 4 years ago
parent
commit
407b2397cb
  1. 58
      mod/invite.php
  2. 49
      mod/localtime.php
  3. 11
      mod/lockview.php
  4. 34
      mod/lostpass.php
  5. 8
      mod/manage.php
  6. 12
      mod/match.php
  7. 74
      mod/message.php
  8. 34
      mod/network.php
  9. 53
      mod/newmember.php
  10. 6
      mod/nogroup.php
  11. 45
      mod/notes.php
  12. 78
      mod/notifications.php
  13. 22
      mod/notify.php
  14. 166
      mod/photos.php
  15. 7
      mod/ping.php
  16. 14
      mod/poke.php
  17. 13
      mod/probe.php
  18. 8
      mod/profile.php
  19. 44
      mod/profile_photo.php
  20. 186
      mod/profiles.php
  21. 10
      mod/profperm.php
  22. 48
      mod/register.php
  23. 13
      mod/removeme.php
  24. 18
      mod/search.php
  25. 390
      mod/settings.php
  26. 15
      mod/subthread.php
  27. 20
      mod/suggest.php
  28. 15
      mod/tagger.php
  29. 10
      mod/tagrm.php
  30. 11
      mod/uexport.php
  31. 15
      mod/uimport.php
  32. 22
      mod/unfollow.php
  33. 20
      mod/videos.php
  34. 32
      mod/viewcontacts.php
  35. 16
      mod/wall_attach.php
  36. 18
      mod/wall_upload.php
  37. 57
      mod/wallmessage.php
  38. 23
      mod/webfinger.php

58
mod/invite.php

@ -21,26 +21,26 @@ function invite_post(App $a) {
check_form_security_token_redirectOnErr('/', 'send_invite');
$max_invites = intval(Config::get('system','max_invites'));
$max_invites = intval(Config::get('system', 'max_invites'));
if (! $max_invites) {
$max_invites = 50;
}
$current_invites = intval(PConfig::get(local_user(),'system','sent_invites'));
$current_invites = intval(PConfig::get(local_user(), 'system', 'sent_invites'));
if ($current_invites > $max_invites) {
notice(L10n::t('Total invitation limit exceeded.') . EOL);
return;
}
$recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : []);
$message = ((x($_POST,'message')) ? notags(trim($_POST['message'])) : '');
$recips = ((x($_POST, 'recipients')) ? explode("\n", $_POST['recipients']) : []);
$message = ((x($_POST, 'message')) ? notags(trim($_POST['message'])) : '');
$total = 0;
if (Config::get('system','invitation_only')) {
if (Config::get('system', 'invitation_only')) {
$invonly = true;
$x = PConfig::get(local_user(),'system','invites_remaining');
$x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ((! $x) && (! is_site_admin())) {
return;
}
@ -51,13 +51,13 @@ function invite_post(App $a) {
$recip = trim($recip);
if (! valid_email($recip)) {
notice( sprintf( t('%s : Not a valid email address.'), $recip) . EOL);
notice(sprintf(L10n::t('%s : Not a valid email address.'), $recip) . EOL);
continue;
}
if ($invonly && ($x || is_site_admin())) {
$code = autoname(8) . srand(1000,9999);
$nmessage = str_replace('$invite_code',$code,$message);
$code = autoname(8) . srand(1000, 9999);
$nmessage = str_replace('$invite_code', $code, $message);
$r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
dbesc($code),
@ -67,7 +67,7 @@ function invite_post(App $a) {
if (! is_site_admin()) {
$x --;
if ($x >= 0) {
PConfig::set(local_user(),'system','invites_remaining',$x);
PConfig::set(local_user(), 'system', 'invites_remaining', $x);
} else {
return;
}
@ -76,7 +76,7 @@ function invite_post(App $a) {
$nmessage = $message;
}
$res = mail($recip, Email::encodeHeader(t('Please join us on Friendica'),'UTF-8'),
$res = mail($recip, Email::encodeHeader(L10n::t('Please join us on Friendica'), 'UTF-8'),
$nmessage,
"From: " . $a->user['email'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
@ -85,8 +85,8 @@ function invite_post(App $a) {
if ($res) {
$total ++;
$current_invites ++;
PConfig::set(local_user(),'system','sent_invites',$current_invites);
if($current_invites > $max_invites) {
PConfig::set(local_user(), 'system', 'sent_invites', $current_invites);
if ($current_invites > $max_invites) {
notice(L10n::t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
return;
}
@ -110,44 +110,44 @@ function invite_content(App $a) {
$tpl = get_markup_template('invite.tpl');
$invonly = false;
if (Config::get('system','invitation_only')) {
if (Config::get('system', 'invitation_only')) {
$invonly = true;
$x = PConfig::get(local_user(),'system','invites_remaining');
$x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ((! $x) && (! is_site_admin())) {
notice(L10n::t('You have no more invitations available') . EOL);
return '';
}
}
$dirloc = Config::get('system','directory');
$dirloc = Config::get('system', 'directory');
if (strlen($dirloc)) {
if ($a->config['register_policy'] == REGISTER_CLOSED) {
$linktxt = sprintf( t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.'), $dirloc . '/servers');
$linktxt = sprintf(L10n::t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.'), $dirloc . '/servers');
} else {
$linktxt = sprintf( t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), System::baseUrl())
. "\r\n" . "\r\n" . sprintf( t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.'),$dirloc . '/servers');
$linktxt = sprintf(L10n::t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), System::baseUrl())
. "\r\n" . "\r\n" . sprintf(L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.'), $dirloc . '/servers');
}
} else { // there is no global directory URL defined
if ($a->config['register_policy'] == REGISTER_CLOSED) {
$o = t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
$o = L10n::t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
return $o;
} else {
$linktxt = sprintf( t('To accept this invitation, please visit and register at %s.'), System::baseUrl()
. "\r\n" . "\r\n" . t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
$linktxt = sprintf(L10n::t('To accept this invitation, please visit and register at %s.'), System::baseUrl()
. "\r\n" . "\r\n" . L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
}
}
$o = replace_macros($tpl, [
'$form_security_token' => get_form_security_token("send_invite"),
'$invite' => t('Send invitations'),
'$addr_text' => t('Enter email addresses, one per line:'),
'$msg_text' => t('Your message:'),
'$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
'$invite' => L10n::t('Send invitations'),
'$addr_text' => L10n::t('Enter email addresses, one per line:'),
'$msg_text' => L10n::t('Your message:'),
'$default_message' => L10n::t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
. $linktxt
. "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:')
. "\r\n" . "\r\n" . (($invonly) ? L10n::t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .L10n::t('Once you have registered, please connect with me via my profile page at:')
. "\r\n" . "\r\n" . System::baseUrl() . '/profile/' . $a->user['nickname']
. "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" ,
'$submit' => t('Submit')
. "\r\n" . "\r\n" . L10n::t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" ,
'$submit' => L10n::t('Submit')
]);
return $o;

49
mod/localtime.php

@ -1,51 +1,58 @@
<?php
/**
* @file mod/localtime.php
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
require_once('include/datetime.php');
function localtime_post(App $a) {
require_once 'include/datetime.php';
function localtime_post(App $a)
{
$t = $_REQUEST['time'];
if(! $t)
if (! $t) {
$t = 'now';
}
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
if($_POST['timezone'])
$a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
$bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
if ($_POST['timezone']) {
$a->data['mod-localtime'] = datetime_convert('UTC', $_POST['timezone'], $t, $bd_format);
}
}
function localtime_content(App $a) {
function localtime_content(App $a)
{
$t = $_REQUEST['time'];
if(! $t)
if (! $t) {
$t = 'now';
}
$o .= '<h3>' . t('Time Conversion') . '</h3>';
$o .= '<h3>' . L10n::t('Time Conversion') . '</h3>';
$o .= '<p>' . t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
$o .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
$o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
$o .= '<p>' . sprintf(L10n::t('UTC time: %s'), $t) . '</p>';
if($_REQUEST['timezone'])
$o .= '<p>' . sprintf( t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
if ($_REQUEST['timezone']) {
$o .= '<p>' . sprintf(L10n::t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
}
if(x($a->data,'mod-localtime'))
$o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
if (x($a->data, 'mod-localtime')) {
$o .= '<p>' . sprintf(L10n::t('Converted localtime: %s'), $a->data['mod-localtime']) . '</p>';
}
$o .= '<form action ="' . System::baseUrl() . '/localtime?f=&time=' . $t . '" method="post" >';
$o .= '<p>' . t('Please select your timezone:') . '</p>';
$o .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
$o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
$o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
$o .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';
return $o;
}

11
mod/lockview.php

@ -1,7 +1,10 @@
<?php
/**
* @file mod/lockview.php
*/
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Database\DBM;
function lockview_content(App $a) {
@ -32,7 +35,7 @@ function lockview_content(App $a) {
Addon::callHooks('lockview_content', $item);
if($item['uid'] != local_user()) {
echo t('Remote privacy information not available.') . '<br />';
echo L10n::t('Remote privacy information not available.') . '<br />';
killme();
}
@ -40,7 +43,7 @@ function lockview_content(App $a) {
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
echo t('Remote privacy information not available.') . '<br />';
echo L10n::t('Remote privacy information not available.') . '<br />';
killme();
}
@ -49,7 +52,7 @@ function lockview_content(App $a) {
$deny_users = expand_acl($item['deny_cid']);
$deny_groups = expand_acl($item['deny_gid']);
$o = t('Visible to:') . '<br />';
$o = L10n::t('Visible to:') . '<br />';
$l = [];
if(count($allowed_groups)) {

34
mod/lostpass.php

@ -37,13 +37,13 @@ function lostpass_post(App $a)
];
$result = dba::update('user', $fields, ['uid' => $user['uid']]);
if ($result) {
info(t('Password reset request issued. Check your email.') . EOL);
info(L10n::t('Password reset request issued. Check your email.') . EOL);
}
$sitename = $a->config['sitename'];
$resetlink = System::baseUrl() . '/lostpass/' . $pwdreset_token;
$preamble = deindent(t('
$preamble = deindent(L10n::t('
Dear %1$s,
A request was recently received at "%2$s" to reset your account
password. In order to confirm this request, please select the verification link
@ -54,7 +54,7 @@ function lostpass_post(App $a)
Your password will not be changed unless we can verify that you
issued this request.', $user['username'], $sitename));
$body = deindent(t('
$body = deindent(L10n::t('
Follow this link soon to verify your identity:
%1$s
@ -70,7 +70,7 @@ function lostpass_post(App $a)
notification([
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
'subject' => t('Password reset requested at %s', $sitename),
'subject' => L10n::t('Password reset requested at %s', $sitename),
'preamble' => $preamble,
'body' => $body
]);
@ -114,10 +114,10 @@ function lostpass_form()
{
$tpl = get_markup_template('lostpass.tpl');
$o = replace_macros($tpl, [
'$title' => t('Forgot your Password?'),
'$desc' => t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
'$name' => t('Nickname or Email: '),
'$submit' => t('Reset')
'$title' => L10n::t('Forgot your Password?'),
'$desc' => L10n::t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
'$name' => L10n::t('Nickname or Email: '),
'$submit' => L10n::t('Reset')
]);
return $o;
@ -132,12 +132,12 @@ function lostpass_generate_password($user)
if (DBM::is_result($result)) {
$tpl = get_markup_template('pwdreset.tpl');
$o .= replace_macros($tpl, [
'$lbl1' => t('Password Reset'),
'$lbl2' => t('Your password has been reset as requested.'),
'$lbl3' => t('Your new password is'),
'$lbl4' => t('Save or copy your new password - and then'),
'$lbl5' => '<a href="' . System::baseUrl() . '">' . t('click here to login') . '</a>.',
'$lbl6' => t('Your password may be changed from the <em>Settings</em> page after successful login.'),
'$lbl1' => L10n::t('Password Reset'),
'$lbl2' => L10n::t('Your password has been reset as requested.'),
'$lbl3' => L10n::t('Your new password is'),
'$lbl4' => L10n::t('Save or copy your new password - and then'),
'$lbl5' => '<a href="' . System::baseUrl() . '">' . L10n::t('click here to login') . '</a>.',
'$lbl6' => L10n::t('Your password may be changed from the <em>Settings</em> page after successful login.'),
'$newpass' => $new_password,
'$baseurl' => System::baseUrl()
]);
@ -145,13 +145,13 @@ function lostpass_generate_password($user)
info("Your password has been reset." . EOL);
$sitename = $a->config['sitename'];
$preamble = deindent(t('
$preamble = deindent(L10n::t('
Dear %1$s,
Your password has been changed as requested. Please retain this
information for your records (or change your password immediately to
something that you will remember).
', $user['username']));
$body = deindent(t('
$body = deindent(L10n::t('
Your login details are as follows:
Site Location: %1$s
@ -164,7 +164,7 @@ function lostpass_generate_password($user)
notification([
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
'subject' => t('Your password has been changed at %s', $sitename),
'subject' => L10n::t('Your password has been changed at %s', $sitename),
'preamble' => $preamble,
'body' => $body
]);

8
mod/manage.php

@ -155,11 +155,11 @@ function manage_content(App $a) {
}
$o = replace_macros(get_markup_template('manage.tpl'), [
'$title' => t('Manage Identities and/or Pages'),
'$desc' => t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
'$choose' => t('Select an identity to manage: '),
'$title' => L10n::t('Manage Identities and/or Pages'),
'$desc' => L10n::t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
'$choose' => L10n::t('Select an identity to manage: '),
'$identities' => $identities,
'$submit' => t('Submit'),
'$submit' => L10n::t('Submit'),
]);
return $o;

12
mod/match.php

@ -85,8 +85,8 @@ function match_content(App $a)
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = System::baseUrl() . '/follow/?url=' . $jj->url;
$photo_menu = [
'profile' => [t("View Profile"), Profile::zrl($jj->url)],
'follow' => [t("Connect/Follow"), $connlnk]
'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
$contact_details = Contact::getDetailsByURL($jj->url, local_user());
@ -100,8 +100,8 @@ function match_content(App $a)
'about' => $contact_details['about'],
'account_type' => Contact::getAccountType($contact_details),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'inttxt' => ' ' . t('is interested in:'),
'conntxt' => t('Connect'),
'inttxt' => ' ' . L10n::t('is interested in:'),
'conntxt' => L10n::t('Connect'),
'connlnk' => $connlnk,
'img_hover' => $jj->tags,
'photo_menu' => $photo_menu,
@ -116,12 +116,12 @@ function match_content(App $a)
$o .= replace_macros(
$tpl,
[
'$title' => t('Profile Match'),
'$title' => L10n::t('Profile Match'),
'$contacts' => $entries,
'$paginate' => paginate($a)]
);
} else {
info(t('No matches') . EOL);
info(L10n::t('No matches') . EOL);
}
}

74
mod/message.php

@ -23,7 +23,7 @@ function message_init(App $a)
}
$new = [
'label' => t('New Message'),
'label' => L10n::t('New Message'),
'url' => 'message/new',
'sel' => $a->argc > 1 && $a->argv[1] == 'new',
'accesskey' => 'm',
@ -79,7 +79,7 @@ function message_post(App $a)
notice(L10n::t('Message collection failure.') . EOL);
break;
default:
info(t('Message sent.') . EOL);
info(L10n::t('Message sent.') . EOL);
}
// fake it to go back to the input form if no recipient listed
@ -105,7 +105,7 @@ function message_content(App $a)
$tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, [
'$messages' => t('Messages'),
'$messages' => L10n::t('Messages'),
]);
if (($a->argc == 3) && ($a->argv[1] === 'drop' || $a->argv[1] === 'dropconv')) {
@ -129,12 +129,12 @@ function message_content(App $a)
//$a->page['aside'] = '';
return replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
'$message' => t('Do you really want to delete this message?'),
'$message' => L10n::t('Do you really want to delete this message?'),
'$extra_inputs' => $inputs,
'$confirm' => t('Yes'),
'$confirm' => L10n::t('Yes'),
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
'$cancel' => L10n::t('Cancel'),
]);
}
// Now check how the user responded to the confirmation query
@ -149,7 +149,7 @@ function message_content(App $a)
intval(local_user())
);
if ($r) {
info(t('Message deleted.') . EOL);
info(L10n::t('Message deleted.') . EOL);
}
//goaway(System::baseUrl(true) . '/message' );
goaway($_SESSION['return_url']);
@ -178,7 +178,7 @@ function message_content(App $a)
//}
if ($r) {
info(t('Conversation removed.') . EOL);
info(L10n::t('Conversation removed.') . EOL);
}
}
//goaway(System::baseUrl(true) . '/message' );
@ -193,14 +193,14 @@ function message_content(App $a)
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
'$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('msg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
'$linkurl' => L10n::t('Please enter a link URL:')
]);
$preselect = isset($a->argv[2]) ? [$a->argv[2]] : false;
@ -243,23 +243,23 @@ function message_content(App $a)
$tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl, [
'$header' => t('Send Private Message'),
'$to' => t('To:'),
'$header' => L10n::t('Send Private Message'),
'$to' => L10n::t('To:'),
'$showinputs' => 'true',
'$prefill' => $prefill,
'$autocomp' => $autocomp,
'$preid' => $preid,
'$subject' => t('Subject:'),
'$subject' => L10n::t('Subject:'),
'$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'),
'$submit' => t('Submit')
'$upload' => L10n::t('Upload photo'),
'$insert' => L10n::t('Insert web link'),
'$wait' => L10n::t('Please wait'),
'$submit' => L10n::t('Submit')
]);
return $o;
}
@ -285,7 +285,7 @@ function message_content(App $a)
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
if (!DBM::is_result($r)) {
info(t('No messages.') . EOL);
info(L10n::t('No messages.') . EOL);
return $o;
}
@ -339,14 +339,14 @@ function message_content(App $a)
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
'$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('msg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
'$linkurl' => L10n::t('Please enter a link URL:')
]);
$mails = [];
@ -393,7 +393,7 @@ function message_content(App $a)
'from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'subject' => $subject_e,
'body' => $body_e,
'delete' => t('Delete message'),
'delete' => L10n::t('Delete message'),
'to_name' => $to_name_e,
'date' => datetime_convert('UTC', date_default_timezone_get(), $message['created'], 'D, d M Y - g:i A'),
'ago' => relative_date($message['created']),
@ -410,26 +410,26 @@ function message_content(App $a)
'$thread_id' => $a->argv[1],
'$thread_subject' => $message['title'],
'$thread_seen' => $seen,
'$delete' => t('Delete conversation'),
'$delete' => L10n::t('Delete conversation'),
'$canreply' => (($unknown) ? false : '1'),
'$unknown_text' => t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
'$unknown_text' => L10n::t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
'$mails' => $mails,
// reply
'$header' => t('Send Reply'),
'$to' => t('To:'),
'$header' => L10n::t('Send Reply'),
'$to' => L10n::t('To:'),
'$showinputs' => '',
'$subject' => t('Subject:'),
'$subject' => L10n::t('Subject:'),
'$subjtxt' => $message['title'],
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
'$yourmessage' => t('Your message:'),
'$yourmessage' => L10n::t('Your message:'),
'$text' => '',
'$select' => $select,
'$parent' => $parent,
'$upload' => t('Upload photo'),
'$insert' => t('Insert web link'),
'$submit' => t('Submit'),
'$wait' => t('Please wait')
'$upload' => L10n::t('Upload photo'),
'$insert' => L10n::t('Insert web link'),
'$submit' => L10n::t('Submit'),
'$wait' => L10n::t('Please wait')
]);
return $o;
@ -467,11 +467,11 @@ function render_messages(array $msg, $t)
foreach ($msg as $rr) {
if ($rr['unknown']) {
$participants = t("Unknown sender - %s", $rr['from-name']);
$participants = L10n::t("Unknown sender - %s", $rr['from-name']);
} elseif (link_compare($rr['from-url'], $myprofile)) {
$participants = t("You and %s", $rr['name']);
$participants = L10n::t("You and %s", $rr['name']);
} else {
$participants = t("%s and You", $rr['from-name']);
$participants = L10n::t("%s and You", $rr['from-name']);
}
$subject_e = (($rr['mailseen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>');
@ -493,10 +493,10 @@ function render_messages(array $msg, $t)
'$sparkle' => ' sparkle',
'$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'$subject' => $subject_e,
'$delete' => t('Delete conversation'),
'$delete' => L10n::t('Delete conversation'),
'$body' => $body_e,
'$to_name' => $to_name_e,
'$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['mailcreated'], t('D, d M Y - g:i A')),
'$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
'$ago' => relative_date($rr['mailcreated']),
'$seen' => $rr['mailseen'],
'$count' => L10n::tt('%d message', '%d messages', $rr['count']),

34
mod/network.php

@ -188,15 +188,15 @@ function saved_searches($search)
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
'delete' => t('Remove term'),
'delete' => L10n::t('Remove term'),
'selected' => ($search == $rr['term']),
];
}
$tpl = get_markup_template('saved_searches_aside.tpl');
$o = replace_macros($tpl, [
'$title' => t('Saved Searches'),
'$add' => t('add'),
'$title' => L10n::t('Saved Searches'),
'$add' => L10n::t('add'),
'$searchbox' => search($search, 'netsearch-box', $srchurl, true),
'$saved' => $saved,
]);
@ -633,11 +633,11 @@ function networkThreadedView(App $a, $update = 0)
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . protect_sprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
} else {
$sql_extra3 .= " AND false ";
info(t('Group is empty'));
info(L10n::t('Group is empty'));
}
$o = replace_macros(get_markup_template('section_title.tpl'), [
'$title' => t('Group: %s', $group['name'])
'$title' => L10n::t('Group: %s', $group['name'])
]) . $o;
} elseif ($cid) {
$fields = ['id', 'name', 'network', 'writable', 'nurl',
@ -909,18 +909,18 @@ function network_tabs(App $a)
// tabs
$tabs = [
[
'label' => t('Commented Order'),
'label' => L10n::t('Commented Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $all_active,
'title' => t('Sort by Comment Date'),
'title' => L10n::t('Sort by Comment Date'),
'id' => 'commented-order-tab',
'accesskey' => 'e',
],
[
'label' => t('Posted Order'),
'label' => L10n::t('Posted Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $postord_active,
'title' => t('Sort by Post Date'),
'title' => L10n::t('Sort by Post Date'),
'id' => 'posted-order-tab',
'accesskey' => 't',
],
@ -928,10 +928,10 @@ function network_tabs(App $a)
if (Feature::isEnabled(local_user(), 'personal_tab')) {
$tabs[] = [
'label' => t('Personal'),
'label' => L10n::t('Personal'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
'sel' => $conv_active,
'title' => t('Posts that mention or involve you'),
'title' => L10n::t('Posts that mention or involve you'),
'id' => 'personal-tab',
'accesskey' => 'r',
];
@ -939,10 +939,10 @@ function network_tabs(App $a)
if (Feature::isEnabled(local_user(), 'new_tab')) {
$tabs[] = [
'label' => t('New'),
'label' => L10n::t('New'),
'url' => 'network/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
'title' => t('Activity Stream - by date'),
'title' => L10n::t('Activity Stream - by date'),
'id' => 'activitiy-by-date-tab',
'accesskey' => 'w',
];
@ -950,10 +950,10 @@ function network_tabs(App $a)
if (Feature::isEnabled(local_user(), 'link_tab')) {
$tabs[] = [
'label' => t('Shared Links'),
'label' => L10n::t('Shared Links'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
'sel' => $bookmarked_active,
'title' => t('Interesting Links'),
'title' => L10n::t('Interesting Links'),
'id' => 'shared-links-tab',
'accesskey' => 'b',
];
@ -961,10 +961,10 @@ function network_tabs(App $a)
if (Feature::isEnabled(local_user(), 'star_posts')) {
$tabs[] = [
'label' => t('Starred'),
'label' => L10n::t('Starred'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
'sel' => $starred_active,
'title' => t('Favourite Posts'),
'title' => L10n::t('Favourite Posts'),
'id' => 'starred-posts-tab',
'accesskey' => 'm',
];

53
mod/newmember.php

@ -1,54 +1,57 @@
<?php
/**
* @file mod/newmember.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
function newmember_content(App $a) {
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
$o .= '<h3>' . t('New Member Checklist') . '</h3>';
function newmember_content(App $a)
{
$o = '<h1>' . L10n::t('Welcome to Friendica') . '</h1>';
$o .= '<h3>' . L10n::t('New Member Checklist') . '</h3>';
$o .= '<div style="font-size: 120%;">';
$o .= t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
$o .= '<h4>' . t('Getting Started') . '</h4>';
$o .= L10n::t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
$o .= '<h4>' . L10n::t('Getting Started') . '</h4>';
$o .= '<ul>';
$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
$o .= '<li> ' . '<a target="newmember" href="help/guide">' . L10n::t('Friendica Walk-Through') . '</a><br />' . L10n::t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
$o .= '</ul>';
$o .= '<h4>' . t('Settings') . '</h4>';
$o .= '<h4>' . L10n::t('Settings') . '</h4>';
$o .= '<ul>';
$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="settings">' . L10n::t('Go to Your Settings') . '</a><br />' . L10n::t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
$o .= '<li>' . L10n::t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
$o .= '</ul>';
$o .= '<h4>' . t('Profile') . '</h4>';
$o .= '<h4>' . L10n::t('Profile') . '</h4>';
$o .= '<ul>';
$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Profile Keywords') . '</a><br />' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="profile_photo">' . L10n::t('Upload Profile Photo') . '</a><br />' . L10n::t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="profiles">' . L10n::t('Edit Your Profile') . '</a><br />' . L10n::t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="profiles">' . L10n::t('Profile Keywords') . '</a><br />' . L10n::t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
$o .= '</ul>';
$o .= '<h4>' . t('Connecting') . '</h4>';
$o .= '<h4>' . L10n::t('Connecting') . '</h4>';
$o .= '<ul>';
$mail_disabled = ((function_exists('imap_open') && (!Config::get('system', 'imap_disabled'))) ? 0 : 1);
if (!$mail_disabled) {
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . L10n::t('Importing Emails') . '</a><br />' . L10n::t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
}
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Go to Your Contacts Page') . '</a><br />' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="directory">' . t("Go to Your Site's Directory") . '</a><br />' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Finding New People') . '</a><br />' . t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="contacts">' . L10n::t('Go to Your Contacts Page') . '</a><br />' . L10n::t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="directory">' . L10n::t("Go to Your Site's Directory") . '</a><br />' . L10n::t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="contacts">' . L10n::t('Finding New People') . '</a><br />' . L10n::t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
$o .= '</ul>';
$o .= '<h4>' . t('Groups') . '</h4>';
$o .= '<h4>' . L10n::t('Groups') . '</h4>';
$o .= '<ul>';
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="contacts">' . L10n::t('Group Your Contacts') . '</a><br />' . L10n::t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
if (Config::get('system', 'newuser_private')) {
$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . L10n::t("Why Aren't My Posts Public?") . '</a><br />' . L10n::t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
}
$o .= '</ul>';
$o .= '<h4>' . t('Getting Help') . '</h4>';
$o .= '<h4>' . L10n::t('Getting Help') . '</h4>';
$o .= '<ul>';
$o .= '<li>' . '<a target="newmember" href="help">' . t('Go to the Help Section') . '</a><br />' . t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
$o .= '<li>' . '<a target="newmember" href="help">' . L10n::t('Go to the Help Section') . '</a><br />' . L10n::t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
$o .= '</ul>';
$o .= '</div>';

6
mod/nogroup.php

@ -39,8 +39,8 @@ function nogroup_content(App $a)
$contact_details = Contact::getDetailsByURL($rr['url'], local_user(), $rr);
$contacts[] = [
'img_hover' => t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
'edit_hover' => t('Edit contact'),
'img_hover' => L10n::t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
'edit_hover' => L10n::t('Edit contact'),
'photo_menu' => Contact::photoMenu($rr),
'id' => $rr['id'],
'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
@ -60,7 +60,7 @@ function nogroup_content(App $a)
$o = replace_macros(
$tpl,
[
'$header' => t('Contacts who are not members of a group'),
'$header' => L10n::t('Contacts who are not members of a group'),
'$contacts' => $contacts,
'$paginate' => paginate($a)]
);

45
mod/notes.php

@ -8,8 +8,8 @@ use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
function notes_init(App $a) {
function notes_init(App $a)
{
if (! local_user()) {
return;
}
@ -21,21 +21,20 @@ function notes_init(App $a) {
Nav::setSelected('home');
//Profile::load($a, $which, $profile);
}
function notes_content(App $a, $update = false) {
function notes_content(App $a, $update = false)
{
if (! local_user()) {
notice(L10n::t('Permission denied.') . EOL);
return;
}
require_once("include/bbcode.php");
require_once('include/security.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
require_once 'include/bbcode.php';
require_once 'include/security.php';
require_once 'include/conversation.php';
require_once 'include/acl_selectors.php';
$groups = [];
@ -51,8 +50,8 @@ function notes_content(App $a, $update = false) {
$o ="";
$o .= Profile::getTabs($a, true);
if(! $update) {
$o .= '<h3>' . t('Personal Notes') . '</h3>';
if (!$update) {
$o .= '<h3>' . L10n::t('Personal Notes') . '</h3>';
$commpage = false;
$commvisitor = false;
@ -67,12 +66,11 @@ function notes_content(App $a, $update = false) {
'bang' => '',
'visitor' => 'block',
'profile_uid' => local_user(),
'button' => t('Save'),
'button' => L10n::t('Save'),
'acl_data' => '',
];
$o .= status_editor($a,$x,$a->contact['id']);
$o .= status_editor($a, $x, $a->contact['id']);
}
// Construct permissions
@ -86,9 +84,9 @@ function notes_content(App $a, $update = false) {
WHERE %s AND `item`.`uid` = %d AND `item`.`type` = 'note'
AND `contact`.`self` AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall`
$sql_extra ",
item_joins(), item_condition(),
item_joins(),
item_condition(),
intval(local_user())
);
if (DBM::is_result($r)) {
@ -101,7 +99,8 @@ function notes_content(App $a, $update = false) {
AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall`
$sql_extra
ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
item_joins(), item_condition(),
item_joins(),
item_condition(),
intval(local_user()),
intval($a->pager['start']),
intval($a->pager['itemspage'])
@ -112,27 +111,29 @@ function notes_content(App $a, $update = false) {
$parents_str = '';
if (DBM::is_result($r)) {
foreach($r as $rr)
foreach ($r as $rr) {
$parents_arr[] = $rr['item_id'];
}
$parents_str = implode(', ', $parents_arr);
$r = q("SELECT %s FROM `item` %s
WHERE %s AND `item`.`uid` = %d AND `item`.`parent` IN (%s)
$sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ",
item_fieldlists(), item_joins(), item_condition(),
item_fieldlists(),
item_joins(),
item_condition(),
intval(local_user()),
dbesc($parents_str)
);
if (DBM::is_result($r)) {
$items = conv_sort($r,"`commented`");
$items = conv_sort($r, "`commented`");
$o .= conversation($a,$items,'notes',$update);
$o .= conversation($a, $items, 'notes', $update);
}
}
$o .= paginate($a);
return $o;
}

78
mod/notifications.php

@ -45,7 +45,7 @@ function notifications_post(App $a) {
$fid = $r[0]['fid'];
if($_POST['submit'] == t('Discard')) {
if($_POST['submit'] == L10n::t('Discard')) {
$r = q("DELETE FROM `intro` WHERE `id` = %d",
intval($intro_id)
);
@ -61,7 +61,7 @@ function notifications_post(App $a) {
}
goaway('notifications/intros');
}
if($_POST['submit'] == t('Ignore')) {
if($_POST['submit'] == L10n::t('Ignore')) {
$r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d",
intval($intro_id));
goaway('notifications/intros');
@ -97,7 +97,7 @@ function notifications_content(App $a) {
// Get introductions
if ((($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) {
Nav::setSelected('introductions');
$notif_header = t('Notifications');
$notif_header = L10n::t('Notifications');
$all = (($a->argc > 2) && ($a->argv[2] == 'all'));
@ -106,25 +106,25 @@ function notifications_content(App $a) {
// Get the network notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'network')) {
$notif_header = t('Network Notifications');
$notif_header = L10n::t('Network Notifications');
$notifs = $nm->networkNotifs($show, $startrec, $perpage);
// Get the system notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'system')) {
$notif_header = t('System Notifications');
$notif_header = L10n::t('System Notifications');
$notifs = $nm->systemNotifs($show, $startrec, $perpage);
// Get the personal notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'personal')) {
$notif_header = t('Personal Notifications');
$notif_header = L10n::t('Personal Notifications');
$notifs = $nm->personalNotifs($show, $startrec, $perpage);
// Get the home notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'home')) {
$notif_header = t('Home Notifications');
$notif_header = L10n::t('Home Notifications');
$notifs = $nm->homeNotifs($show, $startrec, $perpage);
}
@ -153,7 +153,7 @@ function notifications_content(App $a) {
// The link to switch between ignored and normal connection requests
$notif_show_lnk = [
'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros' ),
'text' => (!$all ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
'text' => (!$all ? L10n::t('Show Ignored Requests') : L10n::t('Hide Ignored Requests'))
];
// Loop through all introduction notifications.This creates an array with the output html for each
@ -165,23 +165,23 @@ function notifications_content(App $a) {
switch ($it['label']) {
case 'friend_suggestion':
$notif_content[] = replace_macros($sugg, [
'$str_notifytype' => t('Notification type: '),
'$str_notifytype' => L10n::t('Notification type: '),
'$notify_type' => $it['notify_type'],
'$intro_id' => $it['intro_id'],
'$madeby' => sprintf( t('suggested by %s'),$it['madeby']),
'$madeby' => sprintf(L10n::t('suggested by %s'), $it['madeby']),
'$contact_id' => $it['contact-id'],
'$photo' => $it['photo'],
'$fullname' => $it['name'],
'$url' => $it['url'],
'$hidden' => ['hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''],
'$activity' => ['activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')],
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
'$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
'$knowyou' => $it['knowyou'],
'$approve' => t('Approve'),
'$approve' => L10n::t('Approve'),
'$note' => $it['note'],
'$request' => $it['request'],
'$ignore' => t('Ignore'),
'$discard' => t('Discard'),
'$ignore' => L10n::t('Ignore'),
'$discard' => L10n::t('Discard'),
]);
break;
@ -196,16 +196,16 @@ function notifications_content(App $a) {
if($it['network'] === NETWORK_DFRN || $it['network'] === NETWORK_DIASPORA) {
if($it['network'] === NETWORK_DFRN) {
$lbl_knowyou = t('Claims to be known to you: ');
$knowyou = (($it['knowyou']) ? t('yes') : t('no'));
$helptext = t('Shall your connection be bidirectional or not?');
$helptext2 = sprintf(t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
$helptext3 = sprintf(t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
$lbl_knowyou = L10n::t('Claims to be known to you: ');
$knowyou = (($it['knowyou']) ? L10n::t('yes') : L10n::t('no'));
$helptext = L10n::t('Shall your connection be bidirectional or not?');
$helptext2 = sprintf(L10n::t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
$helptext3 = sprintf(L10n::t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
} else {
$knowyou = '';
$helptext = t('Shall your connection be bidirectional or not?');
$helptext2 = sprintf(t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
$helptext3 = sprintf(t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
$helptext = L10n::t('Shall your connection be bidirectional or not?');
$helptext2 = sprintf(L10n::t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
$helptext3 = sprintf(L10n::t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
}
}
@ -216,8 +216,8 @@ function notifications_content(App $a) {
'$approve_as1' => $helptext,
'$approve_as2' => $helptext2,
'$approve_as3' => $helptext3,
'$as_friend' => t('Friend'),
'$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? t('Sharer') : t('Subscriber'))
'$as_friend' => L10n::t('Friend'),
'$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? L10n::t('Sharer') : L10n::t('Subscriber'))
]);
$header = $it["name"];
@ -228,14 +228,14 @@ function notifications_content(App $a) {
$header .= " (".ContactSelector::networkToName($it['network'], $it['url']).")";
if ($it['network'] != NETWORK_DIASPORA) {
$discard = t('Discard');
$discard = L10n::t('Discard');
} else {
$discard = '';
}
$notif_content[] = replace_macros($tpl, [
'$header' => htmlentities($header),
'$str_notifytype' => t('Notification type: '),
'$str_notifytype' => L10n::t('Notification type: '),
'$notify_type' => $it['notify_type'],
'$dfrn_text' => $dfrn_text,
'$dfrn_id' => $it['dfrn_id'],
@ -245,26 +245,26 @@ function notifications_content(App $a) {
'$photo' => $it['photo'],
'$fullname' => $it['name'],
'$location' => $it['location'],
'$lbl_location' => t('Location:'),
'$lbl_location' => L10n::t('Location:'),
'$about' => $it['about'],
'$lbl_about' => t('About:'),
'$lbl_about' => L10n::t('About:'),
'$keywords' => $it['keywords'],
'$lbl_keywords' => t('Tags:'),
'$lbl_keywords' => L10n::t('Tags:'),
'$gender' => $it['gender'],
'$lbl_gender' => t('Gender:'),
'$hidden' => ['hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''],
'$activity' => ['activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')],
'$lbl_gender' => L10n::t('Gender:'),
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
'$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
'$url' => $it['url'],
'$zrl' => $it['zrl'],
'$lbl_url' => t('Profile URL'),
'$lbl_url' => L10n::t('Profile URL'),
'$addr' => $it['addr'],
'$lbl_knowyou' => $lbl_knowyou,
'$lbl_network' => t('Network:'),
'$lbl_network' => L10n::t('Network:'),
'$network' => ContactSelector::networkToName($it['network'], $it['url']),
'$knowyou' => $knowyou,
'$approve' => t('Approve'),
'$approve' => L10n::t('Approve'),
'$note' => $it['note'],
'$ignore' => t('Ignore'),
'$ignore' => L10n::t('Ignore'),
'$discard' => $discard,
]);
@ -314,13 +314,13 @@ function notifications_content(App $a) {
if($show == 0 || intval($show) && $notifs['total'] > 0) {
$notif_show_lnk = [
'href' => ($show ? 'notifications/'.$notifs['ident'] : 'notifications/'.$notifs['ident'].'?show=all' ),
'text' => ($show ? t('Show unread') : t('Show all')),
'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
];
}
// Output if there aren't any notifications available
if($notifs['total'] == 0)
$notif_nocontent = sprintf( t('No more %s notifications.'), $notifs['ident']);
$notif_nocontent = sprintf(L10n::t('No more %s notifications.'), $notifs['ident']);
}
$o .= replace_macros($notif_tpl, [

22
mod/notify.php

@ -1,12 +1,16 @@
<?php
/**
* @file mod/notify.php
*/
use Friendica\App;
use Friendica\Core\NotificationsManager;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Module\Login;
function notify_init(App $a) {
function notify_init(App $a)
{
if (! local_user()) {
return;
}
@ -35,16 +39,16 @@ function notify_init(App $a) {
goaway(System::baseUrl(true));
}
if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) {
if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all') {
$r = $nm->setAllSeen();
$j = json_encode(['result' => ($r) ? 'success' : 'fail']);
echo $j;
killme();
}
}
function notify_content(App $a) {
function notify_content(App $a)
{
if (! local_user()) {
return Login::form();
}
@ -59,7 +63,7 @@ function notify_content(App $a) {
$r = $nm->getAll(['seen'=>0]);
if (DBM::is_result($r) > 0) {
foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,[
$notif_content .= replace_macros($not_tpl, [
'$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
'$item_image' => $it['photo'],
'$item_text' => strip_tags(bbcode($it['msg'])),
@ -67,16 +71,14 @@ function notify_content(App $a) {
]);
}
} else {
$notif_content .= t('No more system notifications.');
$notif_content .= L10n::t('No more system notifications.');
}
$o .= replace_macros($notif_tpl, [
'$notif_header' => t('System Notifications'),
'$notif_header' => L10n::t('System Notifications'),
'$tabs' => false, // $tabs,
'$notif_content' => $notif_content,
]);
return $o;
}

166
mod/photos.php

@ -82,7 +82,7 @@ function photos_init(App $a) {
$ret['albums'] = [];
foreach ($albums as $k => $album) {
//hide profile photos to others
if (!$is_owner && !remote_user() && ($album['album'] == t('Profile Photos')))
if (!$is_owner && !remote_user() && ($album['album'] == L10n::t('Profile Photos')))
continue;
$entry = [
'text' => $album['album'],
@ -102,11 +102,11 @@ function photos_init(App $a) {
if ($ret['success']) {
$photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'), [
'$nick' => $a->data['user']['nickname'],
'$title' => t('Photo Albums'),
'$recent' => t('Recent Photos'),
'$title' => L10n::t('Photo Albums'),
'$recent' => L10n::t('Recent Photos'),
'$albums' => $ret['albums'],
'$baseurl' => System::baseUrl(),
'$upload' => [t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
'$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
'$can_post' => $can_post
]);
}
@ -120,7 +120,7 @@ function photos_init(App $a) {
$tpl = get_markup_template("photos_head.tpl");
$a->page['htmlhead'] .= replace_macros($tpl,[
'$ispublic' => t('everybody')
'$ispublic' => L10n::t('everybody')
]);
}
@ -188,7 +188,7 @@ function photos_post(App $a)
if ($a->argc > 3 && $a->argv[2] === 'album') {
$album = hex2bin($a->argv[3]);
if ($album === t('Profile Photos') || $album === 'Contact Photos' || $album === t('Contact Photos')) {
if ($album === L10n::t('Profile Photos') || $album === 'Contact Photos' || $album === L10n::t('Contact Photos')) {
goaway($_SESSION['photo_return']);
return; // NOTREACHED
}
@ -228,7 +228,7 @@ function photos_post(App $a)
* DELETE photo album and all its photos
*/
if ($_POST['dropalbum'] == t('Delete Album')) {
if ($_POST['dropalbum'] == L10n::t('Delete Album')) {
// Check if we should do HTML-based delete confirmation
if (x($_REQUEST, 'confirm')) {
$drop_url = $a->query_string;
@ -237,12 +237,12 @@ function photos_post(App $a)
];
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
'$message' => t('Do you really want to delete this photo album and all its photos?'),
'$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
'$extra_inputs' => $extra_inputs,
'$confirm' => t('Delete Album'),
'$confirm' => L10n::t('Delete Album'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'dropalbum', // Needed so that confirmation will bring us back into this if statement
'$cancel' => t('Cancel'),
'$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
@ -317,7 +317,7 @@ function photos_post(App $a)
goaway($_SESSION['photo_return']);
}
if ($a->argc > 2 && defaults($_POST, 'delete', '') === t('Delete Photo')) {
if ($a->argc > 2 && defaults($_POST, 'delete', '') === L10n::t('Delete Photo')) {
// same as above but remove single photo
@ -326,12 +326,12 @@ function photos_post(App $a)
$drop_url = $a->query_string;
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
'$message' => t('Do you really want to delete this photo?'),
'$message' => L10n::t('Do you really want to delete this photo?'),
'$extra_inputs' => [],
'$confirm' => t('Delete Photo'),
'$confirm' => L10n::t('Delete Photo'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'delete', // Needed so that confirmation will bring us back into this if statement
'$cancel' => t('Cancel'),
'$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
@ -695,7 +695,7 @@ function photos_post(App $a)
$arr['tag'] = $tagged[4];
$arr['inform'] = $tagged[2];
$arr['origin'] = 1;
$arr['body'] = sprintf( t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
$arr['body'] = sprintf( L10n::t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . L10n::t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
$arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
@ -750,7 +750,7 @@ function photos_post(App $a)
dbesc($album),
intval($page_owner_uid)
);
if (!DBM::is_result($r) || ($album == t('Profile Photos'))) {
if (!DBM::is_result($r) || ($album == L10n::t('Profile Photos'))) {
$visible = 1;
} else {
$visible = 0;
@ -874,7 +874,7 @@ function photos_post(App $a)
$r = Photo::store($Image, $page_owner_uid, $visitor, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if (!$r) {
logger('mod/photos.php: photos_post(): image store failed' , LOGGER_DEBUG);
logger('mod/photos.php: photos_post(): image store failed', LOGGER_DEBUG);
notice(L10n::t('Image upload failed.') . EOL);
killme();
}
@ -1091,7 +1091,7 @@ function photos_content(App $a)
$albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';
if (count($a->data['albums'])) {
foreach ($a->data['albums'] as $album) {
if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === t('Contact Photos'))) {
if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === L10n::t('Contact Photos'))) {
continue;
}
$selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
@ -1109,7 +1109,7 @@ function photos_content(App $a)
$default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), []);
$default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), [
'$submit' => t('Submit'),
'$submit' => L10n::t('Submit'),
]);
$usage_message = '';
@ -1119,15 +1119,15 @@ function photos_content(App $a)
$aclselect_e = ($visitor ? '' : populate_acl($a->user));
$o .= replace_macros($tpl,[
'$pagename' => t('Upload Photos'),
'$pagename' => L10n::t('Upload Photos'),
'$sessid' => session_id(),
'$usage' => $usage_message,
'$nickname' => $a->data['user']['nickname'],
'$newalbum' => t('New album name: '),
'$existalbumtext' => t('or existing album name: '),
'$nosharetext' => t('Do not show a status post for this upload'),
'$newalbum' => L10n::t('New album name: '),
'$existalbumtext' => L10n::t('or existing album name: '),
'$nosharetext' => L10n::t('Do not show a status post for this upload'),
'$albumselect' => $albumselect,
'$permissions' => t('Permissions'),
'$permissions' => L10n::t('Permissions'),
'$aclselect' => $aclselect_e,
'$alt_uploader' => $ret['addon_text'],
'$default_upload_box' => ($ret['default_upload'] ? $default_upload_box : ''),
@ -1135,8 +1135,8 @@ function photos_content(App $a)
'$uploadurl' => $ret['post_url'],
// ACL permissions box
'$group_perms' => t('Show to Groups'),
'$contact_perms' => t('Show to Contacts'),
'$group_perms' => L10n::t('Show to Groups'),
'$contact_perms' => L10n::t('Show to Contacts'),
'$return_path' => $a->query_string,
]);
@ -1178,32 +1178,32 @@ function photos_content(App $a)
// edit album name
if ($cmd === 'edit') {
if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos'))) {
if ($can_post) {
$edit_tpl = get_markup_template('album_edit.tpl');
$album_e = $album;
$o .= replace_macros($edit_tpl,[
'$nametext' => t('New album name: '),
'$nametext' => L10n::t('New album name: '),
'$nickname' => $a->data['user']['nickname'],
'$album' => $album_e,
'$hexalbum' => bin2hex($album),
'$submit' => t('Submit'),
'$dropsubmit' => t('Delete Album')
'$submit' => L10n::t('Submit'),
'$dropsubmit' => L10n::t('Delete Album')
]);
}
}
} else {
if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos')) && $can_post) {
$edit = [t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos')) && $can_post) {
$edit = [L10n::t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
}
}
if ($order_field === 'posted') {
$order = [t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)];
$order = [L10n::t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)];
} else {
$order = [t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'];
$order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'];
}
$photos = [];
@ -1224,7 +1224,7 @@ function photos_content(App $a)
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
. ($order_field === 'posted' ? '?f=&order=posted' : ''),
'title' => t('View Photo'),
'title' => L10n::t('View Photo'),
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
'alt' => $imgalt_e,
'desc'=> $desc_e,
@ -1239,7 +1239,7 @@ function photos_content(App $a)
'$photos' => $photos,
'$album' => $album,
'$can_post' => $can_post,
'$upload' => [t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
'$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
'$order' => $order,
'$edit' => $edit,
'$paginate' => paginate($a),
@ -1330,14 +1330,14 @@ function photos_content(App $a)
if ($can_post && ($ph[0]['uid'] == $owner_uid)) {
$tools = [
'edit' => ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))],
'profile'=>['profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')],
'edit' => ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? L10n::t('View photo') : L10n::t('Edit photo'))],
'profile'=>['profile_photo/use/'.$ph[0]['resource-id'], L10n::t('Use as profile photo')],
];
// lock
$lock = ( ( ($ph[0]['uid'] == local_user()) && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid'])
|| strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) )
? t('Private Message')
? L10n::t('Private Message')
: Null);
@ -1356,7 +1356,7 @@ function photos_content(App $a)
$photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> t('View Full Size'),
'title'=> L10n::t('View Full Size'),
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'),
'height' => $hires['height'],
'width' => $hires['width'],
@ -1447,10 +1447,10 @@ function photos_content(App $a)
}
$tag_str .= bbcode($t);