Many t() calls

modify many t() calls.
This commit is contained in:
Adam Magness 2018-01-21 13:33:59 -05:00
parent 45f8000ba5
commit d49f986d1e
74 changed files with 1099 additions and 1009 deletions

View file

@ -18,21 +18,21 @@ use Friendica\Database\DBM;
*/ */
function timezone_cmp($a, $b) { function timezone_cmp($a, $b) {
if (strstr($a, '/') && strstr($b, '/')) { if (strstr($a, '/') && strstr($b, '/')) {
if ( t($a) == t($b)) { if (L10n::t($a) == L10n::t($b)) {
return 0; return 0;
} }
return ( t($a) < t($b)) ? -1 : 1; return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
} }
if (strstr($a, '/')) { if (strstr($a, '/')) {
return -1; return -1;
} elseif (strstr($b, '/')) { } elseif (strstr($b, '/')) {
return 1; return 1;
} elseif ( t($a) == t($b)) { } elseif (L10n::t($a) == L10n::t($b)) {
return 0; return 0;
} }
return ( t($a) < t($b)) ? -1 : 1; return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
} }
/** /**
@ -57,7 +57,7 @@ function select_timezone($current = 'America/Los_Angeles') {
$o .= '</optgroup>'; $o .= '</optgroup>';
} }
$continent = $ex[0]; $continent = $ex[0];
$o .= '<optgroup label="' . t($continent) . '">'; $o .= '<optgroup label="' . L10n::t($continent) . '">';
} }
if (count($ex) > 2) { if (count($ex) > 2) {
$city = substr($value,strpos($value,'/')+1); $city = substr($value,strpos($value,'/')+1);
@ -66,13 +66,13 @@ function select_timezone($current = 'America/Los_Angeles') {
} }
} else { } else {
$city = $ex[0]; $city = $ex[0];
if ($continent != t('Miscellaneous')) { if ($continent != L10n::t('Miscellaneous')) {
$o .= '</optgroup>'; $o .= '</optgroup>';
$continent = t('Miscellaneous'); $continent = L10n::t('Miscellaneous');
$o .= '<optgroup label="' . t($continent) . '">'; $o .= '<optgroup label="' . L10n::t($continent) . '">';
} }
} }
$city = str_replace('_', ' ', t($city)); $city = str_replace('_', ' ', L10n::t($city));
$selected = (($value == $current) ? " selected=\"selected\" " : ""); $selected = (($value == $current) ? " selected=\"selected\" " : "");
$o .= "<option value=\"$value\" $selected >$city</option>"; $o .= "<option value=\"$value\" $selected >$city</option>";
} }
@ -195,17 +195,17 @@ function dob($dob)
'dob', 'dob',
t('Birthday:'), t('Birthday:'),
$value, $value,
(((intval($age)) > 0 ) ? t('Age: ') . $age : ""), (((intval($age)) > 0 ) ? L10n::t('Age: ') . $age : ""),
'', '',
'placeholder="' . t('YYYY-MM-DD or MM-DD') . '"' 'placeholder="' . L10n::t('YYYY-MM-DD or MM-DD') . '"'
] ]
]); ]);
/// @TODO Old-lost code? /// @TODO Old-lost code?
// if ($dob && $dob > '0001-01-01') // if ($dob && $dob > '0001-01-01')
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year), 'dob'); // $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year), 'dob');
// else // else
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob'); // $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob');
return $o; return $o;
} }
@ -359,23 +359,23 @@ function relative_date($posted_date, $format = null) {
$abs = strtotime($localtime); $abs = strtotime($localtime);
if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === False) { if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === false) {
return t('never'); return L10n::t('never');
} }
$etime = time() - $abs; $etime = time() - $abs;
if ($etime < 1) { if ($etime < 1) {
return t('less than a second ago'); return L10n::t('less than a second ago');
} }
$a = [ 12 * 30 * 24 * 60 * 60 => [ t('year'), t('years')], $a = [ 12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
30 * 24 * 60 * 60 => [ t('month'), t('months')], 30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
7 * 24 * 60 * 60 => [ t('week'), t('weeks')], 7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
24 * 60 * 60 => [ t('day'), t('days')], 24 * 60 * 60 => [L10n::t('day'), L10n::t('days')],
60 * 60 => [ t('hour'), t('hours')], 60 * 60 => [L10n::t('hour'), L10n::t('hours')],
60 => [ t('minute'), t('minutes')], 60 => [L10n::t('minute'), L10n::t('minutes')],
1 => [ t('second'), t('seconds')] 1 => [L10n::t('second'), L10n::t('seconds')]
]; ];
foreach ($a as $secs => $str) { foreach ($a as $secs => $str) {
@ -384,7 +384,7 @@ function relative_date($posted_date, $format = null) {
$r = round($d); $r = round($d);
// translators - e.g. 22 hours ago, 1 minute ago // translators - e.g. 22 hours ago, 1 minute ago
if (!$format) { if (!$format) {
$format = t('%1$d %2$s ago'); $format = L10n::t('%1$d %2$s ago');
} }
return sprintf($format, $r, (($r == 1) ? $str[0] : $str[1])); return sprintf($format, $r, (($r == 1) ? $str[0] : $str[1]));
@ -611,8 +611,8 @@ function update_contact_birthdays() {
continue; continue;
} }
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']); $bdtext = sprintf(L10n::t('%s\'s birthday'), $rr['name']);
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ; $bdtext2 = sprintf(L10n::t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`) q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`,`adjust`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ", VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d' ) ",

View file

@ -29,10 +29,10 @@ function notification($params)
// from here on everything is in the recipients language // from here on everything is in the recipients language
L10n::pushLang($params['language']); L10n::pushLang($params['language']);
$banner = t('Friendica Notification'); $banner = L10n::t('Friendica Notification');
$product = FRIENDICA_PLATFORM; $product = FRIENDICA_PLATFORM;
$siteurl = System::baseUrl(true); $siteurl = System::baseUrl(true);
$thanks = t('Thank You,'); $thanks = L10n::t('Thank You,');
$sitename = $a->config['sitename']; $sitename = $a->config['sitename'];
if (!x($a->config['admin_name'])) { if (!x($a->config['admin_name'])) {
$site_admin = sprintf(t('%s Administrator'), $sitename); $site_admin = sprintf(t('%s Administrator'), $sitename);
@ -48,7 +48,7 @@ function notification($params)
$sender_email = $a->config['sender_email']; $sender_email = $a->config['sender_email'];
if (empty($sender_email)) { if (empty($sender_email)) {
$sender_email = t('noreply').'@'.$hostname; $sender_email = L10n::t('noreply').'@'.$hostname;
} }
if ($params['type'] != SYSTEM_EMAIL) { if ($params['type'] != SYSTEM_EMAIL) {
@ -101,7 +101,7 @@ function notification($params)
$preamble = sprintf(t('%1$s sent you a new private message at %2$s.'), $params['source_name'], $sitename); $preamble = sprintf(t('%1$s sent you a new private message at %2$s.'), $params['source_name'], $sitename);
$epreamble = sprintf(t('%1$s sent you %2$s.'), '[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url=$itemlink]'.t('a private message').'[/url]'); $epreamble = sprintf(t('%1$s sent you %2$s.'), '[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url=$itemlink]'.t('a private message').'[/url]');
$sitelink = t('Please visit %s to view and/or reply to your private messages.'); $sitelink = L10n::t('Please visit %s to view and/or reply to your private messages.');
$tsitelink = sprintf($sitelink, $siteurl.'/message/'.$params['item']['id']); $tsitelink = sprintf($sitelink, $siteurl.'/message/'.$params['item']['id']);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'/message/'.$params['item']['id'].'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'/message/'.$params['item']['id'].'">'.$sitename.'</a>');
$itemlink = $siteurl.'/message/'.$params['item']['id']; $itemlink = $siteurl.'/message/'.$params['item']['id'];
@ -171,7 +171,7 @@ function notification($params)
$preamble = sprintf(t('%s commented on an item/conversation you have been following.'), $params['source_name']); $preamble = sprintf(t('%s commented on an item/conversation you have been following.'), $params['source_name']);
$epreamble = $dest_str; $epreamble = $dest_str;
$sitelink = t('Please visit %s to view and/or reply to the conversation.'); $sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -185,7 +185,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']); $params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.'); $sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -199,7 +199,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']); $params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.'); $sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -213,7 +213,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']); $params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.'); $sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -227,11 +227,11 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']); $params['link']);
$subject = str_replace('poked', t($params['activity']), $subject); $subject = str_replace('poked', L10n::t($params['activity']), $subject);
$preamble = str_replace('poked', t($params['activity']), $preamble); $preamble = str_replace('poked', L10n::t($params['activity']), $preamble);
$epreamble = str_replace('poked', t($params['activity']), $epreamble); $epreamble = str_replace('poked', L10n::t($params['activity']), $epreamble);
$sitelink = t('Please visit %s to view and/or reply to the conversation.'); $sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -245,7 +245,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink); $itemlink);
$sitelink = t('Please visit %s to view and/or reply to the conversation.'); $sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -261,7 +261,7 @@ function notification($params)
$body = sprintf(t('You may visit their profile at %s'), $params['source_link']); $body = sprintf(t('You may visit their profile at %s'), $params['source_link']);
$sitelink = t('Please visit %s to approve or reject the introduction.'); $sitelink = L10n::t('Please visit %s to approve or reject the introduction.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -300,11 +300,11 @@ function notification($params)
'[url='.$params['item']['url'].']'.$params['item']['name'].'[/url]', '[url='.$params['item']['url'].']'.$params['item']['name'].'[/url]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]'); '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
$body = t('Name:').' '.$params['item']['name']."\n"; $body = L10n::t('Name:').' '.$params['item']['name']."\n";
$body .= t('Photo:').' '.$params['item']['photo']."\n"; $body .= L10n::t('Photo:').' '.$params['item']['photo']."\n";
$body .= sprintf(t('You may visit their profile at %s'), $params['item']['url']); $body .= sprintf(t('You may visit their profile at %s'), $params['item']['url']);
$sitelink = t('Please visit %s to approve or reject the suggestion.'); $sitelink = L10n::t('Please visit %s to approve or reject the suggestion.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -319,9 +319,9 @@ function notification($params)
$itemlink, $itemlink,
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]'); '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
$body = t('You are now mutual friends and may exchange status updates, photos, and email without restriction.'); $body = L10n::t('You are now mutual friends and may exchange status updates, photos, and email without restriction.');
$sitelink = t('Please visit %s if you wish to make any changes to this relationship.'); $sitelink = L10n::t('Please visit %s if you wish to make any changes to this relationship.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -337,7 +337,7 @@ function notification($params)
$body .= "\n\n"; $body .= "\n\n";
$body .= sprintf(t('\'%1$s\' may choose to extend this into a two-way or more permissive relationship in the future.'), $params['source_name']); $body .= sprintf(t('\'%1$s\' may choose to extend this into a two-way or more permissive relationship in the future.'), $params['source_name']);
$sitelink = t('Please visit %s if you wish to make any changes to this relationship.'); $sitelink = L10n::t('Please visit %s if you wish to make any changes to this relationship.');
$tsitelink = sprintf($sitelink, $siteurl); $tsitelink = sprintf($sitelink, $siteurl);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>'); $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link']; $itemlink = $params['link'];
@ -357,7 +357,7 @@ function notification($params)
$body = sprintf(t('Full Name: %1$s\nSite Location: %2$s\nLogin Name: %3$s (%4$s)'), $body = sprintf(t('Full Name: %1$s\nSite Location: %2$s\nLogin Name: %3$s (%4$s)'),
$params['source_name'], $siteurl, $params['source_mail'], $params['source_nick']); $params['source_name'], $siteurl, $params['source_mail'], $params['source_nick']);
$sitelink = t('Please visit %s to approve or reject the request.'); $sitelink = L10n::t('Please visit %s to approve or reject the request.');
$tsitelink = sprintf($sitelink, $params['link']); $tsitelink = sprintf($sitelink, $params['link']);
$hsitelink = sprintf($sitelink, '<a href="'.$params['link'].'">'.$sitename.'</a><br><br>'); $hsitelink = sprintf($sitelink, '<a href="'.$params['link'].'">'.$sitename.'</a><br><br>');
$itemlink = $params['link']; $itemlink = $params['link'];

View file

@ -7,6 +7,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -22,7 +23,7 @@ function format_event_html($ev, $simple = false) {
return ''; return '';
} }
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM. $bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM.
$event_start = (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $event_start = (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),
$ev['start'] , $bd_format )) $ev['start'] , $bd_format ))
@ -39,14 +40,14 @@ function format_event_html($ev, $simple = false) {
$o .= "<div>" . bbcode($ev['desc']) . "</div>"; $o .= "<div>" . bbcode($ev['desc']) . "</div>";
$o .= "<h4>" . t('Starts:') . "</h4><p>" . $event_start . "</p>"; $o .= "<h4>" . L10n::t('Starts:') . "</h4><p>" . $event_start . "</p>";
if (! $ev['nofinish']) { if (! $ev['nofinish']) {
$o .= "<h4>" . t('Finishes:') . "</h4><p>" . $event_end ."</p>"; $o .= "<h4>" . L10n::t('Finishes:') . "</h4><p>" . $event_end ."</p>";
} }
if (strlen($ev['location'])) { if (strlen($ev['location'])) {
$o .= "<h4>" . t('Location:') . "</h4><p>" . $ev['location'] . "</p>"; $o .= "<h4>" . L10n::t('Location:') . "</h4><p>" . $ev['location'] . "</p>";
} }
return $o; return $o;
@ -56,13 +57,13 @@ function format_event_html($ev, $simple = false) {
$o .= '<div class="summary event-summary">' . bbcode($ev['summary']) . '</div>' . "\r\n"; $o .= '<div class="summary event-summary">' . bbcode($ev['summary']) . '</div>' . "\r\n";
$o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span>&nbsp;<span class="dtstart" title="' $o .= '<div class="event-start"><span class="event-label">' . L10n::t('Starts:') . '</span>&nbsp;<span class="dtstart" title="'
. datetime_convert('UTC', 'UTC', $ev['start'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) . datetime_convert('UTC', 'UTC', $ev['start'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
. '" >'.$event_start . '" >'.$event_start
. '</span></div>' . "\r\n"; . '</span></div>' . "\r\n";
if (! $ev['nofinish']) { if (! $ev['nofinish']) {
$o .= '<div class="event-end" ><span class="event-label">' . t('Finishes:') . '</span>&nbsp;<span class="dtend" title="' $o .= '<div class="event-end" ><span class="event-label">' . L10n::t('Finishes:') . '</span>&nbsp;<span class="dtend" title="'
. datetime_convert('UTC', 'UTC', $ev['finish'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) . datetime_convert('UTC', 'UTC', $ev['finish'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
. '" >'.$event_end . '" >'.$event_end
. '</span></div>' . "\r\n"; . '</span></div>' . "\r\n";
@ -71,7 +72,7 @@ function format_event_html($ev, $simple = false) {
$o .= '<div class="description event-description">' . bbcode($ev['desc']) . '</div>' . "\r\n"; $o .= '<div class="description event-description">' . bbcode($ev['desc']) . '</div>' . "\r\n";
if (strlen($ev['location'])) { if (strlen($ev['location'])) {
$o .= '<div class="event-location"><span class="event-label">' . t('Location:') . '</span>&nbsp;<span class="location">' $o .= '<div class="event-location"><span class="event-label">' . L10n::t('Location:') . '</span>&nbsp;<span class="location">'
. bbcode($ev['location']) . bbcode($ev['location'])
. '</span></div>' . "\r\n"; . '</span></div>' . "\r\n";
@ -425,60 +426,60 @@ function get_event_strings() {
$i18n = [ $i18n = [
"firstDay" => $firstDay, "firstDay" => $firstDay,
"allday" => t("all-day"), "allday" => L10n::t("all-day"),
"Sun" => t("Sun"), "Sun" => L10n::t("Sun"),
"Mon" => t("Mon"), "Mon" => L10n::t("Mon"),
"Tue" => t("Tue"), "Tue" => L10n::t("Tue"),
"Wed" => t("Wed"), "Wed" => L10n::t("Wed"),
"Thu" => t("Thu"), "Thu" => L10n::t("Thu"),
"Fri" => t("Fri"), "Fri" => L10n::t("Fri"),
"Sat" => t("Sat"), "Sat" => L10n::t("Sat"),
"Sunday" => t("Sunday"), "Sunday" => L10n::t("Sunday"),
"Monday" => t("Monday"), "Monday" => L10n::t("Monday"),
"Tuesday" => t("Tuesday"), "Tuesday" => L10n::t("Tuesday"),
"Wednesday" => t("Wednesday"), "Wednesday" => L10n::t("Wednesday"),
"Thursday" => t("Thursday"), "Thursday" => L10n::t("Thursday"),
"Friday" => t("Friday"), "Friday" => L10n::t("Friday"),
"Saturday" => t("Saturday"), "Saturday" => L10n::t("Saturday"),
"Jan" => t("Jan"), "Jan" => L10n::t("Jan"),
"Feb" => t("Feb"), "Feb" => L10n::t("Feb"),
"Mar" => t("Mar"), "Mar" => L10n::t("Mar"),
"Apr" => t("Apr"), "Apr" => L10n::t("Apr"),
"May" => t("May"), "May" => L10n::t("May"),
"Jun" => t("Jun"), "Jun" => L10n::t("Jun"),
"Jul" => t("Jul"), "Jul" => L10n::t("Jul"),
"Aug" => t("Aug"), "Aug" => L10n::t("Aug"),
"Sep" => t("Sept"), "Sep" => L10n::t("Sept"),
"Oct" => t("Oct"), "Oct" => L10n::t("Oct"),
"Nov" => t("Nov"), "Nov" => L10n::t("Nov"),
"Dec" => t("Dec"), "Dec" => L10n::t("Dec"),
"January" => t("January"), "January" => L10n::t("January"),
"February" => t("February"), "February" => L10n::t("February"),
"March" => t("March"), "March" => L10n::t("March"),
"April" => t("April"), "April" => L10n::t("April"),
"May" => t("May"), "May" => L10n::t("May"),
"June" => t("June"), "June" => L10n::t("June"),
"July" => t("July"), "July" => L10n::t("July"),
"August" => t("August"), "August" => L10n::t("August"),
"September" => t("September"), "September" => L10n::t("September"),
"October" => t("October"), "October" => L10n::t("October"),
"November" => t("November"), "November" => L10n::t("November"),
"December" => t("December"), "December" => L10n::t("December"),
"today" => t("today"), "today" => L10n::t("today"),
"month" => t("month"), "month" => L10n::t("month"),
"week" => t("week"), "week" => L10n::t("week"),
"day" => t("day"), "day" => L10n::t("day"),
"noevent" => t("No events to display"), "noevent" => L10n::t("No events to display"),
"dtstart_label" => t("Starts:"), "dtstart_label" => L10n::t("Starts:"),
"dtend_label" => t("Finishes:"), "dtend_label" => L10n::t("Finishes:"),
"location_label" => t("Location:") "location_label" => L10n::t("Location:")
]; ];
return $i18n; return $i18n;
@ -588,7 +589,7 @@ function process_events($arr) {
$events=[]; $events=[];
$last_date = ''; $last_date = '';
$fmt = t('l, F j'); $fmt = L10n::t('l, F j');
if (count($arr)) { if (count($arr)) {
foreach ($arr as $rr) { foreach ($arr as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $rr['start'], 'j') : datetime_convert('UTC', 'UTC', $rr['start'], 'j')); $j = (($rr['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $rr['start'], 'j') : datetime_convert('UTC', 'UTC', $rr['start'], 'j'));
@ -612,9 +613,9 @@ function process_events($arr) {
$copy = null; $copy = null;
$drop = null; $drop = null;
if (local_user() && local_user() == $rr['uid'] && $rr['type'] == 'event') { if (local_user() && local_user() == $rr['uid'] && $rr['type'] == 'event') {
$edit = ((! $rr['cid']) ? [System::baseUrl() . '/events/event/' . $rr['id'], t('Edit event'), '', ''] : null); $edit = ((! $rr['cid']) ? [System::baseUrl() . '/events/event/' . $rr['id'], L10n::t('Edit event'), '', ''] : null);
$copy = ((! $rr['cid']) ? [System::baseUrl() . '/events/copy/' . $rr['id'], t('Duplicate event'), '', ''] : null); $copy = ((! $rr['cid']) ? [System::baseUrl() . '/events/copy/' . $rr['id'], L10n::t('Duplicate event'), '', ''] : null);
$drop = [System::baseUrl() . '/events/drop/' . $rr['id'], t('Delete event'), '', '']; $drop = [System::baseUrl() . '/events/drop/' . $rr['id'], L10n::t('Delete event'), '', ''];
} }
$title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8')); $title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8'));
@ -641,7 +642,7 @@ function process_events($arr) {
'is_first' => $is_first, 'is_first' => $is_first,
'item' => $rr, 'item' => $rr,
'html' => $html, 'html' => $html,
'plink' => [$rr['plink'], t('link to source'), '', ''], 'plink' => [$rr['plink'], L10n::t('link to source'), '', ''],
]; ];
} }
} }
@ -901,9 +902,9 @@ function widget_events() {
} }
return replace_macros(get_markup_template("events_aside.tpl"), [ return replace_macros(get_markup_template("events_aside.tpl"), [
'$etitle' => t("Export"), '$etitle' => L10n::t("Export"),
'$export_ical' => t("Export calendar as ical"), '$export_ical' => L10n::t("Export calendar as ical"),
'$export_csv' => t("Export calendar as csv"), '$export_csv' => L10n::t("Export calendar as csv"),
'$user' => $user '$user' => $user
]); ]);
} }
@ -919,9 +920,9 @@ function format_event_item($item) {
$finish = false; $finish = false;
// Set the different time formats. // Set the different time formats.
$dformat = t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8:01 AM. $dformat = L10n::t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8:01 AM.
$dformat_short = t('D g:i A'); // Fri 8:01 AM. $dformat_short = L10n::t('D g:i A'); // Fri 8:01 AM.
$tformat = t('g:i A'); // 8:01 AM. $tformat = L10n::t('g:i A'); // 8:01 AM.
// Convert the time to different formats. // Convert the time to different formats.
$dtstart_dt = (($item['event-adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $item['event-start'], $dformat)) : day_translate(datetime_convert('UTC', 'UTC', $item['event-start'], $dformat))); $dtstart_dt = (($item['event-adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $item['event-start'], $dformat)) : day_translate(datetime_convert('UTC', 'UTC', $item['event-start'], $dformat)));
@ -971,11 +972,11 @@ function format_event_item($item) {
$event = replace_macros(get_markup_template('event_stream_item.tpl'), [ $event = replace_macros(get_markup_template('event_stream_item.tpl'), [
'$id' => $item['event-id'], '$id' => $item['event-id'],
'$title' => prepare_text($item['event-summary']), '$title' => prepare_text($item['event-summary']),
'$dtstart_label' => t('Starts:'), '$dtstart_label' => L10n::t('Starts:'),
'$dtstart_title' => $dtstart_title, '$dtstart_title' => $dtstart_title,
'$dtstart_dt' => $dtstart_dt, '$dtstart_dt' => $dtstart_dt,
'$finish' => $finish, '$finish' => $finish,
'$dtend_label' => t('Finishes:'), '$dtend_label' => L10n::t('Finishes:'),
'$dtend_title' => $dtend_title, '$dtend_title' => $dtend_title,
'$dtend_dt' => $dtend_dt, '$dtend_dt' => $dtend_dt,
'$month_short' => $month_short, '$month_short' => $month_short,
@ -989,10 +990,10 @@ function format_event_item($item) {
'$author_link' => $profile_link, '$author_link' => $profile_link,
'$author_avatar' => $item['author-avatar'], '$author_avatar' => $item['author-avatar'],
'$description' => prepare_text($item['event-desc']), '$description' => prepare_text($item['event-desc']),
'$location_label' => t('Location:'), '$location_label' => L10n::t('Location:'),
'$show_map_label' => t('Show map'), '$show_map_label' => L10n::t('Show map'),
'$hide_map_label' => t('Hide map'), '$hide_map_label' => L10n::t('Hide map'),
'$map_btn_label' => t('Show map'), '$map_btn_label' => L10n::t('Show map'),
'$location' => $location '$location' => $location
]); ]);

View file

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Core\System; use Friendica\Core\System;
@ -1495,7 +1496,7 @@ function new_follower($importer, $contact, $datarray, $item, $sharing = false) {
'to_email' => $r[0]['email'], 'to_email' => $r[0]['email'],
'uid' => $r[0]['uid'], 'uid' => $r[0]['uid'],
'link' => System::baseUrl() . '/notifications/intro', 'link' => System::baseUrl() . '/notifications/intro',
'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : t('[Name Withheld]')), 'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : L10n::t('[Name Withheld]')),
'source_link' => $contact_record['url'], 'source_link' => $contact_record['url'],
'source_photo' => $contact_record['photo'], 'source_photo' => $contact_record['photo'],
'verb' => ($sharing ? ACTIVITY_FRIEND : ACTIVITY_FOLLOW), 'verb' => ($sharing ? ACTIVITY_FRIEND : ACTIVITY_FOLLOW),
@ -1867,7 +1868,7 @@ function drop_item($id) {
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice(t('Item not found.') . EOL); notice(L10n::t('Item not found.') . EOL);
goaway(System::baseUrl() . '/' . $_SESSION['return_url']); goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
} }
@ -1907,12 +1908,12 @@ function drop_item($id) {
return replace_macros(get_markup_template('confirm.tpl'), [ return replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get', '$method' => 'get',
'$message' => t('Do you really want to delete this item?'), '$message' => L10n::t('Do you really want to delete this item?'),
'$extra_inputs' => $inputs, '$extra_inputs' => $inputs,
'$confirm' => t('Yes'), '$confirm' => L10n::t('Yes'),
'$confirm_url' => $query['base'], '$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed', '$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'), '$cancel' => L10n::t('Cancel'),
]); ]);
} }
// Now check how the user responded to the confirmation query // Now check how the user responded to the confirmation query
@ -1926,7 +1927,7 @@ function drop_item($id) {
goaway(System::baseUrl() . '/' . $_SESSION['return_url']); goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
//NOTREACHED //NOTREACHED
} else { } else {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway(System::baseUrl() . '/' . $_SESSION['return_url']); goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
//NOTREACHED //NOTREACHED
} }
@ -2015,13 +2016,13 @@ function posted_date_widget($url, $uid, $wall) {
$cutoff = ((array_key_exists($cutoff_year, $ret))? true : false); $cutoff = ((array_key_exists($cutoff_year, $ret))? true : false);
$o = replace_macros(get_markup_template('posted_date_widget.tpl'),[ $o = replace_macros(get_markup_template('posted_date_widget.tpl'),[
'$title' => t('Archives'), '$title' => L10n::t('Archives'),
'$size' => $visible_years, '$size' => $visible_years,
'$cutoff_year' => $cutoff_year, '$cutoff_year' => $cutoff_year,
'$cutoff' => $cutoff, '$cutoff' => $cutoff,
'$url' => $url, '$url' => $url,
'$dates' => $ret, '$dates' => $ret,
'$showmore' => t('show more') '$showmore' => L10n::t('show more')
]); ]);
return $o; return $o;

View file

@ -1,7 +1,10 @@
<?php <?php
/**
* @file include/like.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -31,31 +34,31 @@ function do_like($item_id, $verb) {
switch ($verb) { switch ($verb) {
case 'like': case 'like':
$bodyverb = t('%1$s likes %2$s\'s %3$s'); $bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
$activity = ACTIVITY_LIKE; $activity = ACTIVITY_LIKE;
break; break;
case 'unlike': case 'unlike':
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s'); $bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
$activity = ACTIVITY_LIKE; $activity = ACTIVITY_LIKE;
break; break;
case 'dislike': case 'dislike':
case 'undislike': case 'undislike':
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s'); $bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
$activity = ACTIVITY_DISLIKE; $activity = ACTIVITY_DISLIKE;
break; break;
case 'attendyes': case 'attendyes':
case 'unattendyes': case 'unattendyes':
$bodyverb = t('%1$s is attending %2$s\'s %3$s'); $bodyverb = L10n::t('%1$s is attending %2$s\'s %3$s');
$activity = ACTIVITY_ATTEND; $activity = ACTIVITY_ATTEND;
break; break;
case 'attendno': case 'attendno':
case 'unattendno': case 'unattendno':
$bodyverb = t('%1$s is not attending %2$s\'s %3$s'); $bodyverb = L10n::t('%1$s is not attending %2$s\'s %3$s');
$activity = ACTIVITY_ATTENDNO; $activity = ACTIVITY_ATTENDNO;
break; break;
case 'attendmaybe': case 'attendmaybe':
case 'unattendmaybe': case 'unattendmaybe':
$bodyverb = t('%1$s may attend %2$s\'s %3$s'); $bodyverb = L10n::t('%1$s may attend %2$s\'s %3$s');
$activity = ACTIVITY_ATTENDMAYBE; $activity = ACTIVITY_ATTENDMAYBE;
break; break;
default: default:
@ -185,9 +188,9 @@ function do_like($item_id, $verb) {
} }
// Else or if event verb different from existing row, create a new item row // Else or if event verb different from existing row, create a new item row
$post_type = (($item['resource-id']) ? t('photo') : t('status')); $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
if ($item['object-type'] === ACTIVITY_OBJ_EVENT) { if ($item['object-type'] === ACTIVITY_OBJ_EVENT) {
$post_type = t('event'); $post_type = L10n::t('event');
} }
$objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ; $objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ;
$link = xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . '" />' . "\n") ; $link = xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . '" />' . "\n") ;

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Network\Probe; use Friendica\Network\Probe;
@ -737,7 +738,7 @@ function scale_external_images($srctext, $include_link = true, $scale_replace =
$mtch[0], $mtch[0],
'[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]' '[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]'
. "\n" . (($include_link) . "\n" . (($include_link)
? '[url=' . $mtch[1] . ']' . t('view full size') . '[/url]' . "\n" ? '[url=' . $mtch[1] . ']' . L10n::t('view full size') . '[/url]' . "\n"
: ''), : ''),
$s $s
); );

View file

@ -1,8 +1,11 @@
<?php <?php
/**
* @file include/security.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -401,7 +404,7 @@ function check_form_security_token($typename = '', $formname = 'form_security_to
function check_form_security_std_err_msg() function check_form_security_std_err_msg()
{ {
return t('The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it.') . EOL; return L10n::t('The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it.') . EOL;
} }
function check_form_security_token_redirectOnErr($err_redirect, $typename = '', $formname = 'form_security_token') function check_form_security_token_redirectOnErr($err_redirect, $typename = '', $formname = 'form_security_token')

View file

@ -1,10 +1,10 @@
<?php <?php
/** /**
* @file include/tags.php * @file include/tags.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -239,7 +239,7 @@ function wtagblock($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HA
$tpl = get_markup_template('tagblock_widget.tpl'); $tpl = get_markup_template('tagblock_widget.tpl');
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$title' => t('Tags'), '$title' => L10n::t('Tags'),
'$tags' => $tags '$tags' => $tags
]); ]);
} }

View file

@ -8,6 +8,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Smilies; use Friendica\Content\Smilies;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -294,14 +295,14 @@ function paginate_data(App $a, $count = null) {
if (!is_null($count)) { if (!is_null($count)) {
// minimal pager (newer / older) // minimal pager (newer / older)
$data['class'] = 'pager'; $data['class'] = 'pager';
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), t('newer'), 'previous' . ($a->pager['page'] == 1 ? ' disabled' : '')); _l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), L10n::t('newer'), 'previous' . ($a->pager['page'] == 1 ? ' disabled' : ''));
_l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), t('older'), 'next' . ($count <= 0 ? ' disabled' : '')); _l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), L10n::t('older'), 'next' . ($count <= 0 ? ' disabled' : ''));
} else { } else {
// full pager (first / prev / 1 / 2 / ... / 14 / 15 / next / last) // full pager (first / prev / 1 / 2 / ... / 14 / 15 / next / last)
$data['class'] = 'pagination'; $data['class'] = 'pagination';
if ($a->pager['total'] > $a->pager['itemspage']) { if ($a->pager['total'] > $a->pager['itemspage']) {
_l($data, 'first', $url . '&page=1', t('first'), $a->pager['page'] == 1 ? 'disabled' : ''); _l($data, 'first', $url . '&page=1', L10n::t('first'), $a->pager['page'] == 1 ? 'disabled' : '');
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), t('prev'), $a->pager['page'] == 1 ? 'disabled' : ''); _l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), L10n::t('prev'), $a->pager['page'] == 1 ? 'disabled' : '');
$numpages = $a->pager['total'] / $a->pager['itemspage']; $numpages = $a->pager['total'] / $a->pager['itemspage'];
@ -335,8 +336,8 @@ function paginate_data(App $a, $count = null) {
$data['pages'] = $pages; $data['pages'] = $pages;
$lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages); $lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages);
_l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), t('next'), $a->pager['page'] == $lastpage ? 'disabled' : ''); _l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), L10n::t('next'), $a->pager['page'] == $lastpage ? 'disabled' : '');
_l($data, 'last', $url . '&page=' . $lastpage, t('last'), $a->pager['page'] == $lastpage ? 'disabled' : ''); _l($data, 'last', $url . '&page=' . $lastpage, L10n::t('last'), $a->pager['page'] == $lastpage ? 'disabled' : '');
} }
} }
@ -390,8 +391,8 @@ function alt_pager(App $a, $i) {
function scroll_loader() { function scroll_loader() {
$tpl = get_markup_template("scroll_loader.tpl"); $tpl = get_markup_template("scroll_loader.tpl");
return replace_macros($tpl, [ return replace_macros($tpl, [
'wait' => t('Loading more entries...'), 'wait' => L10n::t('Loading more entries...'),
'end' => t('The end') 'end' => L10n::t('The end')
]); ]);
} }
@ -927,7 +928,7 @@ function contact_block() {
$total = intval($r[0]['total']); $total = intval($r[0]['total']);
} }
if (!$total) { if (!$total) {
$contacts = t('No contacts'); $contacts = L10n::t('No contacts');
$micropro = null; $micropro = null;
} else { } else {
// Splitting the query in two parts makes it much faster // Splitting the query in two parts makes it much faster
@ -964,7 +965,7 @@ function contact_block() {
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$contacts' => $contacts, '$contacts' => $contacts,
'$nickname' => $a->profile['nickname'], '$nickname' => $a->profile['nickname'],
'$viewcontacts' => t('View Contacts'), '$viewcontacts' => L10n::t('View Contacts'),
'$micropro' => $micropro, '$micropro' => $micropro,
]); ]);
@ -1053,16 +1054,16 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
if (strpos($s, '#') === 0) { if (strpos($s, '#') === 0) {
$mode = 'tag'; $mode = 'tag';
} }
$save_label = $mode === 'text' ? t('Save') : t('Follow'); $save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow');
$values = [ $values = [
'$s' => htmlspecialchars($s), '$s' => htmlspecialchars($s),
'$id' => $id, '$id' => $id,
'$action_url' => $url, '$action_url' => $url,
'$search_label' => t('Search'), '$search_label' => L10n::t('Search'),
'$save_label' => $save_label, '$save_label' => $save_label,
'$savedsearch' => Feature::isEnabled(local_user(),'savedsearch'), '$savedsearch' => Feature::isEnabled(local_user(),'savedsearch'),
'$search_hint' => t('@name, !forum, #tags, content'), '$search_hint' => L10n::t('@name, !forum, #tags, content'),
'$mode' => $mode '$mode' => $mode
]; ];
@ -1073,7 +1074,7 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
t("Contacts")]; t("Contacts")];
if (Config::get('system','poco_local_search')) { if (Config::get('system','poco_local_search')) {
$values['$searchoption'][] = t("Forums"); $values['$searchoption'][] = L10n::t("Forums");
} }
} }
@ -1117,12 +1118,12 @@ function get_poke_verbs() {
// value is array containing past tense verb, translation of present, translation of past // value is array containing past tense verb, translation of present, translation of past
$arr = [ $arr = [
'poke' => ['poked', t('poke'), t('poked')], 'poke' => ['poked', L10n::t('poke'), L10n::t('poked')],
'ping' => ['pinged', t('ping'), t('pinged')], 'ping' => ['pinged', L10n::t('ping'), L10n::t('pinged')],
'prod' => ['prodded', t('prod'), t('prodded')], 'prod' => ['prodded', L10n::t('prod'), L10n::t('prodded')],
'slap' => ['slapped', t('slap'), t('slapped')], 'slap' => ['slapped', L10n::t('slap'), L10n::t('slapped')],
'finger' => ['fingered', t('finger'), t('fingered')], 'finger' => ['fingered', L10n::t('finger'), L10n::t('fingered')],
'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')], 'rebuff' => ['rebuffed', L10n::t('rebuff'), L10n::t('rebuffed')],
]; ];
Addon::callHooks('poke_verbs', $arr); Addon::callHooks('poke_verbs', $arr);
return $arr; return $arr;
@ -1136,11 +1137,11 @@ function get_poke_verbs() {
*/ */
function day_translate($s) { function day_translate($s) {
$ret = str_replace(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'], $ret = str_replace(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
[t('Monday'), t('Tuesday'), t('Wednesday'), t('Thursday'), t('Friday'), t('Saturday'), t('Sunday')], [L10n::t('Monday'), L10n::t('Tuesday'), L10n::t('Wednesday'), L10n::t('Thursday'), L10n::t('Friday'), L10n::t('Saturday'), L10n::t('Sunday')],
$s); $s);
$ret = str_replace(['January','February','March','April','May','June','July','August','September','October','November','December'], $ret = str_replace(['January','February','March','April','May','June','July','August','September','October','November','December'],
[t('January'), t('February'), t('March'), t('April'), t('May'), t('June'), t('July'), t('August'), t('September'), t('October'), t('November'), t('December')], [L10n::t('January'), L10n::t('February'), L10n::t('March'), L10n::t('April'), L10n::t('May'), L10n::t('June'), L10n::t('July'), L10n::t('August'), L10n::t('September'), L10n::t('October'), L10n::t('November'), L10n::t('December')],
$ret); $ret);
return $ret; return $ret;
@ -1154,10 +1155,10 @@ function day_translate($s) {
*/ */
function day_short_translate($s) { function day_short_translate($s) {
$ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], $ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
[t('Mon'), t('Tue'), t('Wed'), t('Thu'), t('Fri'), t('Sat'), t('Sun')], [L10n::t('Mon'), L10n::t('Tue'), L10n::t('Wed'), L10n::t('Thu'), L10n::t('Fri'), L10n::t('Sat'), L10n::t('Sun')],
$s); $s);
$ret = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov','Dec'], $ret = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov','Dec'],
[t('Jan'), t('Feb'), t('Mar'), t('Apr'), t('May'), ('Jun'), t('Jul'), t('Aug'), t('Sep'), t('Oct'), t('Nov'), t('Dec')], [L10n::t('Jan'), L10n::t('Feb'), L10n::t('Mar'), L10n::t('Apr'), L10n::t('May'), ('Jun'), L10n::t('Jul'), L10n::t('Aug'), L10n::t('Sep'), L10n::t('Oct'), L10n::t('Nov'), L10n::t('Dec')],
$ret); $ret);
return $ret; return $ret;
} }
@ -1358,7 +1359,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
$as .= replace_macros(get_markup_template('video_top.tpl'), [ $as .= replace_macros(get_markup_template('video_top.tpl'), [
'$video' => [ '$video' => [
'id' => $id, 'id' => $id,
'title' => t('View Video'), 'title' => L10n::t('View Video'),
'src' => $the_url, 'src' => $the_url,
'mime' => $mime, 'mime' => $mime,
], ],
@ -1375,7 +1376,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
} }
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1])); $title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
$title .= ' ' . $mtch[2] . ' ' . t('bytes'); $title .= ' ' . $mtch[2] . ' ' . L10n::t('bytes');
$icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>'; $icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
$as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>'; $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
@ -1410,7 +1411,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
while ((strpos($s, $spoilersearch) !== false)) { while ((strpos($s, $spoilersearch) !== false)) {
$pos = strpos($s, $spoilersearch); $pos = strpos($s, $spoilersearch);
$rnd = random_string(8); $rnd = random_string(8);
$spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" class="spoiler-wrap fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>'. $spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" class="spoiler-wrap fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . sprintf(L10n::t('Click to open/close')) . '</span>'.
'<blockquote class="spoiler" id="spoiler-' . $rnd . '" style="display: none;">'; '<blockquote class="spoiler" id="spoiler-' . $rnd . '" style="display: none;">';
$s = substr($s, 0, $pos) . $spoilerreplace . substr($s, $pos + strlen($spoilersearch)); $s = substr($s, 0, $pos) . $spoilerreplace . substr($s, $pos + strlen($spoilersearch));
} }
@ -1421,7 +1422,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
while ((strpos($s, $authorsearch) !== false)) { while ((strpos($s, $authorsearch) !== false)) {
$pos = strpos($s, $authorsearch); $pos = strpos($s, $authorsearch);
$rnd = random_string(8); $rnd = random_string(8);
$authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" class="author-wrap fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>'. $authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" class="author-wrap fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . sprintf(L10n::t('Click to open/close')) . '</span>'.
'<blockquote class="author" id="author-' . $rnd . '" style="display: block;">'; '<blockquote class="author" id="author-' . $rnd . '" style="display: block;">';
$s = substr($s, 0, $pos) . $authorreplace . substr($s, $pos + strlen($authorsearch)); $s = substr($s, 0, $pos) . $authorreplace . substr($s, $pos + strlen($authorsearch));
} }
@ -1548,20 +1549,20 @@ function get_plink($item) {
//'href' => "display/" . $a->user['nickname'] . "/" . $item['id'], //'href' => "display/" . $a->user['nickname'] . "/" . $item['id'],
'href' => "display/" . $item['guid'], 'href' => "display/" . $item['guid'],
'orig' => "display/" . $item['guid'], 'orig' => "display/" . $item['guid'],
'title' => t('View on separate page'), 'title' => L10n::t('View on separate page'),
'orig_title' => t('view on separate page'), 'orig_title' => L10n::t('view on separate page'),
]; ];
if (x($item, 'plink')) { if (x($item, 'plink')) {
$ret["href"] = $a->remove_baseurl($item['plink']); $ret["href"] = $a->remove_baseurl($item['plink']);
$ret["title"] = t('link to source'); $ret["title"] = L10n::t('link to source');
} }
} elseif (x($item, 'plink') && ($item['private'] != 1)) { } elseif (x($item, 'plink') && ($item['private'] != 1)) {
$ret = [ $ret = [
'href' => $item['plink'], 'href' => $item['plink'],
'orig' => $item['plink'], 'orig' => $item['plink'],
'title' => t('link to source'), 'title' => L10n::t('link to source'),
]; ];
} else { } else {
$ret = []; $ret = [];
@ -1763,16 +1764,16 @@ function reltoabs($text, $base) {
*/ */
function item_post_type($item) { function item_post_type($item) {
if (intval($item['event-id'])) { if (intval($item['event-id'])) {
return t('event'); return L10n::t('event');
} elseif (strlen($item['resource-id'])) { } elseif (strlen($item['resource-id'])) {
return t('photo'); return L10n::t('photo');
} elseif (strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST) { } elseif (strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST) {
return t('activity'); return L10n::t('activity');
} elseif ($item['id'] != $item['parent']) { } elseif ($item['id'] != $item['parent']) {
return t('comment'); return L10n::t('comment');
} }
return t('post'); return L10n::t('post');
} }
// post categories and "save to file" use the same item.file table for storage. // post categories and "save to file" use the same item.file table for storage.
@ -1935,7 +1936,7 @@ function file_tag_save_file($uid, $item, $file)
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) { if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
PConfig::set($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']'); PConfig::set($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']');
} }
info(t('Item filed')); info(L10n::t('Item filed'));
} }
return true; return true;
} }

View file

@ -247,7 +247,7 @@ if (strlen($a->module)) {
if (is_array($a->addons) && in_array($a->module, $a->addons) && file_exists("addon/{$a->module}/{$a->module}.php")) { if (is_array($a->addons) && in_array($a->module, $a->addons) && file_exists("addon/{$a->module}/{$a->module}.php")) {
//Check if module is an app and if public access to apps is allowed or not //Check if module is an app and if public access to apps is allowed or not
if ((!local_user()) && Addon::isApp($a->module) && $privateapps === "1") { if ((!local_user()) && Addon::isApp($a->module) && $privateapps === "1") {
info(t("You must be logged in to use addons. ")); info(L10n::t("You must be logged in to use addons. "));
} else { } else {
include_once "addon/{$a->module}/{$a->module}.php"; include_once "addon/{$a->module}/{$a->module}.php";
if (function_exists($a->module . '_module')) { if (function_exists($a->module . '_module')) {
@ -294,12 +294,12 @@ if (strlen($a->module)) {
} }
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG); logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found')); header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . L10n::t('Not Found'));
$tpl = get_markup_template("404.tpl"); $tpl = get_markup_template("404.tpl");
$a->page['content'] = replace_macros( $a->page['content'] = replace_macros(
$tpl, $tpl,
[ [
'$message' => t('Page not found.')] '$message' => L10n::t('Page not found.')]
); );
} }
} }
@ -417,8 +417,8 @@ if (isset($homebase)) {
* now that we've been through the module content, see if the page reported * now that we've been through the module content, see if the page reported
* a permission problem and if so, a 403 response would seem to be in order. * a permission problem and if so, a 403 response would seem to be in order.
*/ */
if (stristr(implode("", $_SESSION['sysmsg']), t('Permission denied'))) { if (stristr(implode("", $_SESSION['sysmsg']), L10n::t('Permission denied'))) {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.')); header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . L10n::t('Permission denied.'));
} }
/* /*
@ -446,7 +446,7 @@ if ($a->is_mobile || $a->is_tablet) {
get_markup_template("toggle_mobile_footer.tpl"), get_markup_template("toggle_mobile_footer.tpl"),
[ [
'$toggle_link' => $link, '$toggle_link' => $link,
'$toggle_text' => t('toggle mobile')] '$toggle_text' => L10n::t('toggle mobile')]
); );
} }

File diff suppressed because it is too large Load diff

View file

@ -4,12 +4,12 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\GContact; use Friendica\Model\GContact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use dba;
require_once 'include/dba.php'; require_once 'include/dba.php';
require_once 'mod/contacts.php'; require_once 'mod/contacts.php';
@ -18,7 +18,7 @@ function allfriends_content(App $a)
{ {
$o = ''; $o = '';
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -48,7 +48,7 @@ function allfriends_content(App $a)
$r = GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']); $r = GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
$o .= t('No friends to display.'); $o .= L10n::t('No friends to display.');
return $o; return $o;
} }
@ -70,8 +70,8 @@ function allfriends_content(App $a)
} else { } else {
$connlnk = System::baseUrl() . '/follow/?url=' . $rr['url']; $connlnk = System::baseUrl() . '/follow/?url=' . $rr['url'];
$photo_menu = [ $photo_menu = [
'profile' => [t("View Profile"), Profile::zrl($rr['url'])], 'profile' => [L10n::t("View Profile"), Profile::zrl($rr['url'])],
'follow' => [t("Connect/Follow"), $connlnk] 'follow' => [L10n::t("Connect/Follow"), $connlnk]
]; ];
} }
@ -87,7 +87,7 @@ function allfriends_content(App $a)
'account_type' => Contact::getAccountType($contact_details), 'account_type' => Contact::getAccountType($contact_details),
'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']), 'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu, 'photo_menu' => $photo_menu,
'conntxt' => t('Connect'), 'conntxt' => L10n::t('Connect'),
'connlnk' => $connlnk, 'connlnk' => $connlnk,
'id' => ++$id, 'id' => ++$id,
]; ];
@ -99,7 +99,7 @@ function allfriends_content(App $a)
$tpl = get_markup_template('viewcontact_template.tpl'); $tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl, [ $o .= replace_macros($tpl, [
//'$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])), //'$title' => sprintf(L10n::t('Friends of %s'), htmlentities($c[0]['name'])),
'$tab_str' => $tab_str, '$tab_str' => $tab_str,
'$contacts' => $entries, '$contacts' => $entries,
'$paginate' => paginate($a), '$paginate' => paginate($a),

View file

@ -1,11 +1,14 @@
<?php <?php
/**
* @file mod/api.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Module\Login; use Friendica\Module\Login;
require_once('include/api.php'); require_once 'include/api.php';
function oauth_get_client($request) function oauth_get_client($request)
{ {
@ -19,8 +22,9 @@ function oauth_get_client($request)
WHERE `clients`.`client_id`=`tokens`.`client_id` WHERE `clients`.`client_id`=`tokens`.`client_id`
AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'", dbesc($token)); AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'", dbesc($token));
if (!DBM::is_result($r)) if (!DBM::is_result($r)) {
return null; return null;
}
return $r[0]; return $r[0];
} }
@ -28,12 +32,12 @@ function oauth_get_client($request)
function api_post(App $a) function api_post(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) { if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
} }
@ -78,8 +82,8 @@ function api_content(App $a)
$tpl = get_markup_template("oauth_authorize_done.tpl"); $tpl = get_markup_template("oauth_authorize_done.tpl");
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$title' => t('Authorize application connection'), '$title' => L10n::t('Authorize application connection'),
'$info' => t('Return to your app and insert this Securty Code:'), '$info' => L10n::t('Return to your app and insert this Securty Code:'),
'$code' => $verifier, '$code' => $verifier,
]); ]);
@ -88,7 +92,7 @@ function api_content(App $a)
if (!local_user()) { if (!local_user()) {
/// @TODO We need login form to redirect to this page /// @TODO We need login form to redirect to this page
notice(t('Please login to continue.') . EOL); notice(L10n::t('Please login to continue.') . EOL);
return Login::form($a->query_string, false, $request->get_parameters()); return Login::form($a->query_string, false, $request->get_parameters());
} }
//FKOAuth1::loginUser(4); //FKOAuth1::loginUser(4);
@ -100,11 +104,11 @@ function api_content(App $a)
$tpl = get_markup_template('oauth_authorize.tpl'); $tpl = get_markup_template('oauth_authorize.tpl');
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$title' => t('Authorize application connection'), '$title' => L10n::t('Authorize application connection'),
'$app' => $app, '$app' => $app,
'$authorize' => t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'), '$authorize' => L10n::t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
'$yes' => t('Yes'), '$yes' => L10n::t('Yes'),
'$no' => t('No'), '$no' => L10n::t('No'),
]); ]);
return $o; return $o;

View file

@ -1,21 +1,25 @@
<?php <?php
/**
* @file mod/apps.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
function apps_content(App $a) { function apps_content(App $a)
{
$privateaddons = Config::get('config', 'private_addons'); $privateaddons = Config::get('config', 'private_addons');
if ($privateaddons === "1") { if ($privateaddons === "1") {
if (! local_user()) { if (! local_user()) {
info(t('You must be logged in to use addons. ')); info(L10n::t('You must be logged in to use addons. '));
return; return;
}; };
} }
$title = t('Applications'); $title = L10n::t('Applications');
if (count($a->apps) == 0) { if (count($a->apps) == 0) {
notice(t('No installed applications.') . EOL); notice(L10n::t('No installed applications.') . EOL);
} }
$tpl = get_markup_template('apps.tpl'); $tpl = get_markup_template('apps.tpl');

View file

@ -1,14 +1,18 @@
<?php <?php
/**
* @file mod/attach.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once('include/security.php'); require_once 'include/dba.php';
require_once 'include/security.php';
function attach_init(App $a) { function attach_init(App $a)
{
if($a->argc != 2) { if ($a->argc != 2) {
notice( t('Item not available.') . EOL); notice(L10n::t('Item not available.') . EOL);
return; return;
} }
@ -16,15 +20,13 @@ function attach_init(App $a) {
// Check for existence, which will also provide us the owner uid // Check for existence, which will also provide us the owner uid
$r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1", $r = dba::selectFirst('attach', [], ['id' => $item_id]);
intval($item_id) if (!DBM::is_result($r)) {
); notice(L10n::t('Item was not found.'). EOL);
if (! DBM::is_result($r)) {
notice( t('Item was not found.'). EOL);
return; return;
} }
$sql_extra = permissions_sql($r[0]['uid']); $sql_extra = permissions_sql($r['uid']);
// Now we'll see if we can access the attachment // Now we'll see if we can access the attachment
@ -32,8 +34,8 @@ function attach_init(App $a) {
dbesc($item_id) dbesc($item_id)
); );
if (! DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -41,10 +43,11 @@ function attach_init(App $a) {
// error in Chrome for filenames with commas in them // error in Chrome for filenames with commas in them
header('Content-type: ' . $r[0]['filetype']); header('Content-type: ' . $r[0]['filetype']);
header('Content-length: ' . $r[0]['filesize']); header('Content-length: ' . $r[0]['filesize']);
if(isset($_GET['attachment']) && $_GET['attachment'] === '0') if (isset($_GET['attachment']) && $_GET['attachment'] === '0') {
header('Content-disposition: filename="' . $r[0]['filename'] . '"'); header('Content-disposition: filename="' . $r[0]['filename'] . '"');
else } else {
header('Content-disposition: attachment; filename="' . $r[0]['filename'] . '"'); header('Content-disposition: attachment; filename="' . $r[0]['filename'] . '"');
}
echo $r[0]['data']; echo $r[0]['data'];
killme(); killme();

View file

@ -1,6 +1,9 @@
<?php <?php
/**
* @file mod/babel.php
*/
use Friendica\Content\Text\Markdown; use Friendica\Content\Text\Markdown;
use Friendica\Core\L10n;
require_once 'include/bbcode.php'; require_once 'include/bbcode.php';
require_once 'include/bb2diaspora.php'; require_once 'include/bb2diaspora.php';
@ -17,14 +20,14 @@ function babel_content()
$o = '<h1>Babel Diagnostic</h1>'; $o = '<h1>Babel Diagnostic</h1>';
$o .= '<form action="babel" method="post">'; $o .= '<form action="babel" method="post">';
$o .= t('Source (bbcode) text:') . EOL; $o .= L10n::t('Source (bbcode) text:') . EOL;
$o .= '<textarea name="text" cols="80" rows="10">' . htmlspecialchars($_REQUEST['text']) . '</textarea>' . EOL; $o .= '<textarea name="text" cols="80" rows="10">' . htmlspecialchars($_REQUEST['text']) . '</textarea>' . EOL;
$o .= '<input type="submit" name="submit" value="Submit" /></form>'; $o .= '<input type="submit" name="submit" value="Submit" /></form>';
$o .= '<br /><br />'; $o .= '<br /><br />';
$o .= '<form action="babel" method="post">'; $o .= '<form action="babel" method="post">';
$o .= t('Source (Diaspora) text to convert to BBcode:') . EOL; $o .= L10n::t('Source (Diaspora) text to convert to BBcode:') . EOL;
$o .= '<textarea name="d2bbtext" cols="80" rows="10">' . htmlspecialchars($_REQUEST['d2bbtext']) . '</textarea>' . EOL; $o .= '<textarea name="d2bbtext" cols="80" rows="10">' . htmlspecialchars($_REQUEST['d2bbtext']) . '</textarea>' . EOL;
$o .= '<input type="submit" name="submit" value="Submit" /></form>'; $o .= '<input type="submit" name="submit" value="Submit" /></form>';
@ -32,45 +35,45 @@ function babel_content()
if (x($_REQUEST, 'text')) { if (x($_REQUEST, 'text')) {
$text = trim($_REQUEST['text']); $text = trim($_REQUEST['text']);
$o .= '<h2>' . t('Source input: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('Source input: ') . '</h2>' . EOL . EOL;
$o .= visible_lf($text) . EOL . EOL; $o .= visible_lf($text) . EOL . EOL;
$html = bbcode($text); $html = bbcode($text);
$o .= '<h2>' . t('bbcode (raw HTML): ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bbcode (raw HTML): ') . '</h2>' . EOL . EOL;
$o .= htmlspecialchars($html) . EOL . EOL; $o .= htmlspecialchars($html) . EOL . EOL;
//$html = bbcode($text); //$html = bbcode($text);
$o .= '<h2>' . t('bbcode: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bbcode: ') . '</h2>' . EOL . EOL;
$o .= $html . EOL . EOL; $o .= $html . EOL . EOL;
$bbcode = html2bbcode($html); $bbcode = html2bbcode($html);
$o .= '<h2>' . t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL;
$o .= visible_lf($bbcode) . EOL . EOL; $o .= visible_lf($bbcode) . EOL . EOL;
$diaspora = bb2diaspora($text); $diaspora = bb2diaspora($text);
$o .= '<h2>' . t('bb2diaspora: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bb2diaspora: ') . '</h2>' . EOL . EOL;
$o .= visible_lf($diaspora) . EOL . EOL; $o .= visible_lf($diaspora) . EOL . EOL;
$html = Markdown::convert($diaspora); $html = Markdown::convert($diaspora);
$o .= '<h2>' . t('bb2diaspora => Markdown: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bb2diaspora => Markdown: ') . '</h2>' . EOL . EOL;
$o .= $html . EOL . EOL; $o .= $html . EOL . EOL;
$bbcode = diaspora2bb($diaspora); $bbcode = diaspora2bb($diaspora);
$o .= '<h2>' . t('bb2diaspora => diaspora2bb: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bb2diaspora => diaspora2bb: ') . '</h2>' . EOL . EOL;
$o .= visible_lf($bbcode) . EOL . EOL; $o .= visible_lf($bbcode) . EOL . EOL;
$bbcode = html2bbcode($html); $bbcode = html2bbcode($html);
$o .= '<h2>' . t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL;
$o .= visible_lf($bbcode) . EOL . EOL; $o .= visible_lf($bbcode) . EOL . EOL;
} }
if (x($_REQUEST, 'd2bbtext')) { if (x($_REQUEST, 'd2bbtext')) {
$d2bbtext = trim($_REQUEST['d2bbtext']); $d2bbtext = trim($_REQUEST['d2bbtext']);
$o .= '<h2>' . t('Source input (Diaspora format): ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('Source input (Diaspora format): ') . '</h2>' . EOL . EOL;
$o .= '<pre>' . $d2bbtext . '</pre>' . EOL . EOL; $o .= '<pre>' . $d2bbtext . '</pre>' . EOL . EOL;
$bb = diaspora2bb($d2bbtext); $bb = diaspora2bb($d2bbtext);
$o .= '<h2>' . t('diaspora2bb: ') . '</h2>' . EOL . EOL; $o .= '<h2>' . L10n::t('diaspora2bb: ') . '</h2>' . EOL . EOL;
$o .= '<pre>' . $bb . '</pre>' . EOL . EOL; $o .= '<pre>' . $bb . '</pre>' . EOL . EOL;
} }

View file

@ -1,11 +1,14 @@
<?php <?php
/**
* @file mod/bookmarklet.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Module\Login; use Friendica\Module\Login;
require_once('include/conversation.php'); require_once 'include/conversation.php';
require_once('include/items.php'); require_once 'include/items.php';
function bookmarklet_init() function bookmarklet_init()
{ {
@ -15,7 +18,7 @@ function bookmarklet_init()
function bookmarklet_content(App $a) function bookmarklet_content(App $a)
{ {
if (!local_user()) { if (!local_user()) {
$o = '<h2>' . t('Login') . '</h2>'; $o = '<h2>' . L10n::t('Login') . '</h2>';
$o .= Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true); $o .= Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true);
return $o; return $o;
} }
@ -43,7 +46,7 @@ function bookmarklet_content(App $a)
$o = status_editor($a, $x, 0, false); $o = status_editor($a, $x, 0, false);
$o .= "<script>window.resizeTo(800,550);</script>"; $o .= "<script>window.resizeTo(800,550);</script>";
} else { } else {
$o = '<h2>' . t('The post was created') . '</h2>'; $o = '<h2>' . L10n::t('The post was created') . '</h2>';
$o .= "<script>window.close()</script>"; $o .= "<script>window.close()</script>";
} }

View file

@ -9,6 +9,7 @@ use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -135,7 +136,7 @@ function cal_content(App $a)
$is_owner = local_user() == $a->profile['profile_uid']; $is_owner = local_user() == $a->profile['profile_uid'];
if ($a->profile['hidewall'] && (!$is_owner) && (!$remote_contact)) { if ($a->profile['hidewall'] && (!$is_owner) && (!$remote_contact)) {
notice(t('Access to this profile has been restricted.') . EOL); notice(L10n::t('Access to this profile has been restricted.') . EOL);
return; return;
} }
@ -267,17 +268,17 @@ function cal_content(App $a)
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(), '$baseurl' => System::baseUrl(),
'$tabs' => $tabs, '$tabs' => $tabs,
'$title' => t('Events'), '$title' => L10n::t('Events'),
'$view' => t('View'), '$view' => L10n::t('View'),
'$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", t('Previous'), '', ''], '$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", L10n::t('Previous'), '', ''],
'$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", t('Next'), '', ''], '$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", L10n::t('Next'), '', ''],
'$calendar' => cal($y, $m, $links, ' eventcal'), '$calendar' => cal($y, $m, $links, ' eventcal'),
'$events' => $events, '$events' => $events,
"today" => t("today"), "today" => L10n::t("today"),
"month" => t("month"), "month" => L10n::t("month"),
"week" => t("week"), "week" => L10n::t("week"),
"day" => t("day"), "day" => L10n::t("day"),
"list" => t("list"), "list" => L10n::t("list"),
]); ]);
if (x($_GET, 'id')) { if (x($_GET, 'id')) {
@ -290,14 +291,14 @@ function cal_content(App $a)
if ($mode == 'export') { if ($mode == 'export') {
if (!(intval($owner_uid))) { if (!(intval($owner_uid))) {
notice(t('User not found')); notice(L10n::t('User not found'));
return; return;
} }
// Test permissions // Test permissions
// Respect the export feature setting for all other /cal pages if it's not the own profile // Respect the export feature setting for all other /cal pages if it's not the own profile
if (((local_user() !== intval($owner_uid))) && !Feature::isEnabled($owner_uid, "export_calendar")) { if (((local_user() !== intval($owner_uid))) && !Feature::isEnabled($owner_uid, "export_calendar")) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway('cal/' . $nick); goaway('cal/' . $nick);
} }
@ -306,9 +307,9 @@ function cal_content(App $a)
if (!$evexport["success"]) { if (!$evexport["success"]) {
if ($evexport["content"]) { if ($evexport["content"]) {
notice(t('This calendar format is not supported')); notice(L10n::t('This calendar format is not supported'));
} else { } else {
notice(t('No exportable data found')); notice(L10n::t('No exportable data found'));
} }
// If it the own calendar return to the events page // If it the own calendar return to the events page
@ -325,7 +326,7 @@ function cal_content(App $a)
// If nothing went wrong we can echo the export content // If nothing went wrong we can echo the export content
if ($evexport["success"]) { if ($evexport["success"]) {
header('Content-type: text/calendar'); header('Content-type: text/calendar');
header('content-disposition: attachment; filename="' . t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"'); header('content-disposition: attachment; filename="' . L10n::t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
echo $evexport["content"]; echo $evexport["content"];
killme(); killme();
} }

View file

@ -4,11 +4,11 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\GContact; use Friendica\Model\GContact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use dba;
require_once 'include/dba.php'; require_once 'include/dba.php';
require_once 'mod/contacts.php'; require_once 'mod/contacts.php';
@ -23,7 +23,7 @@ function common_content(App $a)
$zcid = 0; $zcid = 0;
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -88,7 +88,7 @@ function common_content(App $a)
if ($t > 0) { if ($t > 0) {
$a->set_pager_total($t); $a->set_pager_total($t);
} else { } else {
notice(t('No contacts in common.') . EOL); notice(L10n::t('No contacts in common.') . EOL);
return $o; return $o;
} }
@ -137,7 +137,7 @@ function common_content(App $a)
if ($cmd === 'loc' && $cid && local_user() == $uid) { if ($cmd === 'loc' && $cid && local_user() == $uid) {
$tab_str = contacts_tab($a, $cid, 4); $tab_str = contacts_tab($a, $cid, 4);
} else { } else {
$title = t('Common Friends'); $title = L10n::t('Common Friends');
} }
$tpl = get_markup_template('viewcontact_template.tpl'); $tpl = get_markup_template('viewcontact_template.tpl');

View file

@ -5,6 +5,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -21,7 +22,7 @@ function community_content(App $a, $update = 0)
$o = ''; $o = '';
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) { if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
notice(t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -30,7 +31,7 @@ function community_content(App $a, $update = 0)
if ($a->argc > 1) { if ($a->argc > 1) {
$content = $a->argv[1]; $content = $a->argv[1];
} else { } else {
if (!empty(Config::get('system','singleuser'))) { if (!empty(Config::get('system', 'singleuser'))) {
// On single user systems only the global page does make sense // On single user systems only the global page does make sense
$content = 'global'; $content = 'global';
} else { } else {
@ -40,7 +41,7 @@ function community_content(App $a, $update = 0)
} }
if (!in_array($content, ['local', 'global'])) { if (!in_array($content, ['local', 'global'])) {
notice(t('Community option not available.') . EOL); notice(L10n::t('Community option not available.') . EOL);
return; return;
} }
@ -57,7 +58,7 @@ function community_content(App $a, $update = 0)
} }
if (!$available) { if (!$available) {
notice(t('Not available.') . EOL); notice(L10n::t('Not available.') . EOL);
return; return;
} }
} }
@ -69,12 +70,12 @@ function community_content(App $a, $update = 0)
if (!$update) { if (!$update) {
$tabs = []; $tabs = [];
if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system','singleuser'))) { if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system', 'singleuser'))) {
$tabs[] = [ $tabs[] = [
'label' => t('Community'), 'label' => L10n::t('Community'),
'url' => 'community/local', 'url' => 'community/local',
'sel' => $content == 'local' ? 'active' : '', 'sel' => $content == 'local' ? 'active' : '',
'title' => t('Posts from local users on this server'), 'title' => L10n::t('Posts from local users on this server'),
'id' => 'community-local-tab', 'id' => 'community-local-tab',
'accesskey' => 'l' 'accesskey' => 'l'
]; ];
@ -82,10 +83,10 @@ function community_content(App $a, $update = 0)
if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) { if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) {
$tabs[] = [ $tabs[] = [
'label' => t('Global Timeline'), 'label' => L10n::t('Global Timeline'),
'url' => 'community/global', 'url' => 'community/global',
'sel' => $content == 'global' ? 'active' : '', 'sel' => $content == 'global' ? 'active' : '',
'title' => t('Posts from users of the federated network'), 'title' => L10n::t('Posts from users of the federated network'),
'id' => 'community-global-tab', 'id' => 'community-global-tab',
'accesskey' => 'g' 'accesskey' => 'g'
]; ];
@ -134,7 +135,7 @@ function community_content(App $a, $update = 0)
$r = community_getitems($a->pager['start'], $a->pager['itemspage'], $content); $r = community_getitems($a->pager['start'], $a->pager['itemspage'], $content);
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
info(t('No results.') . EOL); info(L10n::t('No results.') . EOL);
return $o; return $o;
} }
@ -178,7 +179,7 @@ function community_content(App $a, $update = 0)
'$content' => $o, '$content' => $o,
'$header' => '', '$header' => '',
'$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'), '$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'),
'$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this nodes users.") '$global_community_hint' => L10n::t("This community stream shows all public posts received by this node. They may not reflect the opinions of this nodes users.")
]); ]);
} }

View file

@ -7,6 +7,7 @@ use Friendica\Content\ContactSelector;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -56,7 +57,7 @@ function contacts_init(App $a)
'$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/" . $a->data['contact']['id'] : $a->data['contact']['url'], '$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/" . $a->data['contact']['id'] : $a->data['contact']['url'],
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""), '$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
'$network_name' => $networkname, '$network_name' => $networkname,
'$network' => t('Network:'), '$network' => L10n::t('Network:'),
'$account_type' => Contact::getAccountType($a->data['contact']) '$account_type' => Contact::getAccountType($a->data['contact'])
]); ]);
@ -169,7 +170,7 @@ function contacts_post(App $a)
} }
if (!dba::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) { if (!dba::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
notice(t('Could not access contact record.') . EOL); notice(L10n::t('Could not access contact record.') . EOL);
goaway('contacts'); goaway('contacts');
return; // NOTREACHED return; // NOTREACHED
} }
@ -179,7 +180,7 @@ function contacts_post(App $a)
$profile_id = intval($_POST['profile-assign']); $profile_id = intval($_POST['profile-assign']);
if ($profile_id) { if ($profile_id) {
if (!dba::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) { if (!dba::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
notice(t('Could not locate selected profile.') . EOL); notice(L10n::t('Could not locate selected profile.') . EOL);
return; return;
} }
} }
@ -213,9 +214,9 @@ function contacts_post(App $a)
intval(local_user()) intval(local_user())
); );
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
info(t('Contact updated.') . EOL); info(L10n::t('Contact updated.') . EOL);
} else { } else {
notice(t('Failed to update contact record.') . EOL); notice(L10n::t('Failed to update contact record.') . EOL);
} }
$contact = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]); $contact = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
@ -374,7 +375,7 @@ function contacts_content(App $a)
Nav::setSelected('contacts'); Nav::setSelected('contacts');
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -388,7 +389,7 @@ function contacts_content(App $a)
$orig_record = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]); $orig_record = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
if (!DBM::is_result($orig_record)) { if (!DBM::is_result($orig_record)) {
notice(t('Could not access contact record.') . EOL); notice(L10n::t('Could not access contact record.') . EOL);
goaway('contacts'); goaway('contacts');
return; // NOTREACHED return; // NOTREACHED
} }
@ -409,7 +410,7 @@ function contacts_content(App $a)
$r = _contact_block($contact_id, $orig_record); $r = _contact_block($contact_id, $orig_record);
if ($r) { if ($r) {
$blocked = (($orig_record['blocked']) ? 0 : 1); $blocked = (($orig_record['blocked']) ? 0 : 1);
info((($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL); info((($blocked) ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
} }
goaway('contacts/' . $contact_id); goaway('contacts/' . $contact_id);
@ -420,7 +421,7 @@ function contacts_content(App $a)
$r = _contact_ignore($contact_id, $orig_record); $r = _contact_ignore($contact_id, $orig_record);
if ($r) { if ($r) {
$readonly = (($orig_record['readonly']) ? 0 : 1); $readonly = (($orig_record['readonly']) ? 0 : 1);
info((($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL); info((($readonly) ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
} }
goaway('contacts/' . $contact_id); goaway('contacts/' . $contact_id);
@ -431,7 +432,7 @@ function contacts_content(App $a)
$r = _contact_archive($contact_id, $orig_record); $r = _contact_archive($contact_id, $orig_record);
if ($r) { if ($r) {
$archived = (($orig_record['archive']) ? 0 : 1); $archived = (($orig_record['archive']) ? 0 : 1);
info((($archived) ? t('Contact has been archived') : t('Contact has been unarchived')) . EOL); info((($archived) ? L10n::t('Contact has been archived') : L10n::t('Contact has been unarchived')) . EOL);
} }
goaway('contacts/' . $contact_id); goaway('contacts/' . $contact_id);
@ -455,15 +456,15 @@ function contacts_content(App $a)
$a->page['aside'] = ''; $a->page['aside'] = '';
return replace_macros(get_markup_template('contact_drop_confirm.tpl'), [ return replace_macros(get_markup_template('contact_drop_confirm.tpl'), [
'$header' => t('Drop contact'), '$header' => L10n::t('Drop contact'),
'$contact' => _contact_detail_for_template($orig_record), '$contact' => _contact_detail_for_template($orig_record),
'$method' => 'get', '$method' => 'get',
'$message' => t('Do you really want to delete this contact?'), '$message' => L10n::t('Do you really want to delete this contact?'),
'$extra_inputs' => $inputs, '$extra_inputs' => $inputs,
'$confirm' => t('Yes'), '$confirm' => L10n::t('Yes'),
'$confirm_url' => $query['base'], '$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed', '$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'), '$cancel' => L10n::t('Cancel'),
]); ]);
} }
// Now check how the user responded to the confirmation query // Now check how the user responded to the confirmation query
@ -476,7 +477,7 @@ function contacts_content(App $a)
} }
_contact_drop($orig_record); _contact_drop($orig_record);
info(t('Contact has been removed.') . EOL); info(L10n::t('Contact has been removed.') . EOL);
if (x($_SESSION, 'return_url')) { if (x($_SESSION, 'return_url')) {
goaway('' . $_SESSION['return_url']); goaway('' . $_SESSION['return_url']);
} else { } else {
@ -507,15 +508,15 @@ function contacts_content(App $a)
switch ($contact['rel']) { switch ($contact['rel']) {
case CONTACT_IS_FRIEND: case CONTACT_IS_FRIEND:
$dir_icon = 'images/lrarrow.gif'; $dir_icon = 'images/lrarrow.gif';
$relation_text = t('You are mutual friends with %s'); $relation_text = L10n::t('You are mutual friends with %s');
break; break;
case CONTACT_IS_FOLLOWER; case CONTACT_IS_FOLLOWER;
$dir_icon = 'images/larrow.gif'; $dir_icon = 'images/larrow.gif';
$relation_text = t('You are sharing with %s'); $relation_text = L10n::t('You are sharing with %s');
break; break;
case CONTACT_IS_SHARING; case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif'; $dir_icon = 'images/rarrow.gif';
$relation_text = t('%s is sharing with you'); $relation_text = L10n::t('%s is sharing with you');
break; break;
default: default:
break; break;
@ -535,35 +536,35 @@ function contacts_content(App $a)
$sparkle = ''; $sparkle = '';
} }
$insecure = t('Private communications are not available for this contact.'); $insecure = L10n::t('Private communications are not available for this contact.');
$last_update = (($contact['last-update'] <= NULL_DATE) ? t('Never') : datetime_convert('UTC', date_default_timezone_get(), $contact['last-update'], 'D, j M Y, g:i A')); $last_update = (($contact['last-update'] <= NULL_DATE) ? L10n::t('Never') : datetime_convert('UTC', date_default_timezone_get(), $contact['last-update'], 'D, j M Y, g:i A'));
if ($contact['last-update'] > NULL_DATE) { if ($contact['last-update'] > NULL_DATE) {
$last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29")); $last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? L10n::t("\x28Update was successful\x29") : L10n::t("\x28Update was not successful\x29"));
} }
$lblsuggest = (($contact['network'] === NETWORK_DFRN) ? t('Suggest friends') : ''); $lblsuggest = (($contact['network'] === NETWORK_DFRN) ? L10n::t('Suggest friends') : '');
$poll_enabled = in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL]); $poll_enabled = in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL]);
$nettype = t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"])); $nettype = L10n::t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"]));
// tabs // tabs
$tab_str = contacts_tab($a, $contact_id, 2); $tab_str = contacts_tab($a, $contact_id, 2);
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_convert('', '', 'now')) ? t('Communications lost with this contact!') : ''); $lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_converL10n::t('', '', 'now')) ? L10n::t('Communications lost with this contact!') : '');
$fetch_further_information = null; $fetch_further_information = null;
if ($contact['network'] == NETWORK_FEED) { if ($contact['network'] == NETWORK_FEED) {
$fetch_further_information = [ $fetch_further_information = [
'fetch_further_information', 'fetch_further_information',
t('Fetch further information for feeds'), L10n::t('Fetch further information for feeds'),
$contact['fetch_further_information'], $contact['fetch_further_information'],
t("Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn't contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags."), L10n::t("Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn't contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags."),
['0' => t('Disabled'), ['0' => L10n::t('Disabled'),
'1' => t('Fetch information'), '1' => L10n::t('Fetch information'),
'3' => t('Fetch keywords'), '3' => L10n::t('Fetch keywords'),
'2' => t('Fetch information and keywords') '2' => L10n::t('Fetch information and keywords')
] ]
]; ];
} }
@ -583,10 +584,10 @@ function contacts_content(App $a)
if (in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) { if (in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
if ($contact['rel'] == CONTACT_IS_FOLLOWER) { if ($contact['rel'] == CONTACT_IS_FOLLOWER) {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]); $follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = t("Connect/Follow"); $follow_text = L10n::t("Connect/Follow");
} elseif ($contact['rel'] == CONTACT_IS_FRIEND) { } elseif ($contact['rel'] == CONTACT_IS_FRIEND) {
$follow = System::baseUrl(true) . "/unfollow?url=" . urlencode($contact["url"]); $follow = System::baseUrl(true) . "/unfollow?url=" . urlencode($contact["url"]);
$follow_text = t("Disconnect/Unfollow"); $follow_text = L10n::t("Disconnect/Unfollow");
} }
} }
@ -595,70 +596,70 @@ function contacts_content(App $a)
$tpl = get_markup_template("contact_edit.tpl"); $tpl = get_markup_template("contact_edit.tpl");
$o .= replace_macros($tpl, [ $o .= replace_macros($tpl, [
'$header' => t("Contact"), '$header' => L10n::t("Contact"),
'$tab_str' => $tab_str, '$tab_str' => $tab_str,
'$submit' => t('Submit'), '$submit' => L10n::t('Submit'),
'$lbl_vis1' => t('Profile Visibility'), '$lbl_vis1' => L10n::t('Profile Visibility'),
'$lbl_vis2' => t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']), '$lbl_vis2' => L10n::t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
'$lbl_info1' => t('Contact Information / Notes'), '$lbl_info1' => L10n::t('Contact Information / Notes'),
'$lbl_info2' => t('Their personal note'), '$lbl_info2' => L10n::t('Their personal note'),
'$reason' => trim(notags($contact['reason'])), '$reason' => trim(notags($contact['reason'])),
'$infedit' => t('Edit contact notes'), '$infedit' => L10n::t('Edit contact notes'),
'$common_link' => 'common/loc/' . local_user() . '/' . $contact['id'], '$common_link' => 'common/loc/' . local_user() . '/' . $contact['id'],
'$relation_text' => $relation_text, '$relation_text' => $relation_text,
'$visit' => t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']), '$visit' => L10n::t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
'$blockunblock' => t('Block/Unblock contact'), '$blockunblock' => L10n::t('Block/Unblock contact'),
'$ignorecont' => t('Ignore contact'), '$ignorecont' => L10n::t('Ignore contact'),
'$lblcrepair' => t("Repair URL settings"), '$lblcrepair' => L10n::t("Repair URL settings"),
'$lblrecent' => t('View conversations'), '$lblrecent' => L10n::t('View conversations'),
'$lblsuggest' => $lblsuggest, '$lblsuggest' => $lblsuggest,
'$nettype' => $nettype, '$nettype' => $nettype,
'$poll_interval' => $poll_interval, '$poll_interval' => $poll_interval,
'$poll_enabled' => $poll_enabled, '$poll_enabled' => $poll_enabled,
'$lastupdtext' => t('Last update:'), '$lastupdtext' => L10n::t('Last update:'),
'$lost_contact' => $lost_contact, '$lost_contact' => $lost_contact,
'$updpub' => t('Update public posts'), '$updpub' => L10n::t('Update public posts'),
'$last_update' => $last_update, '$last_update' => $last_update,
'$udnow' => t('Update now'), '$udnow' => L10n::t('Update now'),
'$follow' => $follow, '$follow' => $follow,
'$follow_text' => $follow_text, '$follow_text' => $follow_text,
'$profile_select' => $profile_select, '$profile_select' => $profile_select,
'$contact_id' => $contact['id'], '$contact_id' => $contact['id'],
'$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ), '$block_text' => (($contact['blocked']) ? L10n::t('Unblock') : L10n::t('Block') ),
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ), '$ignore_text' => (($contact['readonly']) ? L10n::t('Unignore') : L10n::t('Ignore') ),
'$insecure' => (($contact['network'] !== NETWORK_DFRN && $contact['network'] !== NETWORK_MAIL && $contact['network'] !== NETWORK_FACEBOOK && $contact['network'] !== NETWORK_DIASPORA) ? $insecure : ''), '$insecure' => (($contact['network'] !== NETWORK_DFRN && $contact['network'] !== NETWORK_MAIL && $contact['network'] !== NETWORK_FACEBOOK && $contact['network'] !== NETWORK_DIASPORA) ? $insecure : ''),
'$info' => $contact['info'], '$info' => $contact['info'],
'$cinfo' => ['info', '', $contact['info'], ''], '$cinfo' => ['info', '', $contact['info'], ''],
'$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''), '$blocked' => (($contact['blocked']) ? L10n::t('Currently blocked') : ''),
'$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''), '$ignored' => (($contact['readonly']) ? L10n::t('Currently ignored') : ''),
'$archived' => (($contact['archive']) ? t('Currently archived') : ''), '$archived' => (($contact['archive']) ? L10n::t('Currently archived') : ''),
'$pending' => (($contact['pending']) ? t('Awaiting connection acknowledge') : ''), '$pending' => (($contact['pending']) ? L10n::t('Awaiting connection acknowledge') : ''),
'$hidden' => ['hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')], '$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($contact['hidden'] == 1), L10n::t('Replies/likes to your public posts <strong>may</strong> still be visible')],
'$notify' => ['notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')], '$notify' => ['notify', L10n::t('Notification for new posts'), ($contact['notify_new_posts'] == 1), L10n::t('Send a notification of every new post of this contact')],
'$fetch_further_information' => $fetch_further_information, '$fetch_further_information' => $fetch_further_information,
'$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'], '$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'],
'$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')], '$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', L10n::t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], L10n::t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
'$photo' => $contact['photo'], '$photo' => $contact['photo'],
'$name' => htmlentities($contact['name']), '$name' => htmlentities($contact['name']),
'$dir_icon' => $dir_icon, '$dir_icon' => $dir_icon,
'$sparkle' => $sparkle, '$sparkle' => $sparkle,
'$url' => $url, '$url' => $url,
'$profileurllabel' => t('Profile URL'), '$profileurllabel' => L10n::t('Profile URL'),
'$profileurl' => $contact['url'], '$profileurl' => $contact['url'],
'$account_type' => Contact::getAccountType($contact), '$account_type' => Contact::getAccountType($contact),
'$location' => bbcode($contact["location"]), '$location' => bbcode($contact["location"]),
'$location_label' => t("Location:"), '$location_label' => L10n::t("Location:"),
'$xmpp' => bbcode($contact["xmpp"]), '$xmpp' => bbcode($contact["xmpp"]),
'$xmpp_label' => t("XMPP:"), '$xmpp_label' => L10n::t("XMPP:"),
'$about' => bbcode($contact["about"], false, false), '$about' => bbcode($contact["about"], false, false),
'$about_label' => t("About:"), '$about_label' => L10n::t("About:"),
'$keywords' => $contact["keywords"], '$keywords' => $contact["keywords"],
'$keywords_label' => t("Tags:"), '$keywords_label' => L10n::t("Tags:"),
'$contact_action_button' => t("Actions"), '$contact_action_button' => L10n::t("Actions"),
'$contact_actions' => $contact_actions, '$contact_actions' => $contact_actions,
'$contact_status' => t("Status"), '$contact_status' => L10n::t("Status"),
'$contact_settings_label' => t('Contact Settings'), '$contact_settings_label' => L10n::t('Contact Settings'),
'$contact_profile_label' => t("Profile"), '$contact_profile_label' => L10n::t("Profile"),
]); ]);
$arr = ['contact' => $contact, 'output' => $o]; $arr = ['contact' => $contact, 'output' => $o];
@ -698,58 +699,58 @@ function contacts_content(App $a)
$tabs = [ $tabs = [
[ [
'label' => t('Suggestions'), 'label' => L10n::t('Suggestions'),
'url' => 'suggest', 'url' => 'suggest',
'sel' => '', 'sel' => '',
'title' => t('Suggest potential friends'), 'title' => L10n::t('Suggest potential friends'),
'id' => 'suggestions-tab', 'id' => 'suggestions-tab',
'accesskey' => 'g', 'accesskey' => 'g',
], ],
[ [
'label' => t('All Contacts'), 'label' => L10n::t('All Contacts'),
'url' => 'contacts/all', 'url' => 'contacts/all',
'sel' => ($all) ? 'active' : '', 'sel' => ($all) ? 'active' : '',
'title' => t('Show all contacts'), 'title' => L10n::t('Show all contacts'),
'id' => 'showall-tab', 'id' => 'showall-tab',
'accesskey' => 'l', 'accesskey' => 'l',
], ],
[ [
'label' => t('Unblocked'), 'label' => L10n::t('Unblocked'),
'url' => 'contacts', 'url' => 'contacts',
'sel' => ((!$all) && (!$blocked) && (!$hidden) && (!$search) && (!$nets) && (!$ignored) && (!$archived)) ? 'active' : '', 'sel' => ((!$all) && (!$blocked) && (!$hidden) && (!$search) && (!$nets) && (!$ignored) && (!$archived)) ? 'active' : '',
'title' => t('Only show unblocked contacts'), 'title' => L10n::t('Only show unblocked contacts'),
'id' => 'showunblocked-tab', 'id' => 'showunblocked-tab',
'accesskey' => 'o', 'accesskey' => 'o',
], ],
[ [
'label' => t('Blocked'), 'label' => L10n::t('Blocked'),
'url' => 'contacts/blocked', 'url' => 'contacts/blocked',
'sel' => ($blocked) ? 'active' : '', 'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked contacts'), 'title' => L10n::t('Only show blocked contacts'),
'id' => 'showblocked-tab', 'id' => 'showblocked-tab',
'accesskey' => 'b', 'accesskey' => 'b',
], ],
[ [
'label' => t('Ignored'), 'label' => L10n::t('Ignored'),
'url' => 'contacts/ignored', 'url' => 'contacts/ignored',
'sel' => ($ignored) ? 'active' : '', 'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored contacts'), 'title' => L10n::t('Only show ignored contacts'),
'id' => 'showignored-tab', 'id' => 'showignored-tab',
'accesskey' => 'i', 'accesskey' => 'i',
], ],
[ [
'label' => t('Archived'), 'label' => L10n::t('Archived'),
'url' => 'contacts/archived', 'url' => 'contacts/archived',
'sel' => ($archived) ? 'active' : '', 'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived contacts'), 'title' => L10n::t('Only show archived contacts'),
'id' => 'showarchived-tab', 'id' => 'showarchived-tab',
'accesskey' => 'y', 'accesskey' => 'y',
], ],
[ [
'label' => t('Hidden'), 'label' => L10n::t('Hidden'),
'url' => 'contacts/hidden', 'url' => 'contacts/hidden',
'sel' => ($hidden) ? 'active' : '', 'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden contacts'), 'title' => L10n::t('Only show hidden contacts'),
'id' => 'showhidden-tab', 'id' => 'showhidden-tab',
'accesskey' => 'h', 'accesskey' => 'h',
], ],
@ -801,25 +802,25 @@ function contacts_content(App $a)
$tpl = get_markup_template("contacts-template.tpl"); $tpl = get_markup_template("contacts-template.tpl");
$o .= replace_macros($tpl, [ $o .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(), '$baseurl' => System::baseUrl(),
'$header' => t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''), '$header' => L10n::t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
'$tabs' => $t, '$tabs' => $t,
'$total' => $total, '$total' => $total,
'$search' => $search_hdr, '$search' => $search_hdr,
'$desc' => t('Search your contacts'), '$desc' => L10n::t('Search your contacts'),
'$finding' => $searching ? t('Results for: %s', $search) : "", '$finding' => $searching ? L10n::t('Results for: %s', $search) : "",
'$submit' => t('Find'), '$submit' => L10n::t('Find'),
'$cmd' => $a->cmd, '$cmd' => $a->cmd,
'$contacts' => $contacts, '$contacts' => $contacts,
'$contact_drop_confirm' => t('Do you really want to delete this contact?'), '$contact_drop_confirm' => L10n::t('Do you really want to delete this contact?'),
'multiselect' => 1, 'multiselect' => 1,
'$batch_actions' => [ '$batch_actions' => [
'contacts_batch_update' => t('Update'), 'contacts_batch_update' => L10n::t('Update'),
'contacts_batch_block' => t('Block') . "/" . t("Unblock"), 'contacts_batch_block' => L10n::t('Block') . "/" . L10n::t("Unblock"),
"contacts_batch_ignore" => t('Ignore') . "/" . t("Unignore"), "contacts_batch_ignore" => L10n::t('Ignore') . "/" . L10n::t("Unignore"),
"contacts_batch_archive" => t('Archive') . "/" . t("Unarchive"), "contacts_batch_archive" => L10n::t('Archive') . "/" . L10n::t("Unarchive"),
"contacts_batch_drop" => t('Delete'), "contacts_batch_drop" => L10n::t('Delete'),
], ],
'$h_batch_actions' => t('Batch Actions'), '$h_batch_actions' => L10n::t('Batch Actions'),
'$paginate' => paginate($a), '$paginate' => paginate($a),
]); ]);
@ -842,18 +843,18 @@ function contacts_tab($a, $contact_id, $active_tab)
// tabs // tabs
$tabs = [ $tabs = [
[ [
'label' => t('Status'), 'label' => L10n::t('Status'),
'url' => "contacts/" . $contact_id . "/posts", 'url' => "contacts/" . $contact_id . "/posts",
'sel' => (($active_tab == 1) ? 'active' : ''), 'sel' => (($active_tab == 1) ? 'active' : ''),
'title' => t('Status Messages and Posts'), 'title' => L10n::t('Status Messages and Posts'),
'id' => 'status-tab', 'id' => 'status-tab',
'accesskey' => 'm', 'accesskey' => 'm',
], ],
[ [
'label' => t('Profile'), 'label' => L10n::t('Profile'),
'url' => "contacts/" . $contact_id, 'url' => "contacts/" . $contact_id,
'sel' => (($active_tab == 2) ? 'active' : ''), 'sel' => (($active_tab == 2) ? 'active' : ''),
'title' => t('Profile Details'), 'title' => L10n::t('Profile Details'),
'id' => 'profile-tab', 'id' => 'profile-tab',
'accesskey' => 'o', 'accesskey' => 'o',
] ]
@ -862,10 +863,10 @@ function contacts_tab($a, $contact_id, $active_tab)
// Show this tab only if there is visible friend list // Show this tab only if there is visible friend list
$x = GContact::countAllFriends(local_user(), $contact_id); $x = GContact::countAllFriends(local_user(), $contact_id);
if ($x) { if ($x) {
$tabs[] = ['label' => t('Contacts'), $tabs[] = ['label' => L10n::t('Contacts'),
'url' => "allfriends/" . $contact_id, 'url' => "allfriends/" . $contact_id,
'sel' => (($active_tab == 3) ? 'active' : ''), 'sel' => (($active_tab == 3) ? 'active' : ''),
'title' => t('View all contacts'), 'title' => L10n::t('View all contacts'),
'id' => 'allfriends-tab', 'id' => 'allfriends-tab',
'accesskey' => 't']; 'accesskey' => 't'];
} }
@ -873,19 +874,19 @@ function contacts_tab($a, $contact_id, $active_tab)
// Show this tab only if there is visible common friend list // Show this tab only if there is visible common friend list
$common = GContact::countCommonFriends(local_user(), $contact_id); $common = GContact::countCommonFriends(local_user(), $contact_id);
if ($common) { if ($common) {
$tabs[] = ['label' => t('Common Friends'), $tabs[] = ['label' => L10n::t('Common Friends'),
'url' => "common/loc/" . local_user() . "/" . $contact_id, 'url' => "common/loc/" . local_user() . "/" . $contact_id,
'sel' => (($active_tab == 4) ? 'active' : ''), 'sel' => (($active_tab == 4) ? 'active' : ''),
'title' => t('View all common friends'), 'title' => L10n::t('View all common friends'),
'id' => 'common-loc-tab', 'id' => 'common-loc-tab',
'accesskey' => 'd' 'accesskey' => 'd'
]; ];
} }
$tabs[] = ['label' => t('Advanced'), $tabs[] = ['label' => L10n::t('Advanced'),
'url' => 'crepair/' . $contact_id, 'url' => 'crepair/' . $contact_id,
'sel' => (($active_tab == 5) ? 'active' : ''), 'sel' => (($active_tab == 5) ? 'active' : ''),
'title' => t('Advanced Contact Settings'), 'title' => L10n::t('Advanced Contact Settings'),
'id' => 'advanced-tab', 'id' => 'advanced-tab',
'accesskey' => 'r' 'accesskey' => 'r'
]; ];
@ -917,15 +918,15 @@ function _contact_detail_for_template($rr)
switch ($rr['rel']) { switch ($rr['rel']) {
case CONTACT_IS_FRIEND: case CONTACT_IS_FRIEND:
$dir_icon = 'images/lrarrow.gif'; $dir_icon = 'images/lrarrow.gif';
$alt_text = t('Mutual Friendship'); $alt_text = L10n::t('Mutual Friendship');
break; break;
case CONTACT_IS_FOLLOWER; case CONTACT_IS_FOLLOWER;
$dir_icon = 'images/larrow.gif'; $dir_icon = 'images/larrow.gif';
$alt_text = t('is a fan of yours'); $alt_text = L10n::t('is a fan of yours');
break; break;
case CONTACT_IS_SHARING; case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif'; $dir_icon = 'images/rarrow.gif';
$alt_text = t('you are a fan of'); $alt_text = L10n::t('you are a fan of');
break; break;
default: default:
break; break;
@ -939,8 +940,8 @@ function _contact_detail_for_template($rr)
} }
return [ return [
'img_hover' => t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']), 'img_hover' => L10n::t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
'edit_hover' => t('Edit contact'), 'edit_hover' => L10n::t('Edit contact'),
'photo_menu' => Contact::photoMenu($rr), 'photo_menu' => Contact::photoMenu($rr),
'id' => $rr['id'], 'id' => $rr['id'],
'alt_text' => $alt_text, 'alt_text' => $alt_text,
@ -972,7 +973,7 @@ function contact_actions($contact)
// Provide friend suggestion only for Friendica contacts // Provide friend suggestion only for Friendica contacts
if ($contact['network'] === NETWORK_DFRN) { if ($contact['network'] === NETWORK_DFRN) {
$contact_actions['suggest'] = [ $contact_actions['suggest'] = [
'label' => t('Suggest friends'), 'label' => L10n::t('Suggest friends'),
'url' => 'fsuggest/' . $contact['id'], 'url' => 'fsuggest/' . $contact['id'],
'title' => '', 'title' => '',
'sel' => '', 'sel' => '',
@ -982,7 +983,7 @@ function contact_actions($contact)
if ($poll_enabled) { if ($poll_enabled) {
$contact_actions['update'] = [ $contact_actions['update'] = [
'label' => t('Update now'), 'label' => L10n::t('Update now'),
'url' => 'contacts/' . $contact['id'] . '/update', 'url' => 'contacts/' . $contact['id'] . '/update',
'title' => '', 'title' => '',
'sel' => '', 'sel' => '',
@ -991,33 +992,33 @@ function contact_actions($contact)
} }
$contact_actions['block'] = [ $contact_actions['block'] = [
'label' => (intval($contact['blocked']) ? t('Unblock') : t('Block') ), 'label' => (intval($contact['blocked']) ? L10n::t('Unblock') : L10n::t('Block') ),
'url' => 'contacts/' . $contact['id'] . '/block', 'url' => 'contacts/' . $contact['id'] . '/block',
'title' => t('Toggle Blocked status'), 'title' => L10n::t('Toggle Blocked status'),
'sel' => (intval($contact['blocked']) ? 'active' : ''), 'sel' => (intval($contact['blocked']) ? 'active' : ''),
'id' => 'toggle-block', 'id' => 'toggle-block',
]; ];
$contact_actions['ignore'] = [ $contact_actions['ignore'] = [
'label' => (intval($contact['readonly']) ? t('Unignore') : t('Ignore') ), 'label' => (intval($contact['readonly']) ? L10n::t('Unignore') : L10n::t('Ignore') ),
'url' => 'contacts/' . $contact['id'] . '/ignore', 'url' => 'contacts/' . $contact['id'] . '/ignore',
'title' => t('Toggle Ignored status'), 'title' => L10n::t('Toggle Ignored status'),
'sel' => (intval($contact['readonly']) ? 'active' : ''), 'sel' => (intval($contact['readonly']) ? 'active' : ''),
'id' => 'toggle-ignore', 'id' => 'toggle-ignore',
]; ];
$contact_actions['archive'] = [ $contact_actions['archive'] = [
'label' => (intval($contact['archive']) ? t('Unarchive') : t('Archive') ), 'label' => (intval($contact['archive']) ? L10n::t('Unarchive') : L10n::t('Archive') ),
'url' => 'contacts/' . $contact['id'] . '/archive', 'url' => 'contacts/' . $contact['id'] . '/archive',
'title' => t('Toggle Archive status'), 'title' => L10n::t('Toggle Archive status'),
'sel' => (intval($contact['archive']) ? 'active' : ''), 'sel' => (intval($contact['archive']) ? 'active' : ''),
'id' => 'toggle-archive', 'id' => 'toggle-archive',
]; ];
$contact_actions['delete'] = [ $contact_actions['delete'] = [
'label' => t('Delete'), 'label' => L10n::t('Delete'),
'url' => 'contacts/' . $contact['id'] . '/drop', 'url' => 'contacts/' . $contact['id'] . '/drop',
'title' => t('Delete contact'), 'title' => L10n::t('Delete contact'),
'sel' => '', 'sel' => '',
'id' => 'delete', 'id' => 'delete',
]; ];

View file

@ -1,11 +1,12 @@
<?php <?php
/** /**
* @file mod/credits.php
* Show a credits page for all the developers who helped with the project * Show a credits page for all the developers who helped with the project
* (only contributors to the git repositories for friendica core and the * (only contributors to the git repositories for friendica core and the
* addons repository will be listed though ATM) * addons repository will be listed though ATM)
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
function credits_content() function credits_content()
{ {
@ -14,8 +15,8 @@ function credits_content()
$names = explode("\n", htmlspecialchars($credits_string)); $names = explode("\n", htmlspecialchars($credits_string));
$tpl = get_markup_template('credits.tpl'); $tpl = get_markup_template('credits.tpl');
return replace_macros($tpl, [ return replace_macros($tpl, [
'$title' => t('Credits'), '$title' => L10n::t('Credits'),
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'), '$thanks' => L10n::t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
'$names' => $names, '$names' => $names,
]); ]);
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -83,9 +84,9 @@ function crepair_post(App $a)
} }
if ($r) { if ($r) {
info(t('Contact settings applied.') . EOL); info(L10n::t('Contact settings applied.') . EOL);
} else { } else {
notice(t('Contact update failed.') . EOL); notice(L10n::t('Contact update failed.') . EOL);
} }
return; return;
@ -94,7 +95,7 @@ function crepair_post(App $a)
function crepair_content(App $a) function crepair_content(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -106,12 +107,12 @@ function crepair_content(App $a)
} }
if (!DBM::is_result($contact)) { if (!DBM::is_result($contact)) {
notice(t('Contact not found.') . EOL); notice(L10n::t('Contact not found.') . EOL);
return; return;
} }
$warning = t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.'); $warning = L10n::t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
$info = t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.'); $info = L10n::t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
$returnaddr = "contacts/$cid"; $returnaddr = "contacts/$cid";
@ -125,9 +126,9 @@ function crepair_content(App $a)
} }
if ($contact['network'] == NETWORK_FEED) { if ($contact['network'] == NETWORK_FEED) {
$remote_self_options = ['0' => t('No mirroring'), '1' => t('Mirror as forwarded posting'), '2' => t('Mirror as my own posting')]; $remote_self_options = ['0' => L10n::t('No mirroring'), '1' => L10n::t('Mirror as forwarded posting'), '2' => L10n::t('Mirror as my own posting')];
} else { } else {
$remote_self_options = ['0' => t('No mirroring'), '2' => t('Mirror as my own posting')]; $remote_self_options = ['0' => L10n::t('No mirroring'), '2' => L10n::t('Mirror as my own posting')];
} }
$update_profile = in_array($contact['network'], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]); $update_profile = in_array($contact['network'], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]);
@ -140,29 +141,29 @@ function crepair_content(App $a)
'$warning' => $warning, '$warning' => $warning,
'$info' => $info, '$info' => $info,
'$returnaddr' => $returnaddr, '$returnaddr' => $returnaddr,
'$return' => t('Return to contact editor'), '$return' => L10n::t('Return to contact editor'),
'$update_profile' => $update_profile, '$update_profile' => $update_profile,
'$udprofilenow' => t('Refetch contact data'), '$udprofilenow' => L10n::t('Refetch contact data'),
'$contact_id' => $contact['id'], '$contact_id' => $contact['id'],
'$lbl_submit' => t('Submit'), '$lbl_submit' => L10n::t('Submit'),
'$label_remote_self' => t('Remote Self'), '$label_remote_self' => L10n::t('Remote Self'),
'$allow_remote_self' => $allow_remote_self, '$allow_remote_self' => $allow_remote_self,
'$remote_self' => ['remote_self', '$remote_self' => ['remote_self',
t('Mirror postings from this contact'), L10n::t('Mirror postings from this contact'),
$contact['remote_self'], $contact['remote_self'],
t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'), L10n::t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
$remote_self_options $remote_self_options
], ],
'$name' => ['name', t('Name') , htmlentities($contact['name'])], '$name' => ['name', L10n::t('Name') , htmlentities($contact['name'])],
'$nick' => ['nick', t('Account Nickname'), htmlentities($contact['nick'])], '$nick' => ['nick', L10n::t('Account Nickname'), htmlentities($contact['nick'])],
'$attag' => ['attag', t('@Tagname - overrides Name/Nickname'), $contact['attag']], '$attag' => ['attag', L10n::t('@Tagname - overrides Name/Nickname'), $contact['attag']],
'$url' => ['url', t('Account URL'), $contact['url']], '$url' => ['url', L10n::t('Account URL'), $contact['url']],
'$request' => ['request', t('Friend Request URL'), $contact['request']], '$request' => ['request', L10n::t('Friend Request URL'), $contact['request']],
'confirm' => ['confirm', t('Friend Confirm URL'), $contact['confirm']], 'confirm' => ['confirm', L10n::t('Friend Confirm URL'), $contact['confirm']],
'notify' => ['notify', t('Notification Endpoint URL'), $contact['notify']], 'notify' => ['notify', L10n::t('Notification Endpoint URL'), $contact['notify']],
'poll' => ['poll', t('Poll/Feed URL'), $contact['poll']], 'poll' => ['poll', L10n::t('Poll/Feed URL'), $contact['poll']],
'photo' => ['photo', t('New photo from this URL'), ''], 'photo' => ['photo', L10n::t('New photo from this URL'), ''],
]); ]);
return $o; return $o;

View file

@ -1,6 +1,9 @@
<?php <?php
/**
* @file mod/delegate.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -14,7 +17,7 @@ function delegate_init(App $a)
function delegate_content(App $a) function delegate_content(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -90,7 +93,7 @@ function delegate_content(App $a)
dbesc(NETWORK_DFRN) dbesc(NETWORK_DFRN)
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice(t('No potential page delegates located.') . EOL); notice(L10n::t('No potential page delegates located.') . EOL);
return; return;
} }
@ -116,18 +119,18 @@ function delegate_content(App $a)
settings_init($a); settings_init($a);
$o = replace_macros(get_markup_template('delegate.tpl'), [ $o = replace_macros(get_markup_template('delegate.tpl'), [
'$header' => t('Delegate Page Management'), '$header' => L10n::t('Delegate Page Management'),
'$base' => System::baseUrl(), '$base' => System::baseUrl(),
'$desc' => t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'), '$desc' => L10n::t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'),
'$head_managers' => t('Existing Page Managers'), '$head_managers' => L10n::t('Existing Page Managers'),
'$managers' => $full_managers, '$managers' => $full_managers,
'$head_delegates' => t('Existing Page Delegates'), '$head_delegates' => L10n::t('Existing Page Delegates'),
'$delegates' => $delegates, '$delegates' => $delegates,
'$head_potentials' => t('Potential Delegates'), '$head_potentials' => L10n::t('Potential Delegates'),
'$potentials' => $potentials, '$potentials' => $potentials,
'$remove' => t('Remove'), '$remove' => L10n::t('Remove'),
'$add' => t('Add'), '$add' => L10n::t('Add'),
'$none' => t('No entries.') '$none' => L10n::t('No entries.')
]); ]);

View file

@ -1,5 +1,4 @@
<?php <?php
/** /**
* @file mod/dfrn_confirm.php * @file mod/dfrn_confirm.php
* @brief Module: dfrn_confirm * @brief Module: dfrn_confirm
@ -20,6 +19,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -61,13 +61,13 @@ function dfrn_confirm_post(App $a, $handsfree = null)
if (!x($_POST, 'source_url')) { if (!x($_POST, 'source_url')) {
$uid = defaults($handsfree, 'uid', local_user()); $uid = defaults($handsfree, 'uid', local_user());
if (!$uid) { if (!$uid) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
$user = dba::selectFirst('user', [], ['uid' => $uid]); $user = dba::selectFirst('user', [], ['uid' => $uid]);
if (!DBM::is_result($user)) { if (!DBM::is_result($user)) {
notice(t('Profile not found.') . EOL); notice(L10n::t('Profile not found.') . EOL);
return; return;
} }
@ -124,8 +124,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
logger('Contact not found in DB.'); logger('Contact not found in DB.');
notice(t('Contact not found.') . EOL); notice(L10n::t('Contact not found.') . EOL);
notice(t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL); notice(L10n::t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
return; return;
} }
@ -235,19 +235,19 @@ function dfrn_confirm_post(App $a, $handsfree = null)
// We shouldn't proceed, because the xml parser might choke, // We shouldn't proceed, because the xml parser might choke,
// and $status is going to be zero, which indicates success. // and $status is going to be zero, which indicates success.
// We can hardly call this a success. // We can hardly call this a success.
notice(t('Response from remote site was not understood.') . EOL); notice(L10n::t('Response from remote site was not understood.') . EOL);
return; return;
} }
if (strlen($leading_junk) && Config::get('system', 'debugging')) { if (strlen($leading_junk) && Config::get('system', 'debugging')) {
// This might be more common. Mixed error text and some XML. // This might be more common. Mixed error text and some XML.
// If we're configured for debugging, show the text. Proceed in either case. // If we're configured for debugging, show the text. Proceed in either case.
notice(t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL); notice(L10n::t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);
} }
if (stristr($res, "<status") === false) { if (stristr($res, "<status") === false) {
// wrong xml! stop here! // wrong xml! stop here!
notice(t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL); notice(L10n::t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL);
return; return;
} }
@ -268,15 +268,15 @@ function dfrn_confirm_post(App $a, $handsfree = null)
); );
case 2: case 2:
notice(t("Temporary failure. Please wait and try again.") . EOL); notice(L10n::t("Temporary failure. Please wait and try again.") . EOL);
break; break;
case 3: case 3:
notice(t("Introduction failed or was revoked.") . EOL); notice(L10n::t("Introduction failed or was revoked.") . EOL);
break; break;
} }
if (strlen($message)) { if (strlen($message)) {
notice(t('Remote site reported: ') . $message . EOL); notice(L10n::t('Remote site reported: ') . $message . EOL);
} }
if (($status == 0) && ($intro_id)) { if (($status == 0) && ($intro_id)) {
@ -389,7 +389,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
/// @TODO is DBM::is_result() working here? /// @TODO is DBM::is_result() working here?
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice(t('Unable to set contact photo.') . EOL); notice(L10n::t('Unable to set contact photo.') . EOL);
} }
// reload contact info // reload contact info
@ -424,7 +424,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$arr['verb'] = ACTIVITY_FRIEND; $arr['verb'] = ACTIVITY_FRIEND;
$arr['object-type'] = ACTIVITY_OBJ_PERSON; $arr['object-type'] = ACTIVITY_OBJ_PERSON;
$arr['body'] = t('%1$s is now friends with %2$s', $A, $B) . "\n\n\n" . $BPhoto; $arr['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B) . "\n\n\n" . $BPhoto;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>' $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>'; . '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
@ -491,7 +491,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
// Find our user's account // Find our user's account
$user = dba::selectFirst('user', [], ['nickname' => $node]); $user = dba::selectFirst('user', [], ['nickname' => $node]);
if (!DBM::is_result($user)) { if (!DBM::is_result($user)) {
$message = t('No user record found for \'%s\' ', $node); $message = L10n::t('No user record found for \'%s\' ', $node);
xml_status(3, $message); // failure xml_status(3, $message); // failure
// NOTREACHED // NOTREACHED
} }
@ -501,7 +501,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
if (!strstr($my_prvkey, 'PRIVATE KEY')) { if (!strstr($my_prvkey, 'PRIVATE KEY')) {
$message = t('Our site encryption key is apparently messed up.'); $message = L10n::t('Our site encryption key is apparently messed up.');
xml_status(3, $message); xml_status(3, $message);
} }
@ -512,7 +512,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
if (!strlen($decrypted_source_url)) { if (!strlen($decrypted_source_url)) {
$message = t('Empty site URL was provided or URL could not be decrypted by us.'); $message = L10n::t('Empty site URL was provided or URL could not be decrypted by us.');
xml_status(3, $message); xml_status(3, $message);
// NOTREACHED // NOTREACHED
} }
@ -528,7 +528,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$contact = dba::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]); $contact = dba::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]);
if (!DBM::is_result($contact)) { if (!DBM::is_result($contact)) {
// this is either a bogus confirmation (?) or we deleted the original introduction. // this is either a bogus confirmation (?) or we deleted the original introduction.
$message = t('Contact record was not found for you on our site.'); $message = L10n::t('Contact record was not found for you on our site.');
xml_status(3, $message); xml_status(3, $message);
return; // NOTREACHED return; // NOTREACHED
} }
@ -542,7 +542,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$dfrn_record = $contact['id']; $dfrn_record = $contact['id'];
if (!$foreign_pubkey) { if (!$foreign_pubkey) {
$message = t('Site public key not available in contact record for URL %s.', $decrypted_source_url); $message = L10n::t('Site public key not available in contact record for URL %s.', $decrypted_source_url);
xml_status(3, $message); xml_status(3, $message);
} }
@ -558,7 +558,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
} }
if (dba::exists('contact', ['dfrn-id' => $decrypted_dfrn_id])) { if (dba::exists('contact', ['dfrn-id' => $decrypted_dfrn_id])) {
$message = t('The ID provided by your system is a duplicate on our system. It should work if you try again.'); $message = L10n::t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
xml_status(1, $message); // Birthday paradox - duplicate dfrn-id xml_status(1, $message); // Birthday paradox - duplicate dfrn-id
// NOTREACHED // NOTREACHED
} }
@ -569,7 +569,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
intval($dfrn_record) intval($dfrn_record)
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
$message = t('Unable to set your contact credentials on our system.'); $message = L10n::t('Unable to set your contact credentials on our system.');
xml_status(3, $message); xml_status(3, $message);
} }
@ -624,7 +624,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
intval($dfrn_record) intval($dfrn_record)
); );
if (!DBM::is_result($r)) { // indicates schema is messed up or total db failure if (!DBM::is_result($r)) { // indicates schema is messed up or total db failure
$message = t('Unable to update your contact profile details on our system'); $message = L10n::t('Unable to update your contact profile details on our system');
xml_status(3, $message); xml_status(3, $message);
} }
@ -654,7 +654,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
'to_email' => $combined['email'], 'to_email' => $combined['email'],
'uid' => $combined['uid'], 'uid' => $combined['uid'],
'link' => System::baseUrl() . '/contacts/' . $dfrn_record, 'link' => System::baseUrl() . '/contacts/' . $dfrn_record,
'source_name' => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : t('[Name Withheld]')), 'source_name' => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : L10n::t('[Name Withheld]')),
'source_link' => $combined['url'], 'source_link' => $combined['url'],
'source_photo' => $combined['photo'], 'source_photo' => $combined['photo'],
'verb' => ($mutual?ACTIVITY_FRIEND:ACTIVITY_FOLLOW), 'verb' => ($mutual?ACTIVITY_FRIEND:ACTIVITY_FOLLOW),
@ -687,7 +687,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$arr['verb'] = ACTIVITY_JOIN; $arr['verb'] = ACTIVITY_JOIN;
$arr['object-type'] = ACTIVITY_OBJ_GROUP; $arr['object-type'] = ACTIVITY_OBJ_GROUP;
$arr['body'] = t('%1$s has joined %2$s', $A, $B) . "\n\n\n" . $BPhoto; $arr['body'] = L10n::t('%1$s has joined %2$s', $A, $B) . "\n\n\n" . $BPhoto;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>' $arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>'
. '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>'; . '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n"); $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n");

View file

@ -13,6 +13,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -87,7 +88,7 @@ function dfrn_request_post(App $a)
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
if (strlen($r[0]['dfrn-id'])) { if (strlen($r[0]['dfrn-id'])) {
// We don't need to be here. It has already happened. // We don't need to be here. It has already happened.
notice(t("This introduction has already been accepted.") . EOL); notice(L10n::t("This introduction has already been accepted.") . EOL);
return; return;
} else { } else {
$contact_record = $r[0]; $contact_record = $r[0];
@ -105,14 +106,14 @@ function dfrn_request_post(App $a)
$parms = Probe::profile($dfrn_url); $parms = Probe::profile($dfrn_url);
if (!count($parms)) { if (!count($parms)) {
notice(t('Profile location is not valid or does not contain profile information.') . EOL); notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
return; return;
} else { } else {
if (!x($parms, 'fn')) { if (!x($parms, 'fn')) {
notice(t('Warning: profile location has no identifiable owner name.') . EOL); notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
} }
if (!x($parms, 'photo')) { if (!x($parms, 'photo')) {
notice(t('Warning: profile location has no profile photo.') . EOL); notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
} }
$invalid = Probe::validDfrn($parms); $invalid = Probe::validDfrn($parms);
if ($invalid) { if ($invalid) {
@ -192,7 +193,7 @@ function dfrn_request_post(App $a)
} }
// invalid/bogus request // invalid/bogus request
notice(t('Unrecoverable protocol error.') . EOL); notice(L10n::t('Unrecoverable protocol error.') . EOL);
goaway(System::baseUrl()); goaway(System::baseUrl());
return; // NOTREACHED return; // NOTREACHED
} }
@ -219,7 +220,7 @@ function dfrn_request_post(App $a)
* *
*/ */
if (!(is_array($a->profile) && count($a->profile))) { if (!(is_array($a->profile) && count($a->profile))) {
notice(t('Profile unavailable.') . EOL); notice(L10n::t('Profile unavailable.') . EOL);
return; return;
} }
@ -242,8 +243,8 @@ function dfrn_request_post(App $a)
); );
if (DBM::is_result($r) && count($r) > $maxreq) { if (DBM::is_result($r) && count($r) > $maxreq) {
notice(sprintf(t('%s has received too many connection requests today.'), $a->profile['name']) . EOL); notice(sprintf(t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
notice(t('Spam protection measures have been invoked.') . EOL); notice(L10n::t('Spam protection measures have been invoked.') . EOL);
notice(t('Friends are advised to please try again in 24 hours.') . EOL); notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
return; return;
} }
} }
@ -273,7 +274,7 @@ function dfrn_request_post(App $a)
$url = trim($_POST['dfrn_url']); $url = trim($_POST['dfrn_url']);
if (!strlen($url)) { if (!strlen($url)) {
notice(t("Invalid locator") . EOL); notice(L10n::t("Invalid locator") . EOL);
return; return;
} }
@ -309,7 +310,7 @@ function dfrn_request_post(App $a)
if (DBM::is_result($ret)) { if (DBM::is_result($ret)) {
if (strlen($ret[0]['issued-id'])) { if (strlen($ret[0]['issued-id'])) {
notice(t('You have already introduced yourself here.') . EOL); notice(L10n::t('You have already introduced yourself here.') . EOL);
return; return;
} elseif ($ret[0]['rel'] == CONTACT_IS_FRIEND) { } elseif ($ret[0]['rel'] == CONTACT_IS_FRIEND) {
notice(sprintf(t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL); notice(sprintf(t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL);
@ -332,19 +333,19 @@ function dfrn_request_post(App $a)
} else { } else {
$url = validate_url($url); $url = validate_url($url);
if (!$url) { if (!$url) {
notice(t('Invalid profile URL.') . EOL); notice(L10n::t('Invalid profile URL.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd); goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED return; // NOTREACHED
} }
if (!allowed_url($url)) { if (!allowed_url($url)) {
notice(t('Disallowed profile URL.') . EOL); notice(L10n::t('Disallowed profile URL.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd); goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED return; // NOTREACHED
} }
if (blocked_url($url)) { if (blocked_url($url)) {
notice(t('Blocked domain') . EOL); notice(L10n::t('Blocked domain') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd); goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED return; // NOTREACHED
} }
@ -352,14 +353,14 @@ function dfrn_request_post(App $a)
$parms = Probe::profile(($hcard) ? $hcard : $url); $parms = Probe::profile(($hcard) ? $hcard : $url);
if (!count($parms)) { if (!count($parms)) {
notice(t('Profile location is not valid or does not contain profile information.') . EOL); notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd); goaway(System::baseUrl() . '/' . $a->cmd);
} else { } else {
if (!x($parms, 'fn')) { if (!x($parms, 'fn')) {
notice(t('Warning: profile location has no identifiable owner name.') . EOL); notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
} }
if (!x($parms, 'photo')) { if (!x($parms, 'photo')) {
notice(t('Warning: profile location has no profile photo.') . EOL); notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
} }
$invalid = Probe::validDfrn($parms); $invalid = Probe::validDfrn($parms);
if ($invalid) { if ($invalid) {
@ -412,7 +413,7 @@ function dfrn_request_post(App $a)
} }
} }
if ($r === false) { if ($r === false) {
notice(t('Failed to update contact record.') . EOL); notice(L10n::t('Failed to update contact record.') . EOL);
return; return;
} }
@ -470,7 +471,7 @@ function dfrn_request_post(App $a)
// NOTREACHED // NOTREACHED
// END $network != NETWORK_PHANTOM // END $network != NETWORK_PHANTOM
} else { } else {
notice(t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL); notice(L10n::t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL);
return; return;
} }
} return; } return;
@ -494,7 +495,7 @@ function dfrn_request_content(App $a)
// Edge case, but can easily happen in the wild. This person is authenticated, // Edge case, but can easily happen in the wild. This person is authenticated,
// but not as the person who needs to deal with this request. // but not as the person who needs to deal with this request.
if ($a->user['nickname'] != $a->argv[1]) { if ($a->user['nickname'] != $a->argv[1]) {
notice(t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL); notice(L10n::t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
return Login::form(); return Login::form();
} }
@ -508,7 +509,7 @@ function dfrn_request_content(App $a)
$_POST["confirm_key"] = $confirm_key; $_POST["confirm_key"] = $confirm_key;
$_POST["localconfirm"] = 1; $_POST["localconfirm"] = 1;
$_POST["hidden-contact"] = 0; $_POST["hidden-contact"] = 0;
$_POST["submit"] = t('Confirm'); $_POST["submit"] = L10n::t('Confirm');
dfrn_request_post($a); dfrn_request_post($a);
@ -520,12 +521,12 @@ function dfrn_request_content(App $a)
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$dfrn_url' => $dfrn_url, '$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ), '$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
'$hidethem' => t('Hide this contact'), '$hidethem' => L10n::t('Hide this contact'),
'$hidechecked' => '', '$hidechecked' => '',
'$confirm_key' => $confirm_key, '$confirm_key' => $confirm_key,
'$welcome' => sprintf(t('Welcome home %s.'), $a->user['username']), '$welcome' => sprintf(t('Welcome home %s.'), $a->user['username']),
'$please' => sprintf(t('Please confirm your introduction/connection request to %s.'), $dfrn_url), '$please' => sprintf(t('Please confirm your introduction/connection request to %s.'), $dfrn_url),
'$submit' => t('Confirm'), '$submit' => L10n::t('Confirm'),
'$uid' => $_SESSION['uid'], '$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'], '$nickname' => $a->user['nickname'],
'dfrn_rawurl' => $_GET['dfrn_url'] 'dfrn_rawurl' => $_GET['dfrn_url']
@ -561,7 +562,7 @@ function dfrn_request_content(App $a)
'to_email' => $r[0]['email'], 'to_email' => $r[0]['email'],
'uid' => $r[0]['uid'], 'uid' => $r[0]['uid'],
'link' => System::baseUrl() . '/notifications/intros', 'link' => System::baseUrl() . '/notifications/intros',
'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : L10n::t('[Name Withheld]')),
'source_link' => $r[0]['url'], 'source_link' => $r[0]['url'],
'source_photo' => $r[0]['photo'], 'source_photo' => $r[0]['photo'],
'verb' => ACTIVITY_REQ_FRIEND, 'verb' => ACTIVITY_REQ_FRIEND,
@ -600,7 +601,7 @@ function dfrn_request_content(App $a)
// Normal web request. Display our user's introduction form. // Normal web request. Display our user's introduction form.
if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) { if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
if (!Config::get('system', 'local_block')) { if (!Config::get('system', 'local_block')) {
notice(t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
} }
@ -635,7 +636,7 @@ function dfrn_request_content(App $a)
$tpl = get_markup_template('auto_request.tpl'); $tpl = get_markup_template('auto_request.tpl');
} }
$page_desc = t("Please enter your 'Identity Address' from one of the following supported communications networks:"); $page_desc = L10n::t("Please enter your 'Identity Address' from one of the following supported communications networks:");
$invite_desc = sprintf( $invite_desc = sprintf(
t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.'), t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.'),
@ -643,20 +644,20 @@ function dfrn_request_content(App $a)
); );
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$header' => t('Friend/Connection Request'), '$header' => L10n::t('Friend/Connection Request'),
'$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'), '$desc' => L10n::t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
'$pls_answer' => t('Please answer the following:'), '$pls_answer' => L10n::t('Please answer the following:'),
'$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'), $a->profile['name']), false, '', [t('No'), t('Yes')]], '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'), $a->profile['name']), false, '', [t('No'), L10n::t('Yes')]],
'$add_note' => t('Add a personal note:'), '$add_note' => L10n::t('Add a personal note:'),
'$page_desc' => $page_desc, '$page_desc' => $page_desc,
'$friendica' => t('Friendica'), '$friendica' => L10n::t('Friendica'),
'$statusnet' => t('GNU Social (Pleroma, Mastodon)'), '$statusnet' => L10n::t('GNU Social (Pleroma, Mastodon)'),
'$diaspora' => t('Diaspora (Socialhome, Hubzilla)'), '$diaspora' => L10n::t('Diaspora (Socialhome, Hubzilla)'),
'$diasnote' => sprintf(t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.'), $target_addr), '$diasnote' => sprintf(t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.'), $target_addr),
'$your_address' => t('Your Identity Address:'), '$your_address' => L10n::t('Your Identity Address:'),
'$invite_desc' => $invite_desc, '$invite_desc' => $invite_desc,
'$submit' => t('Submit Request'), '$submit' => L10n::t('Submit Request'),
'$cancel' => t('Cancel'), '$cancel' => L10n::t('Cancel'),
'$nickname' => $a->argv[1], '$nickname' => $a->argv[1],
'$name' => $a->profile['name'], '$name' => $a->profile['name'],
'$myaddr' => $myaddr '$myaddr' => $myaddr

View file

@ -7,6 +7,7 @@ use Friendica\Content\Nav;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -34,7 +35,7 @@ function directory_content(App $a) {
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user()) || if((Config::get('system','block_public')) && (! local_user()) && (! remote_user()) ||
(Config::get('system','block_local_dir')) && (! local_user()) && (! remote_user())) { (Config::get('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -124,10 +125,10 @@ function directory_content(App $a) {
} }
// if(strlen($rr['dob'])) { // if(strlen($rr['dob'])) {
// if(($years = age($rr['dob'],$rr['timezone'],'')) != 0) // if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
// $details .= '<br />' . t('Age: ') . $years ; // $details .= '<br />' . L10n::t('Age: ') . $years ;
// } // }
// if(strlen($rr['gender'])) // if(strlen($rr['gender']))
// $details .= '<br />' . t('Gender: ') . $rr['gender']; // $details .= '<br />' . L10n::t('Gender: ') . $rr['gender'];
$profile = $rr; $profile = $rr;
@ -136,15 +137,15 @@ function directory_content(App $a) {
|| (x($profile,'region') == 1) || (x($profile,'region') == 1)
|| (x($profile,'postal-code') == 1) || (x($profile,'postal-code') == 1)
|| (x($profile,'country-name') == 1)) || (x($profile,'country-name') == 1))
$location = t('Location:'); $location = L10n::t('Location:');
$gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); $gender = ((x($profile,'gender') == 1) ? L10n::t('Gender:') : False);
$marital = ((x($profile,'marital') == 1) ? t('Status:') : False); $marital = ((x($profile,'marital') == 1) ? L10n::t('Status:') : False);
$homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); $homepage = ((x($profile,'homepage') == 1) ? L10n::t('Homepage:') : False);
$about = ((x($profile,'about') == 1) ? t('About:') : False); $about = ((x($profile,'about') == 1) ? L10n::t('About:') : False);
$location_e = $location; $location_e = $location;
@ -180,31 +181,30 @@ function directory_content(App $a) {
unset($profile); unset($profile);
unset($location); unset($location);
if(! $arr['entry']) if (!$arr['entry']) {
continue; continue;
}
$entries[] = $arr['entry']; $entries[] = $arr['entry'];
} }
$tpl = get_markup_template('directory_header.tpl'); $tpl = get_markup_template('directory_header.tpl');
$o .= replace_macros($tpl, [ $o .= replace_macros($tpl, [
'$search' => $search, '$search' => $search,
'$globaldir' => t('Global Directory'), '$globaldir' => L10n::t('Global Directory'),
'$gdirpath' => $gdirpath, '$gdirpath' => $gdirpath,
'$desc' => t('Find on this site'), '$desc' => L10n::t('Find on this site'),
'$contacts' => $entries, '$contacts' => $entries,
'$finding' => t('Results for:'), '$finding' => L10n::t('Results for:'),
'$findterm' => (strlen($search) ? $search : ""), '$findterm' => (strlen($search) ? $search : ""),
'$title' => t('Site Directory'), '$title' => L10n::t('Site Directory'),
'$submit' => t('Find'), '$submit' => L10n::t('Find'),
'$paginate' => paginate($a), '$paginate' => paginate($a),
]); ]);
} else {
info(L10n::t("No entries \x28some entries may be hidden\x29.") . EOL);
} }
else
info( t("No entries \x28some entries may be hidden\x29.") . EOL);
return $o; return $o;
} }

View file

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -19,7 +20,7 @@ require_once 'mod/contacts.php';
function dirfind_init(App $a) { function dirfind_init(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
return; return;
} }
@ -43,7 +44,7 @@ function dirfind_content(App $a, $prefix = "") {
if (strpos($search,'@') === 0) { if (strpos($search,'@') === 0) {
$search = substr($search,1); $search = substr($search,1);
$header = sprintf( t('People Search - %s'), $search); $header = sprintf(L10n::t('People Search - %s'), $search);
if ((valid_email($search) && validate_email($search)) || if ((valid_email($search) && validate_email($search)) ||
(substr(normalise_link($search), 0, 7) == "http://")) { (substr(normalise_link($search), 0, 7) == "http://")) {
$user_data = Probe::uri($search); $user_data = Probe::uri($search);
@ -54,7 +55,7 @@ function dirfind_content(App $a, $prefix = "") {
if (strpos($search,'!') === 0) { if (strpos($search,'!') === 0) {
$search = substr($search,1); $search = substr($search,1);
$community = true; $community = true;
$header = sprintf( t('Forum Search - %s'), $search); $header = sprintf(L10n::t('Forum Search - %s'), $search);
} }
$o = ''; $o = '';
@ -213,7 +214,7 @@ function dirfind_content(App $a, $prefix = "") {
} }
} else { } else {
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); $connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = t('Connect'); $conntxt = L10n::t('Connect');
$photo_menu = [ $photo_menu = [
'profile' => [t("View Profile"), Profile::zrl($jj->url)], 'profile' => [t("View Profile"), Profile::zrl($jj->url)],
'follow' => [t("Connect/Follow"), $connlnk] 'follow' => [t("Connect/Follow"), $connlnk]
@ -251,7 +252,7 @@ function dirfind_content(App $a, $prefix = "") {
]); ]);
} else { } else {
info( t('No matches') . EOL); info(L10n::t('No matches') . EOL);
} }
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -63,7 +64,7 @@ function display_init(App $a)
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
$a->error = 404; $a->error = 404;
notice(t('Item not found.') . EOL); notice(L10n::t('Item not found.') . EOL);
return; return;
} }
} elseif (($a->argc == 3) && ($nick == 'feed-item')) { } elseif (($a->argc == 3) && ($nick == 'feed-item')) {
@ -194,7 +195,7 @@ function display_fetchauthor($a, $item) {
function display_content(App $a, $update = false, $update_uid = 0) { function display_content(App $a, $update = false, $update_uid = 0) {
if (Config::get('system','block_public') && !local_user() && !remote_user()) { if (Config::get('system','block_public') && !local_user() && !remote_user()) {
notice(t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -240,7 +241,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
if (!$item_id) { if (!$item_id) {
$a->error = 404; $a->error = 404;
notice(t('Item not found.').EOL); notice(L10n::t('Item not found.').EOL);
return; return;
} }
@ -301,7 +302,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
$is_owner = (local_user() && (in_array($a->profile['profile_uid'], [local_user(), 0])) ? true : false); $is_owner = (local_user() && (in_array($a->profile['profile_uid'], [local_user(), 0])) ? true : false);
if (x($a->profile, 'hidewall') && !$is_owner && !$remote_contact) { if (x($a->profile, 'hidewall') && !$is_owner && !$remote_contact) {
notice(t('Access to this profile has been restricted.') . EOL); notice(L10n::t('Access to this profile has been restricted.') . EOL);
return; return;
} }
@ -342,7 +343,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice(t('Item not found.') . EOL); notice(L10n::t('Item not found.') . EOL);
return $o; return $o;
} }

View file

@ -6,24 +6,25 @@ use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once('include/acl_selectors.php'); require_once 'include/acl_selectors.php';
function editpost_content(App $a) { function editpost_content(App $a) {
$o = ''; $o = '';
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if (! $post_id) { if (! $post_id) {
notice( t('Item not found') . EOL); notice(L10n::t('Item not found') . EOL);
return; return;
} }
@ -33,7 +34,7 @@ function editpost_content(App $a) {
); );
if (! DBM::is_result($itm)) { if (! DBM::is_result($itm)) {
notice( t('Item not found') . EOL); notice(L10n::t('Item not found') . EOL);
return; return;
} }

View file

@ -6,6 +6,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -99,7 +100,7 @@ function events_post(App $a) {
$onerror_url = System::baseUrl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish"; $onerror_url = System::baseUrl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish";
if (strcmp($finish, $start) < 0 && !$nofinish) { if (strcmp($finish, $start) < 0 && !$nofinish) {
notice(t('Event can not end before it has started.') . EOL); notice(L10n::t('Event can not end before it has started.') . EOL);
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
echo t('Event can not end before it has started.'); echo t('Event can not end before it has started.');
killme(); killme();
@ -108,7 +109,7 @@ function events_post(App $a) {
} }
if ((! $summary) || ($start === NULL_DATE)) { if ((! $summary) || ($start === NULL_DATE)) {
notice(t('Event title and start time are required.') . EOL); notice(L10n::t('Event title and start time are required.') . EOL);
if (intval($_REQUEST['preview'])) { if (intval($_REQUEST['preview'])) {
echo t('Event title and start time are required.'); echo t('Event title and start time are required.');
killme(); killme();
@ -191,7 +192,7 @@ function events_post(App $a) {
function events_content(App $a) { function events_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -552,7 +553,7 @@ function events_content(App $a) {
} }
if ($del == 0) { if ($del == 0) {
notice(t('Failed to remove event' ) . EOL); notice(L10n::t('Failed to remove event') . EOL);
} else { } else {
info(t('Event removed') . EOL); info(t('Event removed') . EOL);
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -12,7 +13,7 @@ use Friendica\Network\Probe;
function follow_post(App $a) { function follow_post(App $a) {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }
@ -42,7 +43,7 @@ function follow_post(App $a) {
info(t('Contact added').EOL); info(t('Contact added').EOL);
if (strstr($return_url,'contacts')) { if (strstr($return_url, 'contacts')) {
goaway(System::baseUrl().'/contacts/'.$contact_id); goaway(System::baseUrl().'/contacts/'.$contact_id);
} }
@ -53,7 +54,7 @@ function follow_post(App $a) {
function follow_content(App $a) { function follow_content(App $a) {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }
@ -72,7 +73,7 @@ function follow_content(App $a) {
dbesc(normalise_link($url)), dbesc($url), dbesc(NETWORK_STATUSNET)); dbesc(normalise_link($url)), dbesc($url), dbesc(NETWORK_STATUSNET));
if ($r) { if ($r) {
notice(t('You already added this contact.').EOL); notice(L10n::t('You already added this contact.').EOL);
$submit = ""; $submit = "";
//goaway($_SESSION['return_url']); //goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
@ -80,22 +81,22 @@ function follow_content(App $a) {
$ret = Probe::uri($url); $ret = Probe::uri($url);
if (($ret["network"] == NETWORK_DIASPORA) && !Config::get('system','diaspora_enabled')) { if (($ret["network"] == NETWORK_DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
notice(t("Diaspora support isn't enabled. Contact can't be added.") . EOL); notice(L10n::t("Diaspora support isn't enabled. Contact can't be added.") . EOL);
$submit = ""; $submit = "";
//goaway($_SESSION['return_url']); //goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }
if (($ret["network"] == NETWORK_OSTATUS) && Config::get('system','ostatus_disabled')) { if (($ret["network"] == NETWORK_OSTATUS) && Config::get('system', 'ostatus_disabled')) {
notice(t("OStatus support is disabled. Contact can't be added.") . EOL); notice(L10n::t("OStatus support is disabled. Contact can't be added.") . EOL);
$submit = ""; $submit = "";
//goaway($_SESSION['return_url']); //goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }
if ($ret["network"] == NETWORK_PHANTOM) { if ($ret["network"] == NETWORK_PHANTOM) {
notice(t("The network type couldn't be detected. Contact can't be added.") . EOL); notice(L10n::t("The network type couldn't be detected. Contact can't be added.") . EOL);
$submit = ""; $submit = "";
//goaway($_SESSION['return_url']); //goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
@ -116,7 +117,7 @@ function follow_content(App $a) {
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid)); $r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid));
if (!$r) { if (!$r) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }

View file

@ -3,6 +3,7 @@
* @file mod/fsuggest.php * @file mod/fsuggest.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -23,7 +24,7 @@ function fsuggest_post(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice( t('Contact not found.') . EOL); notice(L10n::t('Contact not found.') . EOL);
return; return;
} }
$contact = $r[0]; $contact = $r[0];
@ -66,7 +67,7 @@ function fsuggest_post(App $a) {
Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', $fsuggest_id); Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', $fsuggest_id);
} }
info( t('Friend suggestion sent.') . EOL); info(L10n::t('Friend suggestion sent.') . EOL);
} }
} }
@ -81,7 +82,7 @@ function fsuggest_content(App $a)
require_once 'include/acl_selectors.php'; require_once 'include/acl_selectors.php';
if (! local_user()) { if (! local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -97,7 +98,7 @@ function fsuggest_content(App $a)
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice(t('Contact not found.') . EOL); notice(L10n::t('Contact not found.') . EOL);
return; return;
} }
$contact = $r[0]; $contact = $r[0];

View file

@ -7,6 +7,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -22,7 +23,7 @@ function group_init(App $a) {
function group_post(App $a) { function group_post(App $a) {
if (! local_user()) { if (! local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -38,7 +39,7 @@ function group_post(App $a) {
goaway(System::baseUrl() . '/group/' . $r); goaway(System::baseUrl() . '/group/' . $r);
} }
} else { } else {
notice(t('Could not create group.') . EOL); notice(L10n::t('Could not create group.') . EOL);
} }
goaway(System::baseUrl() . '/group'); goaway(System::baseUrl() . '/group');
return; // NOTREACHED return; // NOTREACHED
@ -52,7 +53,7 @@ function group_post(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice(t('Group not found.') . EOL); notice(L10n::t('Group not found.') . EOL);
goaway(System::baseUrl() . '/contacts'); goaway(System::baseUrl() . '/contacts');
return; // NOTREACHED return; // NOTREACHED
} }
@ -79,7 +80,7 @@ function group_content(App $a) {
$change = false; $change = false;
if (! local_user()) { if (! local_user()) {
notice(t('Permission denied') . EOL); notice(L10n::t('Permission denied') . EOL);
return; return;
} }
@ -125,7 +126,7 @@ function group_content(App $a) {
if ($result) { if ($result) {
info(t('Group removed.') . EOL); info(t('Group removed.') . EOL);
} else { } else {
notice(t('Unable to remove group.') . EOL); notice(L10n::t('Unable to remove group.') . EOL);
} }
} }
goaway(System::baseUrl() . '/group'); goaway(System::baseUrl() . '/group');
@ -154,7 +155,7 @@ function group_content(App $a) {
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice(t('Group not found.') . EOL); notice(L10n::t('Group not found.') . EOL);
goaway(System::baseUrl() . '/contacts'); goaway(System::baseUrl() . '/contacts');
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -14,7 +15,7 @@ function hcard_init(App $a)
if ($a->argc > 1) { if ($a->argc > 1) {
$which = $a->argv[1]; $which = $a->argv[1];
} else { } else {
notice(t('No profile') . EOL); notice(L10n::t('No profile') . EOL);
$a->error = 404; $a->error = 404;
return; return;
} }

View file

@ -7,6 +7,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Protocol\Email; use Friendica\Protocol\Email;
@ -14,7 +15,7 @@ use Friendica\Protocol\Email;
function invite_post(App $a) { function invite_post(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -27,7 +28,7 @@ function invite_post(App $a) {
$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) { if ($current_invites > $max_invites) {
notice( t('Total invitation limit exceeded.') . EOL); notice(L10n::t('Total invitation limit exceeded.') . EOL);
return; return;
} }
@ -86,7 +87,7 @@ function invite_post(App $a) {
$current_invites ++; $current_invites ++;
PConfig::set(local_user(),'system','sent_invites',$current_invites); PConfig::set(local_user(),'system','sent_invites',$current_invites);
if($current_invites > $max_invites) { if($current_invites > $max_invites) {
notice( t('Invitation limit exceeded. Please contact your site administrator.') . EOL); notice(L10n::t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
return; return;
} }
} else { } else {
@ -102,7 +103,7 @@ function invite_post(App $a) {
function invite_content(App $a) { function invite_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -113,7 +114,7 @@ function invite_content(App $a) {
$invonly = true; $invonly = true;
$x = PConfig::get(local_user(),'system','invites_remaining'); $x = PConfig::get(local_user(),'system','invites_remaining');
if ((! $x) && (! is_site_admin())) { if ((! $x) && (! is_site_admin())) {
notice( t('You have no more invitations available') . EOL); notice(L10n::t('You have no more invitations available') . EOL);
return ''; return '';
} }
} }

View file

@ -17,6 +17,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -111,7 +112,7 @@ function item_post(App $a) {
} }
if (!DBM::is_result($parent_item)) { if (!DBM::is_result($parent_item)) {
notice(t('Unable to locate original post.') . EOL); notice(L10n::t('Unable to locate original post.') . EOL);
if (x($_REQUEST, 'return')) { if (x($_REQUEST, 'return')) {
goaway($return_path); goaway($return_path);
} }
@ -157,7 +158,7 @@ function item_post(App $a) {
// Now check that valid personal details have been provided // Now check that valid personal details have been provided
if (!can_write_wall($profile_uid) && !$allow_comment) { if (!can_write_wall($profile_uid) && !$allow_comment) {
notice(t('Permission denied.') . EOL) ; notice(L10n::t('Permission denied.') . EOL) ;
if (x($_REQUEST, 'return')) { if (x($_REQUEST, 'return')) {
goaway($return_path); goaway($return_path);
} }

View file

@ -1,10 +1,10 @@
<?php <?php
/** /**
* @file mod/lostpass.php * @file mod/lostpass.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\User; use Friendica\Model\User;
@ -25,7 +25,7 @@ function lostpass_post(App $a)
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame]; $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
$user = dba::selectFirst('user', ['uid', 'username', 'email'], $condition); $user = dba::selectFirst('user', ['uid', 'username', 'email'], $condition);
if (!DBM::is_result($user)) { if (!DBM::is_result($user)) {
notice(t('No valid account found.') . EOL); notice(L10n::t('No valid account found.') . EOL);
goaway(System::baseUrl()); goaway(System::baseUrl());
} }
@ -86,7 +86,7 @@ function lostpass_content(App $a)
$user = dba::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]); $user = dba::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]);
if (!DBM::is_result($user)) { if (!DBM::is_result($user)) {
notice(t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed.")); notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
return lostpass_form(); return lostpass_form();
} }
@ -99,7 +99,7 @@ function lostpass_content(App $a)
]; ];
dba::update('user', $fields, ['uid' => $user['uid']]); dba::update('user', $fields, ['uid' => $user['uid']]);
notice(t('Request has expired, please make a new one.')); notice(L10n::t('Request has expired, please make a new one.'));
return lostpass_form(); return lostpass_form();
} }

View file

@ -1,11 +1,14 @@
<?php <?php
/**
* @file mod/manage.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once("include/text.php"); require_once "include/text.php";
function manage_post(App $a) { function manage_post(App $a) {
@ -103,7 +106,7 @@ function manage_post(App $a) {
function manage_content(App $a) { function manage_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }

View file

@ -5,6 +5,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -43,7 +44,7 @@ function match_content(App $a)
return; return;
} }
if (! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) { if (! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
notice(t('No keywords to match. Please add keywords to your default profile.') . EOL); notice(L10n::t('No keywords to match. Please add keywords to your default profile.') . EOL);
return; return;
} }

View file

@ -5,6 +5,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Smilies; use Friendica\Content\Smilies;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -51,7 +52,7 @@ function message_init(App $a)
function message_post(App $a) function message_post(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -65,17 +66,17 @@ function message_post(App $a)
switch ($ret) { switch ($ret) {
case -1: case -1:
notice(t('No recipient selected.') . EOL); notice(L10n::t('No recipient selected.') . EOL);
$norecip = true; $norecip = true;
break; break;
case -2: case -2:
notice(t('Unable to locate contact information.') . EOL); notice(L10n::t('Unable to locate contact information.') . EOL);
break; break;
case -3: case -3:
notice(t('Message could not be sent.') . EOL); notice(L10n::t('Message could not be sent.') . EOL);
break; break;
case -4: case -4:
notice(t('Message collection failure.') . EOL); notice(L10n::t('Message collection failure.') . EOL);
break; break;
default: default:
info(t('Message sent.') . EOL); info(t('Message sent.') . EOL);
@ -96,7 +97,7 @@ function message_content(App $a)
Nav::setSelected('messages'); Nav::setSelected('messages');
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -323,7 +324,7 @@ function message_content(App $a)
); );
} }
if (!count($messages)) { if (!count($messages)) {
notice(t('Message not available.') . EOL); notice(L10n::t('Message not available.') . EOL);
return $o; return $o;
} }

View file

@ -9,6 +9,7 @@ use Friendica\Content\ForumManager;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
@ -25,7 +26,7 @@ require_once 'include/acl_selectors.php';
function network_init(App $a) function network_init(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -541,8 +542,9 @@ function networkThreadedView(App $a, $update = 0)
if ($gid) { if ($gid) {
if (($t = Contact::getOStatusCountByGroupId($gid)) && !PConfig::get(local_user(), 'system', 'nowarn_insecure')) { if (($t = Contact::getOStatusCountByGroupId($gid)) && !PConfig::get(local_user(), 'system', 'nowarn_insecure')) {
notice(tt("Warning: This group contains %s member from a network that doesn't allow non public messages.", notice(tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
"Warning: This group contains %s members from a network that doesn't allow non public messages.", $t) . EOL); "Warning: This group contains %s members from a network that doesn't allow non public messages.",
notice(t("Messages in this group won't be send to these receivers.") . EOL); $t) . EOL);
notice(L10n::t("Messages in this group won't be send to these receivers.").EOL);
} }
} }
@ -610,7 +612,7 @@ function networkThreadedView(App $a, $update = 0)
if ($update) { if ($update) {
killme(); killme();
} }
notice(t('No such group') . EOL); notice(L10n::t('No such group') . EOL);
goaway('network/0'); goaway('network/0');
// NOTREACHED // NOTREACHED
} }
@ -660,12 +662,11 @@ function networkThreadedView(App $a, $update = 0)
'id' => 'network', 'id' => 'network',
]) . $o; ]) . $o;
if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(), 'system', if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(),'system','nowarn_insecure')) {
'nowarn_insecure')) { notice(L10n::t('Private messages to this person are at risk of public disclosure.') . EOL);
notice(t('Private messages to this person are at risk of public disclosure.') . EOL);
} }
} else { } else {
notice(t('Invalid contact.') . EOL); notice(L10n::t('Invalid contact.') . EOL);
goaway('network'); goaway('network');
// NOTREACHED // NOTREACHED
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Group; use Friendica\Model\Group;
@ -24,7 +25,7 @@ function nogroup_init(App $a)
function nogroup_content(App $a) function nogroup_content(App $a)
{ {
if (! local_user()) { if (! local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return ''; return '';
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -27,7 +28,7 @@ function notes_init(App $a) {
function notes_content(App $a, $update = false) { function notes_content(App $a, $update = false) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }

View file

@ -1,13 +1,16 @@
<?php <?php
/**
/* GNU Social -> friendica items permanent-url compatibility */ * @file mod/notice.php
* GNU Social -> friendica items permanent-url compatibility
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
function notice_init(App $a) { function notice_init(App $a)
{
$id = $a->argv[1]; $id = $a->argv[1];
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id)); $r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
@ -16,7 +19,7 @@ function notice_init(App $a) {
goaway($url); goaway($url);
} else { } else {
$a->error = 404; $a->error = 404;
notice(t('Item not found.') . EOL); notice(L10n::t('Item not found.') . EOL);
} }
return; return;

View file

@ -6,6 +6,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\L10n;
use Friendica\Core\NotificationsManager; use Friendica\Core\NotificationsManager;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -35,7 +36,7 @@ function notifications_post(App $a) {
$contact_id = $r[0]['contact-id']; $contact_id = $r[0]['contact-id'];
} }
else { else {
notice( t('Invalid request identifier.') . EOL); notice(L10n::t('Invalid request identifier.') . EOL);
return; return;
} }
@ -71,7 +72,7 @@ function notifications_post(App $a) {
function notifications_content(App $a) { function notifications_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -272,7 +273,7 @@ function notifications_content(App $a) {
} }
if($notifs['total'] == 0) if($notifs['total'] == 0)
info( t('No introductions.') . EOL); info(L10n::t('No introductions.') . EOL);
// Normal notifications (no introductions) // Normal notifications (no introductions)
} else { } else {

View file

@ -1,6 +1,9 @@
<?php <?php
/**
* @file mod/oexchange.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Module\Login; use Friendica\Module\Login;
@ -23,7 +26,7 @@ function oexchange_content(App $a) {
} }
if (($a->argc > 1) && $a->argv[1] === 'done') { if (($a->argc > 1) && $a->argv[1] === 'done') {
info( t('Post successful.') . EOL); info(L10n::t('Post successful.') . EOL);
return; return;
} }

View file

@ -1,7 +1,10 @@
<?php <?php
/**
* @file mod/openid.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -61,7 +64,7 @@ function openid_content(App $a) {
// New registration? // New registration?
if ($a->config['register_policy'] == REGISTER_CLOSED) { if ($a->config['register_policy'] == REGISTER_CLOSED) {
notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL); notice(L10n::t('Account not found and OpenID registration is not permitted on this site.') . EOL);
goaway(System::baseUrl()); goaway(System::baseUrl());
} }
@ -111,7 +114,7 @@ function openid_content(App $a) {
// NOTREACHED // NOTREACHED
} }
} }
notice( t('Login failed.') . EOL); notice(L10n::t('Login failed.') . EOL);
goaway(System::baseUrl()); goaway(System::baseUrl());
// NOTREACHED // NOTREACHED
} }

View file

@ -3,6 +3,7 @@
* @file mod/ostatus_subscribe.php * @file mod/ostatus_subscribe.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -11,7 +12,7 @@ use Friendica\Network\Probe;
function ostatus_subscribe_content(App $a) { function ostatus_subscribe_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }

View file

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -167,7 +168,7 @@ function photos_post(App $a)
} }
if (!$can_post) { if (!$can_post) {
notice( t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
killme(); killme();
} }
@ -177,7 +178,7 @@ function photos_post(App $a)
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice( t('Contact information unavailable') . EOL); notice(L10n::t('Contact information unavailable') . EOL);
logger('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid); logger('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
killme(); killme();
} }
@ -197,7 +198,7 @@ function photos_post(App $a)
intval($page_owner_uid) intval($page_owner_uid)
); );
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice( t('Album not found.') . EOL); notice(L10n::t('Album not found.') . EOL);
goaway($_SESSION['photo_return']); goaway($_SESSION['photo_return']);
return; // NOTREACHED return; // NOTREACHED
} }
@ -790,21 +791,21 @@ function photos_post(App $a)
if ($error !== UPLOAD_ERR_OK) { if ($error !== UPLOAD_ERR_OK) {
switch ($error) { switch ($error) {
case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_INI_SIZE:
notice(t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL); notice(L10n::t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
break; break;
case UPLOAD_ERR_FORM_SIZE: case UPLOAD_ERR_FORM_SIZE:
notice(t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL); notice(L10n::t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
break; break;
case UPLOAD_ERR_PARTIAL: case UPLOAD_ERR_PARTIAL:
notice(t('Image upload didn\'t complete, please try again') . EOL); notice(L10n::t('Image upload didn\'t complete, please try again') . EOL);
break; break;
case UPLOAD_ERR_NO_FILE: case UPLOAD_ERR_NO_FILE:
notice(t('Image file is missing') . EOL); notice(L10n::t('Image file is missing') . EOL);
break; break;
case UPLOAD_ERR_NO_TMP_DIR: case UPLOAD_ERR_NO_TMP_DIR:
case UPLOAD_ERR_CANT_WRITE: case UPLOAD_ERR_CANT_WRITE:
case UPLOAD_ERR_EXTENSION: case UPLOAD_ERR_EXTENSION:
notice(t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL); notice(L10n::t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
break; break;
} }
@unlink($src); @unlink($src);
@ -822,7 +823,7 @@ function photos_post(App $a)
$maximagesize = Config::get('system', 'maximagesize'); $maximagesize = Config::get('system', 'maximagesize');
if ($maximagesize && ($filesize > $maximagesize)) { if ($maximagesize && ($filesize > $maximagesize)) {
notice(t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL); notice(L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end', $foo); Addon::callHooks('photo_post_end', $foo);
@ -830,7 +831,7 @@ function photos_post(App $a)
} }
if (!$filesize) { if (!$filesize) {
notice(t('Image file is empty.') . EOL); notice(L10n::t('Image file is empty.') . EOL);
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end', $foo); Addon::callHooks('photo_post_end', $foo);
@ -845,7 +846,7 @@ function photos_post(App $a)
if (!$Image->isValid()) { if (!$Image->isValid()) {
logger('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG); logger('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG);
notice(t('Unable to process image.') . EOL); notice(L10n::t('Unable to process image.') . EOL);
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end',$foo); Addon::callHooks('photo_post_end',$foo);
@ -874,7 +875,7 @@ function photos_post(App $a)
if (!$r) { 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(t('Image upload failed.') . EOL); notice(L10n::t('Image upload failed.') . EOL);
killme(); killme();
} }
@ -959,7 +960,7 @@ function photos_content(App $a)
// photos/name/image/xxxxx/edit // photos/name/image/xxxxx/edit
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) { if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
notice( t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -968,7 +969,7 @@ function photos_content(App $a)
require_once 'include/conversation.php'; require_once 'include/conversation.php';
if (!x($a->data,'user')) { if (!x($a->data,'user')) {
notice( t('No photos selected') . EOL ); notice(L10n::t('No photos selected') . EOL );
return; return;
} }
@ -1064,7 +1065,7 @@ function photos_content(App $a)
} }
if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) { if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
notice( t('Access to this item is restricted.') . EOL); notice(L10n::t('Access to this item is restricted.') . EOL);
return; return;
} }
@ -1079,7 +1080,7 @@ function photos_content(App $a)
// Display upload form // Display upload form
if ($datatype === 'upload') { if ($datatype === 'upload') {
if (!$can_post) { if (!$can_post) {
notice(t('Permission denied.')); notice(L10n::t('Permission denied.'));
return; return;
} }
@ -1264,9 +1265,9 @@ function photos_content(App $a)
dbesc($datum) dbesc($datum)
); );
if (DBM::is_result($ph)) { if (DBM::is_result($ph)) {
notice(t('Permission denied. Access to this item may be restricted.')); notice(L10n::t('Permission denied. Access to this item may be restricted.'));
} else { } else {
notice(t('Photo not available') . EOL ); notice(L10n::t('Photo not available') . EOL );
} }
return; return;
} }

View file

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book * Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
* This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or * This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
@ -16,13 +15,14 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once('include/security.php'); require_once 'include/security.php';
require_once('include/bbcode.php'); require_once 'include/bbcode.php';
require_once('include/items.php'); require_once 'include/items.php';
function poke_init(App $a) { function poke_init(App $a) {
@ -155,7 +155,7 @@ function poke_init(App $a) {
function poke_content(App $a) { function poke_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }

View file

@ -7,6 +7,7 @@ use Friendica\Content\Widget;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -29,7 +30,7 @@ function profile_init(App $a)
goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']); goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']);
} else { } else {
logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG); logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
notice(t('Requested profile is not available.') . EOL); notice(L10n::t('Requested profile is not available.') . EOL);
$a->error = 404; $a->error = 404;
return; return;
} }
@ -167,7 +168,7 @@ function profile_content(App $a, $update = 0)
$last_updated_key = "profile:" . $a->profile['profile_uid'] . ":" . local_user() . ":" . remote_user(); $last_updated_key = "profile:" . $a->profile['profile_uid'] . ":" . local_user() . ":" . remote_user();
if (x($a->profile, 'hidewall') && !$is_owner && !$remote_contact) { if (x($a->profile, 'hidewall') && !$is_owner && !$remote_contact) {
notice(t('Access to this profile has been restricted.') . EOL); notice(L10n::t('Access to this profile has been restricted.') . EOL);
return; return;
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -48,7 +49,7 @@ function profile_photo_post(App $a) {
// phase 2 - we have finished cropping // phase 2 - we have finished cropping
if($a->argc != 2) { if($a->argc != 2) {
notice( t('Image uploaded but image cropping failed.') . EOL ); notice(L10n::t('Image uploaded but image cropping failed.') . EOL );
return; return;
} }
@ -131,7 +132,7 @@ function profile_photo_post(App $a) {
intval(local_user()) intval(local_user())
); );
info( t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL); info(L10n::t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
// Update global directory in background // Update global directory in background
$url = System::baseUrl() . '/profile/' . $a->user['nickname']; $url = System::baseUrl() . '/profile/' . $a->user['nickname'];
if ($url && strlen(Config::get('system','directory'))) { if ($url && strlen(Config::get('system','directory'))) {
@ -140,7 +141,7 @@ function profile_photo_post(App $a) {
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user()); Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
} else { } else {
notice( t('Unable to process image') . EOL); notice(L10n::t('Unable to process image') . EOL);
} }
} }
@ -168,7 +169,7 @@ function profile_photo_post(App $a) {
$ph = new Image($imagedata, $filetype); $ph = new Image($imagedata, $filetype);
if (! $ph->isValid()) { if (! $ph->isValid()) {
notice(t('Unable to process image.') . EOL); notice(L10n::t('Unable to process image.') . EOL);
@unlink($src); @unlink($src);
return; return;
} }
@ -182,7 +183,7 @@ function profile_photo_post(App $a) {
function profile_photo_content(App $a) { function profile_photo_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
return; return;
} }
@ -193,7 +194,7 @@ function profile_photo_content(App $a) {
if( $a->argv[1]=='use'){ if( $a->argv[1]=='use'){
if ($a->argc<3){ if ($a->argc<3){
notice( t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
return; return;
}; };
@ -206,7 +207,7 @@ function profile_photo_content(App $a) {
dbesc($resource_id) dbesc($resource_id)
); );
if (!DBM::is_result($r)){ if (!DBM::is_result($r)){
notice( t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
return; return;
} }
$havescale = false; $havescale = false;
@ -314,9 +315,9 @@ function profile_photo_crop_ui_head(App $a, Image $Image) {
$r = Photo::store($Image, local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 ); $r = Photo::store($Image, local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 );
if ($r) { if ($r) {
info( t('Image uploaded successfully.') . EOL ); info(L10n::t('Image uploaded successfully.') . EOL );
} else { } else {
notice( t('Image upload failed.') . EOL ); notice(L10n::t('Image upload failed.') . EOL );
} }
if ($width > 640 || $height > 640) { if ($width > 640 || $height > 640) {

View file

@ -8,6 +8,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -30,7 +31,7 @@ function profiles_init(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice( t('Profile not found.') . EOL); notice(L10n::t('Profile not found.') . EOL);
goaway('profiles'); goaway('profiles');
return; // NOTREACHED return; // NOTREACHED
} }
@ -84,7 +85,7 @@ function profiles_init(App $a) {
dbesc($name) dbesc($name)
); );
info( t('New profile created.') . EOL); info(L10n::t('New profile created.') . EOL);
if (DBM::is_result($r3) && count($r3) == 1) { if (DBM::is_result($r3) && count($r3) == 1) {
goaway('profiles/' . $r3[0]['id']); goaway('profiles/' . $r3[0]['id']);
} }
@ -107,7 +108,7 @@ function profiles_init(App $a) {
intval($a->argv[2]) intval($a->argv[2])
); );
if(! DBM::is_result($r1)) { if(! DBM::is_result($r1)) {
notice( t('Profile unavailable to clone.') . EOL); notice(L10n::t('Profile unavailable to clone.') . EOL);
killme(); killme();
return; return;
} }
@ -123,7 +124,7 @@ function profiles_init(App $a) {
intval(local_user()), intval(local_user()),
dbesc($name) dbesc($name)
); );
info( t('New profile created.') . EOL); info(L10n::t('New profile created.') . EOL);
if ((DBM::is_result($r3)) && (count($r3) == 1)) { if ((DBM::is_result($r3)) && (count($r3) == 1)) {
goaway('profiles/'.$r3[0]['id']); goaway('profiles/'.$r3[0]['id']);
} }
@ -140,7 +141,7 @@ function profiles_init(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice( t('Profile not found.') . EOL); notice(L10n::t('Profile not found.') . EOL);
killme(); killme();
return; return;
} }
@ -173,7 +174,7 @@ function profile_clean_keywords($keywords) {
function profiles_post(App $a) { function profiles_post(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -187,7 +188,7 @@ function profiles_post(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($orig)) { if (! DBM::is_result($orig)) {
notice( t('Profile not found.') . EOL); notice(L10n::t('Profile not found.') . EOL);
return; return;
} }
@ -197,7 +198,7 @@ function profiles_post(App $a) {
$profile_name = notags(trim($_POST['profile_name'])); $profile_name = notags(trim($_POST['profile_name']));
if (! strlen($profile_name)) { if (! strlen($profile_name)) {
notice( t('Profile Name is required.') . EOL); notice(L10n::t('Profile Name is required.') . EOL);
return; return;
} }
@ -610,7 +611,7 @@ function profile_activity($changed, $value) {
function profiles_content(App $a) { function profiles_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -622,7 +623,7 @@ function profiles_content(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice( t('Profile not found.') . EOL); notice(L10n::t('Profile not found.') . EOL);
return; return;
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -24,13 +25,13 @@ function profperm_init(App $a)
function profperm_content(App $a) { function profperm_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied') . EOL); notice(L10n::t('Permission denied') . EOL);
return; return;
} }
if($a->argc < 2) { if($a->argc < 2) {
notice( t('Invalid profile identifier.') . EOL ); notice(L10n::t('Invalid profile identifier.') . EOL );
return; return;
} }
@ -59,7 +60,7 @@ function profperm_content(App $a) {
intval(local_user()) intval(local_user())
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice( t('Invalid profile identifier.') . EOL ); notice(L10n::t('Invalid profile identifier.') . EOL );
return; return;
} }
$profile = $r[0]; $profile = $r[0];

View file

@ -48,7 +48,7 @@ function register_post(App $a)
default: default:
case REGISTER_CLOSED: case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) { if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
$blocked = 1; $blocked = 1;
@ -109,7 +109,7 @@ function register_post(App $a)
} }
} elseif ($a->config['register_policy'] == REGISTER_APPROVE) { } elseif ($a->config['register_policy'] == REGISTER_APPROVE) {
if (!strlen($a->config['admin_email'])) { if (!strlen($a->config['admin_email'])) {
notice(t('Your registration can not be processed.') . EOL); notice(L10n::t('Your registration can not be processed.') . EOL);
goaway(System::baseUrl()); goaway(System::baseUrl());
} }
@ -185,7 +185,7 @@ function register_content(App $a)
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day"); $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) { if ($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.'); logger('max daily registrations exceeded.');
notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL); notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
return; return;
} }
} }

View file

@ -105,7 +105,7 @@ function regmod_content(App $a)
} }
if ((!is_site_admin()) || (x($_SESSION, 'submanage') && intval($_SESSION['submanage']))) { if ((!is_site_admin()) || (x($_SESSION, 'submanage') && intval($_SESSION['submanage']))) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return ''; return '';
} }

View file

@ -3,13 +3,14 @@
* @file mod/repair_ostatus.php * @file mod/repair_ostatus.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact; use Friendica\Model\Contact;
function repair_ostatus_content(App $a) { function repair_ostatus_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }

View file

@ -7,6 +7,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once "include/bbcode.php"; require_once "include/bbcode.php";
@ -93,7 +94,7 @@ function search_post(App $a) {
function search_content(App $a) { function search_content(App $a) {
if (Config::get('system','block_public') && !local_user() && !remote_user()) { if (Config::get('system','block_public') && !local_user() && !remote_user()) {
notice(t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -102,7 +103,7 @@ function search_content(App $a) {
["title" => t("Public access denied."), ["title" => t("Public access denied."),
"description" => t("Only logged in users are permitted to perform a search.")]); "description" => t("Only logged in users are permitted to perform a search.")]);
killme(); killme();
//notice(t('Public access denied.').EOL); //notice(L10n::t('Public access denied.').EOL);
//return; //return;
} }
@ -220,7 +221,7 @@ function search_content(App $a) {
} }
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
info( t('No results.') . EOL); info(L10n::t('No results.') . EOL);
return $o; return $o;
} }

View file

@ -35,7 +35,7 @@ function get_theme_config_file($theme)
function settings_init(App $a) function settings_init(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -134,7 +134,7 @@ function settings_post(App $a)
} }
if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) { if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -161,7 +161,7 @@ function settings_post(App $a)
$icon = defaults($_POST, 'icon' , ''); $icon = defaults($_POST, 'icon' , '');
if ($name == "" || $key == "" || $secret == "") { if ($name == "" || $key == "" || $secret == "") {
notice(t("Missing some important data!")); notice(L10n::t("Missing some important data!"));
} else { } else {
if ($_POST['submit']==t("Update")) { if ($_POST['submit']==t("Update")) {
q("UPDATE clients SET q("UPDATE clients SET
@ -272,7 +272,7 @@ function settings_post(App $a)
unset($dcrpass); unset($dcrpass);
if (!$mbox) { if (!$mbox) {
$failed = true; $failed = true;
notice(t('Failed to connect with email account using the settings provided.') . EOL); notice(L10n::t('Failed to connect with email account using the settings provided.') . EOL);
} }
} }
} }
@ -377,18 +377,18 @@ function settings_post(App $a)
$err = false; $err = false;
if ($newpass != $confirm) { if ($newpass != $confirm) {
notice(t('Passwords do not match. Password unchanged.') . EOL); notice(L10n::t('Passwords do not match. Password unchanged.') . EOL);
$err = true; $err = true;
} }
if (!x($newpass) || !x($confirm)) { if (!x($newpass) || !x($confirm)) {
notice(t('Empty passwords are not allowed. Password unchanged.') . EOL); notice(L10n::t('Empty passwords are not allowed. Password unchanged.') . EOL);
$err = true; $err = true;
} }
// check if the old password was supplied correctly before changing it to the new value // check if the old password was supplied correctly before changing it to the new value
if (!User::authenticate(intval(local_user()), $_POST['opassword'])) { if (!User::authenticate(intval(local_user()), $_POST['opassword'])) {
notice(t('Wrong password.') . EOL); notice(L10n::t('Wrong password.') . EOL);
$err = true; $err = true;
} }
@ -397,7 +397,7 @@ function settings_post(App $a)
if (DBM::is_result($result)) { if (DBM::is_result($result)) {
info(t('Password changed.') . EOL); info(t('Password changed.') . EOL);
} else { } else {
notice(t('Password update failed. Please try again.') . EOL); notice(L10n::t('Password update failed. Please try again.') . EOL);
} }
} }
} }
@ -567,7 +567,7 @@ function settings_post(App $a)
info(t('Private forum has no privacy permissions. Using default privacy group.'). EOL); info(t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
$str_group_allow = '<' . $def_gid . '>'; $str_group_allow = '<' . $def_gid . '>';
} else { } else {
notice(t('Private forum has no privacy permissions and no default privacy group.') . EOL); notice(L10n::t('Private forum has no privacy permissions and no default privacy group.') . EOL);
} }
} }
} }
@ -659,12 +659,12 @@ function settings_content(App $a)
Nav::setSelected('settings'); Nav::setSelected('settings');
if (!local_user()) { if (!local_user()) {
//notice(t('Permission denied.') . EOL); //notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) { if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -691,7 +691,7 @@ function settings_content(App $a)
local_user()); local_user());
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice(t("You can't edit this application.")); notice(L10n::t("You can't edit this application."));
return; return;
} }
$app = $r[0]; $app = $r[0];
@ -1001,7 +1001,7 @@ function settings_content(App $a)
$profile = dba::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]); $profile = dba::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
if (!DBM::is_result($profile)) { if (!DBM::is_result($profile)) {
notice(t('Unable to find your profile. Please contact your admin.') . EOL); notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
return; return;
} }

View file

@ -5,6 +5,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -56,7 +57,7 @@ function suggest_content(App $a) {
$o = ''; $o = '';
if (! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }

View file

@ -1,10 +1,13 @@
<?php <?php
/**
* @file mod/tagrm.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once('include/bbcode.php'); require_once 'include/bbcode.php';
function tagrm_post(App $a) { function tagrm_post(App $a) {
@ -44,7 +47,7 @@ function tagrm_post(App $a) {
intval(local_user()) intval(local_user())
); );
info( t('Tag removed') . EOL ); info(L10n::t('Tag removed') . EOL );
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
// NOTREACHED // NOTREACHED

View file

@ -6,6 +6,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\UserImport; use Friendica\Core\UserImport;
function uimport_post(App $a) { function uimport_post(App $a) {
@ -23,7 +24,7 @@ function uimport_post(App $a) {
default: default:
case REGISTER_CLOSED: case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) { if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
$blocked = 1; $blocked = 1;
@ -50,7 +51,7 @@ function uimport_content(App $a) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day"); $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) { if ($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.'); logger('max daily registrations exceeded.');
notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL); notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
return; return;
} }
} }

View file

@ -3,6 +3,7 @@
* @file mod/unfollow.php * @file mod/unfollow.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -11,7 +12,7 @@ use Friendica\Model\Profile;
function unfollow_post(App $a) function unfollow_post(App $a)
{ {
if (!local_user()) { if (!local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }
@ -30,7 +31,7 @@ function unfollow_post(App $a)
$contact = dba::selectFirst('contact', [], $condition); $contact = dba::selectFirst('contact', [], $condition);
if (!DBM::is_result($contact)) { if (!DBM::is_result($contact)) {
notice(t("Contact wasn't found or can't be unfollowed.")); notice(L10n::t("Contact wasn't found or can't be unfollowed."));
} else { } else {
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA])) { if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA])) {
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid` $r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
@ -53,7 +54,7 @@ function unfollow_post(App $a)
function unfollow_content(App $a) { function unfollow_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }
@ -69,13 +70,13 @@ function unfollow_content(App $a) {
$contact = dba::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition); $contact = dba::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
if (!DBM::is_result($contact)) { if (!DBM::is_result($contact)) {
notice(t("You aren't a friend of this contact.").EOL); notice(L10n::t("You aren't a friend of this contact.").EOL);
$submit = ""; $submit = "";
// NOTREACHED // NOTREACHED
} }
if (!in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) { if (!in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
notice(t("Unfollowing is currently not supported by your network.").EOL); notice(L10n::t("Unfollowing is currently not supported by your network.").EOL);
$submit = ""; $submit = "";
// NOTREACHED // NOTREACHED
} }
@ -86,7 +87,7 @@ function unfollow_content(App $a) {
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid)); $r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid));
if (!$r) { if (!$r) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
} }

View file

@ -5,6 +5,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -207,7 +208,7 @@ function videos_content(App $a) {
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) { if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -217,7 +218,7 @@ function videos_content(App $a) {
require_once('include/conversation.php'); require_once('include/conversation.php');
if(! x($a->data,'user')) { if(! x($a->data,'user')) {
notice( t('No videos selected') . EOL ); notice(L10n::t('No videos selected') . EOL );
return; return;
} }
@ -319,7 +320,7 @@ function videos_content(App $a) {
} }
if($a->data['user']['hidewall'] && (local_user() != $owner_uid) && (! $remote_contact)) { if($a->data['user']['hidewall'] && (local_user() != $owner_uid) && (! $remote_contact)) {
notice( t('Access to this item is restricted.') . EOL); notice(L10n::t('Access to this item is restricted.') . EOL);
return; return;
} }

View file

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -41,7 +42,7 @@ function viewcontacts_content(App $a) {
require_once("mod/proxy.php"); require_once("mod/proxy.php");
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) { if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL); notice(L10n::t('Public access denied.') . EOL);
return; return;
} }
@ -51,7 +52,7 @@ function viewcontacts_content(App $a) {
$o .= Profile::getTabs($a, $is_owner, $a->data['user']['nickname']); $o .= Profile::getTabs($a, $is_owner, $a->data['user']['nickname']);
if(((! count($a->profile)) || ($a->profile['hide-friends']))) { if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return $o; return $o;
} }

View file

@ -1,12 +1,15 @@
<?php <?php
/**
* @file mod/viewsrc.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
function viewsrc_content(App $a) { function viewsrc_content(App $a) {
if (! local_user()) { if (! local_user()) {
notice( t('Access denied.') . EOL); notice(L10n::t('Access denied.') . EOL);
return; return;
} }
@ -14,7 +17,7 @@ function viewsrc_content(App $a) {
if(! $item_id) { if(! $item_id) {
$a->error = 404; $a->error = 404;
notice( t('Item not found.') . EOL); notice(L10n::t('Item not found.') . EOL);
return; return;
} }

View file

@ -4,6 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Util\Mimetype; use Friendica\Util\Mimetype;
@ -73,7 +74,7 @@ function wall_attach_post(App $a) {
echo json_encode(['error'=>t('Permission denied.')]); echo json_encode(['error'=>t('Permission denied.')]);
killme(); killme();
} }
notice( t('Permission denied.') . EOL ); notice(L10n::t('Permission denied.') . EOL );
killme(); killme();
} }

View file

@ -1,5 +1,4 @@
<?php <?php
/** /**
* @file mod/wall_upload.php * @file mod/wall_upload.php
* @brief Module for uploading a picture to the profile wall * @brief Module for uploading a picture to the profile wall
@ -10,6 +9,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -103,7 +103,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
echo json_encode(['error'=>t('Permission denied.')]); echo json_encode(['error'=>t('Permission denied.')]);
killme(); killme();
} }
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
killme(); killme();
} }
@ -152,7 +152,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
echo json_encode(['error'=>t('Invalid request.')]); echo json_encode(['error'=>t('Invalid request.')]);
killme(); killme();
} }
notice(t('Invalid request.').EOL); notice(L10n::t('Invalid request.').EOL);
killme(); killme();
} }

View file

@ -3,6 +3,7 @@
* @file mod/wallmessage.php * @file mod/wallmessage.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Mail; use Friendica\Model\Mail;
@ -12,7 +13,7 @@ function wallmessage_post(App $a) {
$replyto = Profile::getMyURL(); $replyto = Profile::getMyURL();
if(! $replyto) { if(! $replyto) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -36,7 +37,7 @@ function wallmessage_post(App $a) {
$user = $r[0]; $user = $r[0];
if(! intval($user['unkmail'])) { if(! intval($user['unkmail'])) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
@ -53,19 +54,19 @@ function wallmessage_post(App $a) {
switch($ret){ switch($ret){
case -1: case -1:
notice( t('No recipient selected.') . EOL ); notice(L10n::t('No recipient selected.') . EOL );
break; break;
case -2: case -2:
notice( t('Unable to check your home location.') . EOL ); notice(L10n::t('Unable to check your home location.') . EOL );
break; break;
case -3: case -3:
notice( t('Message could not be sent.') . EOL ); notice(L10n::t('Message could not be sent.') . EOL );
break; break;
case -4: case -4:
notice( t('Message collection failure.') . EOL ); notice(L10n::t('Message collection failure.') . EOL );
break; break;
default: default:
info( t('Message sent.') . EOL ); info(L10n::t('Message sent.') . EOL );
} }
goaway('profile/'.$user['nickname']); goaway('profile/'.$user['nickname']);
@ -76,14 +77,14 @@ function wallmessage_post(App $a) {
function wallmessage_content(App $a) { function wallmessage_content(App $a) {
if (!Profile::getMyURL()) { if (!Profile::getMyURL()) {
notice(t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }
$recipient = (($a->argc > 1) ? $a->argv[1] : ''); $recipient = (($a->argc > 1) ? $a->argv[1] : '');
if(! $recipient) { if(! $recipient) {
notice( t('No recipient.') . EOL); notice(L10n::t('No recipient.') . EOL);
return; return;
} }
@ -92,7 +93,7 @@ function wallmessage_content(App $a) {
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
notice( t('No recipient.') . EOL); notice(L10n::t('No recipient.') . EOL);
logger('wallmessage: no recipient'); logger('wallmessage: no recipient');
return; return;
} }
@ -100,7 +101,7 @@ function wallmessage_content(App $a) {
$user = $r[0]; $user = $r[0];
if(! intval($user['unkmail'])) { if(! intval($user['unkmail'])) {
notice( t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
return; return;
} }

View file

@ -5,6 +5,7 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -100,13 +101,13 @@ class UserImport
$account = json_decode(file_get_contents($file['tmp_name']), true); $account = json_decode(file_get_contents($file['tmp_name']), true);
if ($account === null) { if ($account === null) {
notice(t("Error decoding account file")); notice(L10n::t("Error decoding account file"));
return; return;
} }
if (!x($account, 'version')) { if (!x($account, 'version')) {
notice(t("Error! No version data in file! This is not a Friendica account file?")); notice(L10n::t("Error! No version data in file! This is not a Friendica account file?"));
return; return;
} }
@ -114,7 +115,7 @@ class UserImport
$r = dba::selectFirst('user', ['uid'], ['nickname' => $account['user']['nickname']]); $r = dba::selectFirst('user', ['uid'], ['nickname' => $account['user']['nickname']]);
if ($r === false) { if ($r === false) {
logger("uimport:check nickname : ERROR : " . dba::errorMessage(), LOGGER_NORMAL); logger("uimport:check nickname : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
notice(t('Error! Cannot check nickname')); notice(L10n::t('Error! Cannot check nickname'));
return; return;
} }
@ -127,7 +128,7 @@ class UserImport
$r = dba::selectFirst('userd', ['id'], ['username' => $account['user']['nickname']]); $r = dba::selectFirst('userd', ['id'], ['username' => $account['user']['nickname']]);
if ($r === false) { if ($r === false) {
logger("uimport:check nickname : ERROR : " . dba::errorMessage(), LOGGER_NORMAL); logger("uimport:check nickname : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
notice(t('Error! Cannot check nickname')); notice(L10n::t('Error! Cannot check nickname'));
return; return;
} }
@ -165,7 +166,7 @@ class UserImport
$r = self::dbImportAssoc('user', $account['user']); $r = self::dbImportAssoc('user', $account['user']);
if ($r === false) { if ($r === false) {
logger("uimport:insert user : ERROR : " . dba::errorMessage(), LOGGER_NORMAL); logger("uimport:insert user : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
notice(t("User creation error")); notice(L10n::t("User creation error"));
return; return;
} }
$newuid = self::lastInsertId(); $newuid = self::lastInsertId();

View file

@ -1,11 +1,11 @@
<?php <?php
/** /**
* @file src/Model/Group.php * @file src/Model/Group.php
*/ */
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\Core\L10n;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use dba; use dba;
@ -42,7 +42,7 @@ class Group extends BaseObject
$group = dba::selectFirst('group', ['deleted'], ['id' => $gid]); $group = dba::selectFirst('group', ['deleted'], ['id' => $gid]);
if (DBM::is_result($group) && $group['deleted']) { if (DBM::is_result($group) && $group['deleted']) {
dba::update('group', ['deleted' => 0], ['gid' => $gid]); dba::update('group', ['deleted' => 0], ['gid' => $gid]);
notice(t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL); notice(L10n::t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
} }
return true; return true;
} }

View file

@ -11,6 +11,7 @@ use Friendica\Content\ForumManager;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -91,7 +92,7 @@ class Profile
if (!$user && !count($user) && !count($profiledata)) { if (!$user && !count($user) && !count($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG); logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice(t('Requested account is not available.') . EOL); notice(L10n::t('Requested account is not available.') . EOL);
$a->error = 404; $a->error = 404;
return; return;
} }
@ -112,7 +113,7 @@ class Profile
if (empty($pdata) && empty($profiledata)) { if (empty($pdata) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG); logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice(t('Requested profile is not available.') . EOL); notice(L10n::t('Requested profile is not available.') . EOL);
$a->error = 404; $a->error = 404;
return; return;
} }

View file

@ -1,10 +1,13 @@
<?php <?php
/**
* @file src/Module/Login.php
*/
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\User; use Friendica\Model\User;
use dba; use dba;
@ -58,7 +61,7 @@ class Login extends BaseModule
// if it's an email address or doesn't resolve to a URL, fail. // if it's an email address or doesn't resolve to a URL, fail.
if ($noid || strpos($openid_url, '@') || !validate_url($openid_url)) { if ($noid || strpos($openid_url, '@') || !validate_url($openid_url)) {
notice(t('Login failed.') . EOL); notice(L10n::t('Login failed.') . EOL);
goaway(self::getApp()->get_baseurl()); goaway(self::getApp()->get_baseurl());
// NOTREACHED // NOTREACHED
} }
@ -73,7 +76,7 @@ class Login extends BaseModule
$openid->returnUrl = self::getApp()->get_baseurl(true) . '/openid'; $openid->returnUrl = self::getApp()->get_baseurl(true) . '/openid';
goaway($openid->authUrl()); goaway($openid->authUrl());
} catch (Exception $e) { } catch (Exception $e) {
notice(t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br /><br >' . t('The error message was:') . ' ' . $e->getMessage()); notice(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br /><br >' . t('The error message was:') . ' ' . $e->getMessage());
} }
// NOTREACHED // NOTREACHED
} }
@ -106,7 +109,7 @@ class Login extends BaseModule
if (!$record || !count($record)) { if (!$record || !count($record)) {
logger('authenticate: failed login attempt: ' . notags(trim($_POST['username'])) . ' from IP ' . $_SERVER['REMOTE_ADDR']); logger('authenticate: failed login attempt: ' . notags(trim($_POST['username'])) . ' from IP ' . $_SERVER['REMOTE_ADDR']);
notice(t('Login failed.') . EOL); notice(L10n::t('Login failed.') . EOL);
goaway(self::getApp()->get_baseurl()); goaway(self::getApp()->get_baseurl());
} }