1
1
Fork 0

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) {
if (strstr($a, '/') && strstr($b, '/')) {
if ( t($a) == t($b)) {
if (L10n::t($a) == L10n::t($b)) {
return 0;
}
return ( t($a) < t($b)) ? -1 : 1;
return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
}
if (strstr($a, '/')) {
return -1;
} elseif (strstr($b, '/')) {
return 1;
} elseif ( t($a) == t($b)) {
} elseif (L10n::t($a) == L10n::t($b)) {
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>';
}
$continent = $ex[0];
$o .= '<optgroup label="' . t($continent) . '">';
$o .= '<optgroup label="' . L10n::t($continent) . '">';
}
if (count($ex) > 2) {
$city = substr($value,strpos($value,'/')+1);
@ -66,13 +66,13 @@ function select_timezone($current = 'America/Los_Angeles') {
}
} else {
$city = $ex[0];
if ($continent != t('Miscellaneous')) {
if ($continent != L10n::t('Miscellaneous')) {
$o .= '</optgroup>';
$continent = t('Miscellaneous');
$o .= '<optgroup label="' . t($continent) . '">';
$continent = L10n::t('Miscellaneous');
$o .= '<optgroup label="' . L10n::t($continent) . '">';
}
}
$city = str_replace('_', ' ', t($city));
$city = str_replace('_', ' ', L10n::t($city));
$selected = (($value == $current) ? " selected=\"selected\" " : "");
$o .= "<option value=\"$value\" $selected >$city</option>";
}
@ -195,17 +195,17 @@ function dob($dob)
'dob',
t('Birthday:'),
$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?
// 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');
// else
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob');
// 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');
// else
// $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),false,'dob');
return $o;
}
@ -359,23 +359,23 @@ function relative_date($posted_date, $format = null) {
$abs = strtotime($localtime);
if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === False) {
return t('never');
if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === false) {
return L10n::t('never');
}
$etime = time() - $abs;
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')],
30 * 24 * 60 * 60 => [ t('month'), t('months')],
7 * 24 * 60 * 60 => [ t('week'), t('weeks')],
24 * 60 * 60 => [ t('day'), t('days')],
60 * 60 => [ t('hour'), t('hours')],
60 => [ t('minute'), t('minutes')],
1 => [ t('second'), t('seconds')]
$a = [ 12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
24 * 60 * 60 => [L10n::t('day'), L10n::t('days')],
60 * 60 => [L10n::t('hour'), L10n::t('hours')],
60 => [L10n::t('minute'), L10n::t('minutes')],
1 => [L10n::t('second'), L10n::t('seconds')]
];
foreach ($a as $secs => $str) {
@ -384,7 +384,7 @@ function relative_date($posted_date, $format = null) {
$r = round($d);
// translators - e.g. 22 hours ago, 1 minute ago
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]));
@ -611,8 +611,8 @@ function update_contact_birthdays() {
continue;
}
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
$bdtext = sprintf(L10n::t('%s\'s birthday'), $rr['name']);
$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`)
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
L10n::pushLang($params['language']);
$banner = t('Friendica Notification');
$banner = L10n::t('Friendica Notification');
$product = FRIENDICA_PLATFORM;
$siteurl = System::baseUrl(true);
$thanks = t('Thank You,');
$thanks = L10n::t('Thank You,');
$sitename = $a->config['sitename'];
if (!x($a->config['admin_name'])) {
$site_admin = sprintf(t('%s Administrator'), $sitename);
@ -48,7 +48,7 @@ function notification($params)
$sender_email = $a->config['sender_email'];
if (empty($sender_email)) {
$sender_email = t('noreply').'@'.$hostname;
$sender_email = L10n::t('noreply').'@'.$hostname;
}
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);
$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']);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'/message/'.$params['item']['id'].'">'.$sitename.'</a>');
$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']);
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -185,7 +185,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -199,7 +199,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -213,7 +213,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -227,11 +227,11 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']);
$subject = str_replace('poked', t($params['activity']), $subject);
$preamble = str_replace('poked', t($params['activity']), $preamble);
$epreamble = str_replace('poked', t($params['activity']), $epreamble);
$subject = str_replace('poked', L10n::t($params['activity']), $subject);
$preamble = str_replace('poked', L10n::t($params['activity']), $preamble);
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -245,7 +245,7 @@ function notification($params)
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -261,7 +261,7 @@ function notification($params)
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -300,11 +300,11 @@ function notification($params)
'[url='.$params['item']['url'].']'.$params['item']['name'].'[/url]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
$body = t('Name:').' '.$params['item']['name']."\n";
$body .= t('Photo:').' '.$params['item']['photo']."\n";
$body = L10n::t('Name:').' '.$params['item']['name']."\n";
$body .= L10n::t('Photo:').' '.$params['item']['photo']."\n";
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -319,9 +319,9 @@ function notification($params)
$itemlink,
'[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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
@ -337,7 +337,7 @@ function notification($params)
$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']);
$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);
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$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)'),
$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']);
$hsitelink = sprintf($sitelink, '<a href="'.$params['link'].'">'.$sitename.'</a><br><br>');
$itemlink = $params['link'];

View file

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

View file

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

View file

@ -1,7 +1,10 @@
<?php
/**
* @file include/like.php
*/
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -31,31 +34,31 @@ function do_like($item_id, $verb) {
switch ($verb) {
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;
break;
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;
break;
case 'dislike':
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;
break;
case 'attendyes':
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;
break;
case 'attendno':
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;
break;
case 'attendmaybe':
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;
break;
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
$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) {
$post_type = t('event');
$post_type = L10n::t('event');
}
$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") ;

View file

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

View file

@ -1,8 +1,11 @@
<?php
/**
* @file include/security.php
*/
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
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()
{
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')

View file

@ -1,10 +1,10 @@
<?php
/**
* @file include/tags.php
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
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');
$o = replace_macros($tpl, [
'$title' => t('Tags'),
'$title' => L10n::t('Tags'),
'$tags' => $tags
]);
}

View file

@ -8,6 +8,7 @@ use Friendica\Content\Feature;
use Friendica\Content\Smilies;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -294,14 +295,14 @@ function paginate_data(App $a, $count = null) {
if (!is_null($count)) {
// minimal pager (newer / older)
$data['class'] = 'pager';
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), 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, '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), L10n::t('older'), 'next' . ($count <= 0 ? ' disabled' : ''));
} else {
// full pager (first / prev / 1 / 2 / ... / 14 / 15 / next / last)
$data['class'] = 'pagination';
if ($a->pager['total'] > $a->pager['itemspage']) {
_l($data, 'first', $url . '&page=1', 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, 'first', $url . '&page=1', L10n::t('first'), $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'];
@ -335,8 +336,8 @@ function paginate_data(App $a, $count = null) {
$data['pages'] = $pages;
$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, 'last', $url . '&page=' . $lastpage, t('last'), $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, L10n::t('last'), $a->pager['page'] == $lastpage ? 'disabled' : '');
}
}
@ -390,8 +391,8 @@ function alt_pager(App $a, $i) {
function scroll_loader() {
$tpl = get_markup_template("scroll_loader.tpl");
return replace_macros($tpl, [
'wait' => t('Loading more entries...'),
'end' => t('The end')
'wait' => L10n::t('Loading more entries...'),
'end' => L10n::t('The end')
]);
}
@ -927,7 +928,7 @@ function contact_block() {
$total = intval($r[0]['total']);
}
if (!$total) {
$contacts = t('No contacts');
$contacts = L10n::t('No contacts');
$micropro = null;
} else {
// Splitting the query in two parts makes it much faster
@ -964,7 +965,7 @@ function contact_block() {
$o = replace_macros($tpl, [
'$contacts' => $contacts,
'$nickname' => $a->profile['nickname'],
'$viewcontacts' => t('View Contacts'),
'$viewcontacts' => L10n::t('View Contacts'),
'$micropro' => $micropro,
]);
@ -1053,16 +1054,16 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
if (strpos($s, '#') === 0) {
$mode = 'tag';
}
$save_label = $mode === 'text' ? t('Save') : t('Follow');
$save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow');
$values = [
'$s' => htmlspecialchars($s),
'$id' => $id,
'$action_url' => $url,
'$search_label' => t('Search'),
'$search_label' => L10n::t('Search'),
'$save_label' => $save_label,
'$savedsearch' => Feature::isEnabled(local_user(),'savedsearch'),
'$search_hint' => t('@name, !forum, #tags, content'),
'$search_hint' => L10n::t('@name, !forum, #tags, content'),
'$mode' => $mode
];
@ -1073,7 +1074,7 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
t("Contacts")];
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
$arr = [
'poke' => ['poked', t('poke'), t('poked')],
'ping' => ['pinged', t('ping'), t('pinged')],
'prod' => ['prodded', t('prod'), t('prodded')],
'slap' => ['slapped', t('slap'), t('slapped')],
'finger' => ['fingered', t('finger'), t('fingered')],
'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')],
'poke' => ['poked', L10n::t('poke'), L10n::t('poked')],
'ping' => ['pinged', L10n::t('ping'), L10n::t('pinged')],
'prod' => ['prodded', L10n::t('prod'), L10n::t('prodded')],
'slap' => ['slapped', L10n::t('slap'), L10n::t('slapped')],
'finger' => ['fingered', L10n::t('finger'), L10n::t('fingered')],
'rebuff' => ['rebuffed', L10n::t('rebuff'), L10n::t('rebuffed')],
];
Addon::callHooks('poke_verbs', $arr);
return $arr;
@ -1136,11 +1137,11 @@ function get_poke_verbs() {
*/
function day_translate($s) {
$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);
$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);
return $ret;
@ -1154,10 +1155,10 @@ function day_translate($s) {
*/
function day_short_translate($s) {
$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);
$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);
return $ret;
}
@ -1358,7 +1359,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
$as .= replace_macros(get_markup_template('video_top.tpl'), [
'$video' => [
'id' => $id,
'title' => t('View Video'),
'title' => L10n::t('View Video'),
'src' => $the_url,
'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 .= ' ' . $mtch[2] . ' ' . t('bytes');
$title .= ' ' . $mtch[2] . ' ' . L10n::t('bytes');
$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>';
@ -1410,7 +1411,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
while ((strpos($s, $spoilersearch) !== false)) {
$pos = strpos($s, $spoilersearch);
$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;">';
$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)) {
$pos = strpos($s, $authorsearch);
$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;">';
$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/" . $item['guid'],
'orig' => "display/" . $item['guid'],
'title' => t('View on separate page'),
'orig_title' => t('view on separate page'),
'title' => L10n::t('View on separate page'),
'orig_title' => L10n::t('view on separate page'),
];
if (x($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)) {
$ret = [
'href' => $item['plink'],
'orig' => $item['plink'],
'title' => t('link to source'),
'title' => L10n::t('link to source'),
];
} else {
$ret = [];
@ -1763,16 +1764,16 @@ function reltoabs($text, $base) {
*/
function item_post_type($item) {
if (intval($item['event-id'])) {
return t('event');
return L10n::t('event');
} elseif (strlen($item['resource-id'])) {
return t('photo');
return L10n::t('photo');
} elseif (strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST) {
return t('activity');
return L10n::t('activity');
} 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.
@ -1935,7 +1936,7 @@ function file_tag_save_file($uid, $item, $file)
if (!strlen($saved) || !stristr($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;
}

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")) {
//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") {
info(t("You must be logged in to use addons. "));
info(L10n::t("You must be logged in to use addons. "));
} else {
include_once "addon/{$a->module}/{$a->module}.php";
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);
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . L10n::t('Not Found'));
$tpl = get_markup_template("404.tpl");
$a->page['content'] = replace_macros(
$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
* a permission problem and if so, a 403 response would seem to be in order.
*/
if (stristr(implode("", $_SESSION['sysmsg']), t('Permission denied'))) {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.'));
if (stristr(implode("", $_SESSION['sysmsg']), L10n::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"),
[
'$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\Content\ContactSelector;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use dba;
require_once 'include/dba.php';
require_once 'mod/contacts.php';
@ -18,7 +18,7 @@ function allfriends_content(App $a)
{
$o = '';
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -48,7 +48,7 @@ function allfriends_content(App $a)
$r = GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
if (!DBM::is_result($r)) {
$o .= t('No friends to display.');
$o .= L10n::t('No friends to display.');
return $o;
}
@ -70,8 +70,8 @@ function allfriends_content(App $a)
} else {
$connlnk = System::baseUrl() . '/follow/?url=' . $rr['url'];
$photo_menu = [
'profile' => [t("View Profile"), Profile::zrl($rr['url'])],
'follow' => [t("Connect/Follow"), $connlnk]
'profile' => [L10n::t("View Profile"), Profile::zrl($rr['url'])],
'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
}
@ -87,7 +87,7 @@ function allfriends_content(App $a)
'account_type' => Contact::getAccountType($contact_details),
'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu,
'conntxt' => t('Connect'),
'conntxt' => L10n::t('Connect'),
'connlnk' => $connlnk,
'id' => ++$id,
];
@ -99,7 +99,7 @@ function allfriends_content(App $a)
$tpl = get_markup_template('viewcontact_template.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,
'$contacts' => $entries,
'$paginate' => paginate($a),

View file

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

View file

@ -1,21 +1,25 @@
<?php
/**
* @file mod/apps.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
function apps_content(App $a) {
function apps_content(App $a)
{
$privateaddons = Config::get('config', 'private_addons');
if ($privateaddons === "1") {
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;
};
}
$title = t('Applications');
$title = L10n::t('Applications');
if (count($a->apps) == 0) {
notice(t('No installed applications.') . EOL);
notice(L10n::t('No installed applications.') . EOL);
}
$tpl = get_markup_template('apps.tpl');

View file

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

View file

@ -1,6 +1,9 @@
<?php
/**
* @file mod/babel.php
*/
use Friendica\Content\Text\Markdown;
use Friendica\Core\L10n;
require_once 'include/bbcode.php';
require_once 'include/bb2diaspora.php';
@ -17,14 +20,14 @@ function babel_content()
$o = '<h1>Babel Diagnostic</h1>';
$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 .= '<input type="submit" name="submit" value="Submit" /></form>';
$o .= '<br /><br />';
$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 .= '<input type="submit" name="submit" value="Submit" /></form>';
@ -32,45 +35,45 @@ function babel_content()
if (x($_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;
$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;
//$html = bbcode($text);
$o .= '<h2>' . t('bbcode: ') . '</h2>' . EOL . EOL;
$o .= '<h2>' . L10n::t('bbcode: ') . '</h2>' . EOL . EOL;
$o .= $html . EOL . EOL;
$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;
$diaspora = bb2diaspora($text);
$o .= '<h2>' . t('bb2diaspora: ') . '</h2>' . EOL . EOL;
$o .= '<h2>' . L10n::t('bb2diaspora: ') . '</h2>' . EOL . EOL;
$o .= visible_lf($diaspora) . EOL . EOL;
$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;
$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;
$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;
}
if (x($_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;
$bb = diaspora2bb($d2bbtext);
$o .= '<h2>' . t('diaspora2bb: ') . '</h2>' . EOL . EOL;
$o .= '<h2>' . L10n::t('diaspora2bb: ') . '</h2>' . EOL . EOL;
$o .= '<pre>' . $bb . '</pre>' . EOL . EOL;
}

View file

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

View file

@ -9,6 +9,7 @@ use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -135,7 +136,7 @@ function cal_content(App $a)
$is_owner = local_user() == $a->profile['profile_uid'];
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;
}
@ -267,17 +268,17 @@ function cal_content(App $a)
$o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$tabs' => $tabs,
'$title' => t('Events'),
'$view' => t('View'),
'$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", t('Previous'), '', ''],
'$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", t('Next'), '', ''],
'$title' => L10n::t('Events'),
'$view' => L10n::t('View'),
'$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", L10n::t('Previous'), '', ''],
'$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", L10n::t('Next'), '', ''],
'$calendar' => cal($y, $m, $links, ' eventcal'),
'$events' => $events,
"today" => t("today"),
"month" => t("month"),
"week" => t("week"),
"day" => t("day"),
"list" => t("list"),
"today" => L10n::t("today"),
"month" => L10n::t("month"),
"week" => L10n::t("week"),
"day" => L10n::t("day"),
"list" => L10n::t("list"),
]);
if (x($_GET, 'id')) {
@ -290,14 +291,14 @@ function cal_content(App $a)
if ($mode == 'export') {
if (!(intval($owner_uid))) {
notice(t('User not found'));
notice(L10n::t('User not found'));
return;
}
// Test permissions
// 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")) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway('cal/' . $nick);
}
@ -306,9 +307,9 @@ function cal_content(App $a)
if (!$evexport["success"]) {
if ($evexport["content"]) {
notice(t('This calendar format is not supported'));
notice(L10n::t('This calendar format is not supported'));
} else {
notice(t('No exportable data found'));
notice(L10n::t('No exportable data found'));
}
// 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 ($evexport["success"]) {
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"];
killme();
}

View file

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

View file

@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
@ -21,7 +22,7 @@ function community_content(App $a, $update = 0)
$o = '';
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
notice(t('Public access denied.') . EOL);
notice(L10n::t('Public access denied.') . EOL);
return;
}
@ -30,7 +31,7 @@ function community_content(App $a, $update = 0)
if ($a->argc > 1) {
$content = $a->argv[1];
} else {
if (!empty(Config::get('system','singleuser'))) {
if (!empty(Config::get('system', 'singleuser'))) {
// On single user systems only the global page does make sense
$content = 'global';
} else {
@ -40,7 +41,7 @@ function community_content(App $a, $update = 0)
}
if (!in_array($content, ['local', 'global'])) {
notice(t('Community option not available.') . EOL);
notice(L10n::t('Community option not available.') . EOL);
return;
}
@ -57,7 +58,7 @@ function community_content(App $a, $update = 0)
}
if (!$available) {
notice(t('Not available.') . EOL);
notice(L10n::t('Not available.') . EOL);
return;
}
}
@ -69,12 +70,12 @@ function community_content(App $a, $update = 0)
if (!$update) {
$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[] = [
'label' => t('Community'),
'label' => L10n::t('Community'),
'url' => 'community/local',
'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',
'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])) {
$tabs[] = [
'label' => t('Global Timeline'),
'label' => L10n::t('Global Timeline'),
'url' => 'community/global',
'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',
'accesskey' => 'g'
];
@ -134,7 +135,7 @@ function community_content(App $a, $update = 0)
$r = community_getitems($a->pager['start'], $a->pager['itemspage'], $content);
if (!DBM::is_result($r)) {
info(t('No results.') . EOL);
info(L10n::t('No results.') . EOL);
return $o;
}
@ -178,7 +179,7 @@ function community_content(App $a, $update = 0)
'$content' => $o,
'$header' => '',
'$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\Widget;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
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'],
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
'$network_name' => $networkname,
'$network' => t('Network:'),
'$network' => L10n::t('Network:'),
'$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()])) {
notice(t('Could not access contact record.') . EOL);
notice(L10n::t('Could not access contact record.') . EOL);
goaway('contacts');
return; // NOTREACHED
}
@ -179,7 +180,7 @@ function contacts_post(App $a)
$profile_id = intval($_POST['profile-assign']);
if ($profile_id) {
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;
}
}
@ -213,9 +214,9 @@ function contacts_post(App $a)
intval(local_user())
);
if (DBM::is_result($r)) {
info(t('Contact updated.') . EOL);
info(L10n::t('Contact updated.') . EOL);
} 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()]);
@ -374,7 +375,7 @@ function contacts_content(App $a)
Nav::setSelected('contacts');
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -388,7 +389,7 @@ function contacts_content(App $a)
$orig_record = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
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');
return; // NOTREACHED
}
@ -409,7 +410,7 @@ function contacts_content(App $a)
$r = _contact_block($contact_id, $orig_record);
if ($r) {
$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);
@ -420,7 +421,7 @@ function contacts_content(App $a)
$r = _contact_ignore($contact_id, $orig_record);
if ($r) {
$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);
@ -431,7 +432,7 @@ function contacts_content(App $a)
$r = _contact_archive($contact_id, $orig_record);
if ($r) {
$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);
@ -455,15 +456,15 @@ function contacts_content(App $a)
$a->page['aside'] = '';
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),
'$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,
'$confirm' => t('Yes'),
'$confirm' => L10n::t('Yes'),
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
'$cancel' => L10n::t('Cancel'),
]);
}
// Now check how the user responded to the confirmation query
@ -476,7 +477,7 @@ function contacts_content(App $a)
}
_contact_drop($orig_record);
info(t('Contact has been removed.') . EOL);
info(L10n::t('Contact has been removed.') . EOL);
if (x($_SESSION, 'return_url')) {
goaway('' . $_SESSION['return_url']);
} else {
@ -507,15 +508,15 @@ function contacts_content(App $a)
switch ($contact['rel']) {
case CONTACT_IS_FRIEND:
$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;
case CONTACT_IS_FOLLOWER;
$dir_icon = 'images/larrow.gif';
$relation_text = t('You are sharing with %s');
$relation_text = L10n::t('You are sharing with %s');
break;
case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif';
$relation_text = t('%s is sharing with you');
$relation_text = L10n::t('%s is sharing with you');
break;
default:
break;
@ -535,35 +536,35 @@ function contacts_content(App $a)
$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) {
$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]);
$nettype = t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"]));
$nettype = L10n::t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"]));
// tabs
$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;
if ($contact['network'] == NETWORK_FEED) {
$fetch_further_information = [
'fetch_further_information',
t('Fetch further information for feeds'),
L10n::t('Fetch further information for feeds'),
$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."),
['0' => t('Disabled'),
'1' => t('Fetch information'),
'3' => t('Fetch keywords'),
'2' => t('Fetch information and keywords')
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' => L10n::t('Disabled'),
'1' => L10n::t('Fetch information'),
'3' => L10n::t('Fetch 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 ($contact['rel'] == CONTACT_IS_FOLLOWER) {
$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) {
$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");
$o .= replace_macros($tpl, [
'$header' => t("Contact"),
'$header' => L10n::t("Contact"),
'$tab_str' => $tab_str,
'$submit' => t('Submit'),
'$lbl_vis1' => 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_info1' => t('Contact Information / Notes'),
'$lbl_info2' => t('Their personal note'),
'$submit' => L10n::t('Submit'),
'$lbl_vis1' => L10n::t('Profile Visibility'),
'$lbl_vis2' => L10n::t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
'$lbl_info1' => L10n::t('Contact Information / Notes'),
'$lbl_info2' => L10n::t('Their personal note'),
'$reason' => trim(notags($contact['reason'])),
'$infedit' => t('Edit contact notes'),
'$infedit' => L10n::t('Edit contact notes'),
'$common_link' => 'common/loc/' . local_user() . '/' . $contact['id'],
'$relation_text' => $relation_text,
'$visit' => t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
'$blockunblock' => t('Block/Unblock contact'),
'$ignorecont' => t('Ignore contact'),
'$lblcrepair' => t("Repair URL settings"),
'$lblrecent' => t('View conversations'),
'$visit' => L10n::t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
'$blockunblock' => L10n::t('Block/Unblock contact'),
'$ignorecont' => L10n::t('Ignore contact'),
'$lblcrepair' => L10n::t("Repair URL settings"),
'$lblrecent' => L10n::t('View conversations'),
'$lblsuggest' => $lblsuggest,
'$nettype' => $nettype,
'$poll_interval' => $poll_interval,
'$poll_enabled' => $poll_enabled,
'$lastupdtext' => t('Last update:'),
'$lastupdtext' => L10n::t('Last update:'),
'$lost_contact' => $lost_contact,
'$updpub' => t('Update public posts'),
'$updpub' => L10n::t('Update public posts'),
'$last_update' => $last_update,
'$udnow' => t('Update now'),
'$udnow' => L10n::t('Update now'),
'$follow' => $follow,
'$follow_text' => $follow_text,
'$profile_select' => $profile_select,
'$contact_id' => $contact['id'],
'$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'$block_text' => (($contact['blocked']) ? L10n::t('Unblock') : L10n::t('Block') ),
'$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 : ''),
'$info' => $contact['info'],
'$cinfo' => ['info', '', $contact['info'], ''],
'$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
'$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
'$archived' => (($contact['archive']) ? t('Currently archived') : ''),
'$pending' => (($contact['pending']) ? 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')],
'$notify' => ['notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')],
'$blocked' => (($contact['blocked']) ? L10n::t('Currently blocked') : ''),
'$ignored' => (($contact['readonly']) ? L10n::t('Currently ignored') : ''),
'$archived' => (($contact['archive']) ? L10n::t('Currently archived') : ''),
'$pending' => (($contact['pending']) ? L10n::t('Awaiting connection acknowledge') : ''),
'$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', 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,
'$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'],
'$name' => htmlentities($contact['name']),
'$dir_icon' => $dir_icon,
'$sparkle' => $sparkle,
'$url' => $url,
'$profileurllabel' => t('Profile URL'),
'$profileurllabel' => L10n::t('Profile URL'),
'$profileurl' => $contact['url'],
'$account_type' => Contact::getAccountType($contact),
'$location' => bbcode($contact["location"]),
'$location_label' => t("Location:"),
'$location_label' => L10n::t("Location:"),
'$xmpp' => bbcode($contact["xmpp"]),
'$xmpp_label' => t("XMPP:"),
'$xmpp_label' => L10n::t("XMPP:"),
'$about' => bbcode($contact["about"], false, false),
'$about_label' => t("About:"),
'$about_label' => L10n::t("About:"),
'$keywords' => $contact["keywords"],
'$keywords_label' => t("Tags:"),
'$contact_action_button' => t("Actions"),
'$keywords_label' => L10n::t("Tags:"),
'$contact_action_button' => L10n::t("Actions"),
'$contact_actions' => $contact_actions,
'$contact_status' => t("Status"),
'$contact_settings_label' => t('Contact Settings'),
'$contact_profile_label' => t("Profile"),
'$contact_status' => L10n::t("Status"),
'$contact_settings_label' => L10n::t('Contact Settings'),
'$contact_profile_label' => L10n::t("Profile"),
]);
$arr = ['contact' => $contact, 'output' => $o];
@ -698,58 +699,58 @@ function contacts_content(App $a)
$tabs = [
[
'label' => t('Suggestions'),
'label' => L10n::t('Suggestions'),
'url' => 'suggest',
'sel' => '',
'title' => t('Suggest potential friends'),
'title' => L10n::t('Suggest potential friends'),
'id' => 'suggestions-tab',
'accesskey' => 'g',
],
[
'label' => t('All Contacts'),
'label' => L10n::t('All Contacts'),
'url' => 'contacts/all',
'sel' => ($all) ? 'active' : '',
'title' => t('Show all contacts'),
'title' => L10n::t('Show all contacts'),
'id' => 'showall-tab',
'accesskey' => 'l',
],
[
'label' => t('Unblocked'),
'label' => L10n::t('Unblocked'),
'url' => 'contacts',
'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',
'accesskey' => 'o',
],
[
'label' => t('Blocked'),
'label' => L10n::t('Blocked'),
'url' => 'contacts/blocked',
'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked contacts'),
'title' => L10n::t('Only show blocked contacts'),
'id' => 'showblocked-tab',
'accesskey' => 'b',
],
[
'label' => t('Ignored'),
'label' => L10n::t('Ignored'),
'url' => 'contacts/ignored',
'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored contacts'),
'title' => L10n::t('Only show ignored contacts'),
'id' => 'showignored-tab',
'accesskey' => 'i',
],
[
'label' => t('Archived'),
'label' => L10n::t('Archived'),
'url' => 'contacts/archived',
'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived contacts'),
'title' => L10n::t('Only show archived contacts'),
'id' => 'showarchived-tab',
'accesskey' => 'y',
],
[
'label' => t('Hidden'),
'label' => L10n::t('Hidden'),
'url' => 'contacts/hidden',
'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden contacts'),
'title' => L10n::t('Only show hidden contacts'),
'id' => 'showhidden-tab',
'accesskey' => 'h',
],
@ -801,25 +802,25 @@ function contacts_content(App $a)
$tpl = get_markup_template("contacts-template.tpl");
$o .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$header' => t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
'$header' => L10n::t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
'$tabs' => $t,
'$total' => $total,
'$search' => $search_hdr,
'$desc' => t('Search your contacts'),
'$finding' => $searching ? t('Results for: %s', $search) : "",
'$submit' => t('Find'),
'$desc' => L10n::t('Search your contacts'),
'$finding' => $searching ? L10n::t('Results for: %s', $search) : "",
'$submit' => L10n::t('Find'),
'$cmd' => $a->cmd,
'$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,
'$batch_actions' => [
'contacts_batch_update' => t('Update'),
'contacts_batch_block' => t('Block') . "/" . t("Unblock"),
"contacts_batch_ignore" => t('Ignore') . "/" . t("Unignore"),
"contacts_batch_archive" => t('Archive') . "/" . t("Unarchive"),
"contacts_batch_drop" => t('Delete'),
'contacts_batch_update' => L10n::t('Update'),
'contacts_batch_block' => L10n::t('Block') . "/" . L10n::t("Unblock"),
"contacts_batch_ignore" => L10n::t('Ignore') . "/" . L10n::t("Unignore"),
"contacts_batch_archive" => L10n::t('Archive') . "/" . L10n::t("Unarchive"),
"contacts_batch_drop" => L10n::t('Delete'),
],
'$h_batch_actions' => t('Batch Actions'),
'$h_batch_actions' => L10n::t('Batch Actions'),
'$paginate' => paginate($a),
]);
@ -842,18 +843,18 @@ function contacts_tab($a, $contact_id, $active_tab)
// tabs
$tabs = [
[
'label' => t('Status'),
'label' => L10n::t('Status'),
'url' => "contacts/" . $contact_id . "/posts",
'sel' => (($active_tab == 1) ? 'active' : ''),
'title' => t('Status Messages and Posts'),
'title' => L10n::t('Status Messages and Posts'),
'id' => 'status-tab',
'accesskey' => 'm',
],
[
'label' => t('Profile'),
'label' => L10n::t('Profile'),
'url' => "contacts/" . $contact_id,
'sel' => (($active_tab == 2) ? 'active' : ''),
'title' => t('Profile Details'),
'title' => L10n::t('Profile Details'),
'id' => 'profile-tab',
'accesskey' => 'o',
]
@ -862,10 +863,10 @@ function contacts_tab($a, $contact_id, $active_tab)
// Show this tab only if there is visible friend list
$x = GContact::countAllFriends(local_user(), $contact_id);
if ($x) {
$tabs[] = ['label' => t('Contacts'),
$tabs[] = ['label' => L10n::t('Contacts'),
'url' => "allfriends/" . $contact_id,
'sel' => (($active_tab == 3) ? 'active' : ''),
'title' => t('View all contacts'),
'title' => L10n::t('View all contacts'),
'id' => 'allfriends-tab',
'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
$common = GContact::countCommonFriends(local_user(), $contact_id);
if ($common) {
$tabs[] = ['label' => t('Common Friends'),
$tabs[] = ['label' => L10n::t('Common Friends'),
'url' => "common/loc/" . local_user() . "/" . $contact_id,
'sel' => (($active_tab == 4) ? 'active' : ''),
'title' => t('View all common friends'),
'title' => L10n::t('View all common friends'),
'id' => 'common-loc-tab',
'accesskey' => 'd'
];
}
$tabs[] = ['label' => t('Advanced'),
$tabs[] = ['label' => L10n::t('Advanced'),
'url' => 'crepair/' . $contact_id,
'sel' => (($active_tab == 5) ? 'active' : ''),
'title' => t('Advanced Contact Settings'),
'title' => L10n::t('Advanced Contact Settings'),
'id' => 'advanced-tab',
'accesskey' => 'r'
];
@ -917,15 +918,15 @@ function _contact_detail_for_template($rr)
switch ($rr['rel']) {
case CONTACT_IS_FRIEND:
$dir_icon = 'images/lrarrow.gif';
$alt_text = t('Mutual Friendship');
$alt_text = L10n::t('Mutual Friendship');
break;
case CONTACT_IS_FOLLOWER;
$dir_icon = 'images/larrow.gif';
$alt_text = t('is a fan of yours');
$alt_text = L10n::t('is a fan of yours');
break;
case CONTACT_IS_SHARING;
$dir_icon = 'images/rarrow.gif';
$alt_text = t('you are a fan of');
$alt_text = L10n::t('you are a fan of');
break;
default:
break;
@ -939,8 +940,8 @@ function _contact_detail_for_template($rr)
}
return [
'img_hover' => t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
'edit_hover' => t('Edit contact'),
'img_hover' => L10n::t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
'edit_hover' => L10n::t('Edit contact'),
'photo_menu' => Contact::photoMenu($rr),
'id' => $rr['id'],
'alt_text' => $alt_text,
@ -972,7 +973,7 @@ function contact_actions($contact)
// Provide friend suggestion only for Friendica contacts
if ($contact['network'] === NETWORK_DFRN) {
$contact_actions['suggest'] = [
'label' => t('Suggest friends'),
'label' => L10n::t('Suggest friends'),
'url' => 'fsuggest/' . $contact['id'],
'title' => '',
'sel' => '',
@ -982,7 +983,7 @@ function contact_actions($contact)
if ($poll_enabled) {
$contact_actions['update'] = [
'label' => t('Update now'),
'label' => L10n::t('Update now'),
'url' => 'contacts/' . $contact['id'] . '/update',
'title' => '',
'sel' => '',
@ -991,33 +992,33 @@ function contact_actions($contact)
}
$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',
'title' => t('Toggle Blocked status'),
'title' => L10n::t('Toggle Blocked status'),
'sel' => (intval($contact['blocked']) ? 'active' : ''),
'id' => 'toggle-block',
];
$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',
'title' => t('Toggle Ignored status'),
'title' => L10n::t('Toggle Ignored status'),
'sel' => (intval($contact['readonly']) ? 'active' : ''),
'id' => 'toggle-ignore',
];
$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',
'title' => t('Toggle Archive status'),
'title' => L10n::t('Toggle Archive status'),
'sel' => (intval($contact['archive']) ? 'active' : ''),
'id' => 'toggle-archive',
];
$contact_actions['delete'] = [
'label' => t('Delete'),
'label' => L10n::t('Delete'),
'url' => 'contacts/' . $contact['id'] . '/drop',
'title' => t('Delete contact'),
'title' => L10n::t('Delete contact'),
'sel' => '',
'id' => 'delete',
];

View file

@ -1,11 +1,12 @@
<?php
/**
* @file mod/credits.php
* Show a credits page for all the developers who helped with the project
* (only contributors to the git repositories for friendica core and the
* addons repository will be listed though ATM)
*/
use Friendica\App;
use Friendica\Core\L10n;
function credits_content()
{
@ -14,8 +15,8 @@ function credits_content()
$names = explode("\n", htmlspecialchars($credits_string));
$tpl = get_markup_template('credits.tpl');
return replace_macros($tpl, [
'$title' => 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!'),
'$title' => L10n::t('Credits'),
'$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,
]);
}

View file

@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
@ -83,9 +84,9 @@ function crepair_post(App $a)
}
if ($r) {
info(t('Contact settings applied.') . EOL);
info(L10n::t('Contact settings applied.') . EOL);
} else {
notice(t('Contact update failed.') . EOL);
notice(L10n::t('Contact update failed.') . EOL);
}
return;
@ -94,7 +95,7 @@ function crepair_post(App $a)
function crepair_content(App $a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -106,12 +107,12 @@ function crepair_content(App $a)
}
if (!DBM::is_result($contact)) {
notice(t('Contact not found.') . EOL);
notice(L10n::t('Contact not found.') . EOL);
return;
}
$warning = 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.');
$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 = L10n::t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
$returnaddr = "contacts/$cid";
@ -125,9 +126,9 @@ function crepair_content(App $a)
}
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 {
$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]);
@ -140,29 +141,29 @@ function crepair_content(App $a)
'$warning' => $warning,
'$info' => $info,
'$returnaddr' => $returnaddr,
'$return' => t('Return to contact editor'),
'$return' => L10n::t('Return to contact editor'),
'$update_profile' => $update_profile,
'$udprofilenow' => t('Refetch contact data'),
'$udprofilenow' => L10n::t('Refetch contact data'),
'$contact_id' => $contact['id'],
'$lbl_submit' => t('Submit'),
'$label_remote_self' => t('Remote Self'),
'$lbl_submit' => L10n::t('Submit'),
'$label_remote_self' => L10n::t('Remote Self'),
'$allow_remote_self' => $allow_remote_self,
'$remote_self' => ['remote_self',
t('Mirror postings from this contact'),
L10n::t('Mirror postings from this contact'),
$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
],
'$name' => ['name', t('Name') , htmlentities($contact['name'])],
'$nick' => ['nick', t('Account Nickname'), htmlentities($contact['nick'])],
'$attag' => ['attag', t('@Tagname - overrides Name/Nickname'), $contact['attag']],
'$url' => ['url', t('Account URL'), $contact['url']],
'$request' => ['request', t('Friend Request URL'), $contact['request']],
'confirm' => ['confirm', t('Friend Confirm URL'), $contact['confirm']],
'notify' => ['notify', t('Notification Endpoint URL'), $contact['notify']],
'poll' => ['poll', t('Poll/Feed URL'), $contact['poll']],
'photo' => ['photo', t('New photo from this URL'), ''],
'$name' => ['name', L10n::t('Name') , htmlentities($contact['name'])],
'$nick' => ['nick', L10n::t('Account Nickname'), htmlentities($contact['nick'])],
'$attag' => ['attag', L10n::t('@Tagname - overrides Name/Nickname'), $contact['attag']],
'$url' => ['url', L10n::t('Account URL'), $contact['url']],
'$request' => ['request', L10n::t('Friend Request URL'), $contact['request']],
'confirm' => ['confirm', L10n::t('Friend Confirm URL'), $contact['confirm']],
'notify' => ['notify', L10n::t('Notification Endpoint URL'), $contact['notify']],
'poll' => ['poll', L10n::t('Poll/Feed URL'), $contact['poll']],
'photo' => ['photo', L10n::t('New photo from this URL'), ''],
]);
return $o;

View file

@ -1,6 +1,9 @@
<?php
/**
* @file mod/delegate.php
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -14,7 +17,7 @@ function delegate_init(App $a)
function delegate_content(App $a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -90,7 +93,7 @@ function delegate_content(App $a)
dbesc(NETWORK_DFRN)
);
if (!DBM::is_result($r)) {
notice(t('No potential page delegates located.') . EOL);
notice(L10n::t('No potential page delegates located.') . EOL);
return;
}
@ -116,18 +119,18 @@ function delegate_content(App $a)
settings_init($a);
$o = replace_macros(get_markup_template('delegate.tpl'), [
'$header' => t('Delegate Page Management'),
'$header' => L10n::t('Delegate Page Management'),
'$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.'),
'$head_managers' => t('Existing Page Managers'),
'$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' => L10n::t('Existing Page Managers'),
'$managers' => $full_managers,
'$head_delegates' => t('Existing Page Delegates'),
'$head_delegates' => L10n::t('Existing Page Delegates'),
'$delegates' => $delegates,
'$head_potentials' => t('Potential Delegates'),
'$head_potentials' => L10n::t('Potential Delegates'),
'$potentials' => $potentials,
'$remove' => t('Remove'),
'$add' => t('Add'),
'$none' => t('No entries.')
'$remove' => L10n::t('Remove'),
'$add' => L10n::t('Add'),
'$none' => L10n::t('No entries.')
]);

View file

@ -1,5 +1,4 @@
<?php
/**
* @file mod/dfrn_confirm.php
* @brief Module: dfrn_confirm
@ -20,6 +19,7 @@
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -61,13 +61,13 @@ function dfrn_confirm_post(App $a, $handsfree = null)
if (!x($_POST, 'source_url')) {
$uid = defaults($handsfree, 'uid', local_user());
if (!$uid) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
$user = dba::selectFirst('user', [], ['uid' => $uid]);
if (!DBM::is_result($user)) {
notice(t('Profile not found.') . EOL);
notice(L10n::t('Profile not found.') . EOL);
return;
}
@ -124,8 +124,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
);
if (!DBM::is_result($r)) {
logger('Contact not found in DB.');
notice(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('Contact not found.') . EOL);
notice(L10n::t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
return;
}
@ -235,19 +235,19 @@ function dfrn_confirm_post(App $a, $handsfree = null)
// We shouldn't proceed, because the xml parser might choke,
// and $status is going to be zero, which indicates 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;
}
if (strlen($leading_junk) && Config::get('system', 'debugging')) {
// This might be more common. Mixed error text and some XML.
// 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) {
// 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;
}
@ -268,15 +268,15 @@ function dfrn_confirm_post(App $a, $handsfree = null)
);
case 2:
notice(t("Temporary failure. Please wait and try again.") . EOL);
notice(L10n::t("Temporary failure. Please wait and try again.") . EOL);
break;
case 3:
notice(t("Introduction failed or was revoked.") . EOL);
notice(L10n::t("Introduction failed or was revoked.") . EOL);
break;
}
if (strlen($message)) {
notice(t('Remote site reported: ') . $message . EOL);
notice(L10n::t('Remote site reported: ') . $message . EOL);
}
if (($status == 0) && ($intro_id)) {
@ -389,7 +389,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
/// @TODO is DBM::is_result() working here?
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
@ -424,7 +424,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$arr['verb'] = ACTIVITY_FRIEND;
$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>'
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
@ -491,7 +491,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
// Find our user's account
$user = dba::selectFirst('user', [], ['nickname' => $node]);
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
// NOTREACHED
}
@ -501,7 +501,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
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);
}
@ -512,7 +512,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
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);
// NOTREACHED
}
@ -528,7 +528,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$contact = dba::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]);
if (!DBM::is_result($contact)) {
// 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);
return; // NOTREACHED
}
@ -542,7 +542,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$dfrn_record = $contact['id'];
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);
}
@ -558,7 +558,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
}
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
// NOTREACHED
}
@ -569,7 +569,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
intval($dfrn_record)
);
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);
}
@ -624,7 +624,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
intval($dfrn_record)
);
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);
}
@ -654,7 +654,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
'to_email' => $combined['email'],
'uid' => $combined['uid'],
'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_photo' => $combined['photo'],
'verb' => ($mutual?ACTIVITY_FRIEND:ACTIVITY_FOLLOW),
@ -687,7 +687,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$arr['verb'] = ACTIVITY_JOIN;
$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>'
. '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
$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\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -87,7 +88,7 @@ function dfrn_request_post(App $a)
if (DBM::is_result($r)) {
if (strlen($r[0]['dfrn-id'])) {
// 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;
} else {
$contact_record = $r[0];
@ -105,14 +106,14 @@ function dfrn_request_post(App $a)
$parms = Probe::profile($dfrn_url);
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;
} else {
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')) {
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);
if ($invalid) {
@ -192,7 +193,7 @@ function dfrn_request_post(App $a)
}
// invalid/bogus request
notice(t('Unrecoverable protocol error.') . EOL);
notice(L10n::t('Unrecoverable protocol error.') . EOL);
goaway(System::baseUrl());
return; // NOTREACHED
}
@ -219,7 +220,7 @@ function dfrn_request_post(App $a)
*
*/
if (!(is_array($a->profile) && count($a->profile))) {
notice(t('Profile unavailable.') . EOL);
notice(L10n::t('Profile unavailable.') . EOL);
return;
}
@ -242,8 +243,8 @@ function dfrn_request_post(App $a)
);
if (DBM::is_result($r) && count($r) > $maxreq) {
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(t('Friends are advised to please try again in 24 hours.') . EOL);
notice(L10n::t('Spam protection measures have been invoked.') . EOL);
notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
return;
}
}
@ -273,7 +274,7 @@ function dfrn_request_post(App $a)
$url = trim($_POST['dfrn_url']);
if (!strlen($url)) {
notice(t("Invalid locator") . EOL);
notice(L10n::t("Invalid locator") . EOL);
return;
}
@ -309,7 +310,7 @@ function dfrn_request_post(App $a)
if (DBM::is_result($ret)) {
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;
} elseif ($ret[0]['rel'] == CONTACT_IS_FRIEND) {
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 {
$url = validate_url($url);
if (!$url) {
notice(t('Invalid profile URL.') . EOL);
notice(L10n::t('Invalid profile URL.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED
}
if (!allowed_url($url)) {
notice(t('Disallowed profile URL.') . EOL);
notice(L10n::t('Disallowed profile URL.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED
}
if (blocked_url($url)) {
notice(t('Blocked domain') . EOL);
notice(L10n::t('Blocked domain') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED
}
@ -352,14 +353,14 @@ function dfrn_request_post(App $a)
$parms = Probe::profile(($hcard) ? $hcard : $url);
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);
} else {
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')) {
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);
if ($invalid) {
@ -412,7 +413,7 @@ function dfrn_request_post(App $a)
}
}
if ($r === false) {
notice(t('Failed to update contact record.') . EOL);
notice(L10n::t('Failed to update contact record.') . EOL);
return;
}
@ -470,7 +471,7 @@ function dfrn_request_post(App $a)
// NOTREACHED
// END $network != NETWORK_PHANTOM
} 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;
@ -494,7 +495,7 @@ function dfrn_request_content(App $a)
// 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.
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();
}
@ -508,7 +509,7 @@ function dfrn_request_content(App $a)
$_POST["confirm_key"] = $confirm_key;
$_POST["localconfirm"] = 1;
$_POST["hidden-contact"] = 0;
$_POST["submit"] = t('Confirm');
$_POST["submit"] = L10n::t('Confirm');
dfrn_request_post($a);
@ -520,12 +521,12 @@ function dfrn_request_content(App $a)
$o = replace_macros($tpl, [
'$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
'$hidethem' => t('Hide this contact'),
'$hidethem' => L10n::t('Hide this contact'),
'$hidechecked' => '',
'$confirm_key' => $confirm_key,
'$welcome' => sprintf(t('Welcome home %s.'), $a->user['username']),
'$please' => sprintf(t('Please confirm your introduction/connection request to %s.'), $dfrn_url),
'$submit' => t('Confirm'),
'$submit' => L10n::t('Confirm'),
'$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'],
'dfrn_rawurl' => $_GET['dfrn_url']
@ -561,7 +562,7 @@ function dfrn_request_content(App $a)
'to_email' => $r[0]['email'],
'uid' => $r[0]['uid'],
'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_photo' => $r[0]['photo'],
'verb' => ACTIVITY_REQ_FRIEND,
@ -600,7 +601,7 @@ function dfrn_request_content(App $a)
// Normal web request. Display our user's introduction form.
if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
if (!Config::get('system', 'local_block')) {
notice(t('Public access denied.') . EOL);
notice(L10n::t('Public access denied.') . EOL);
return;
}
}
@ -635,7 +636,7 @@ function dfrn_request_content(App $a)
$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(
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, [
'$header' => t('Friend/Connection Request'),
'$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
'$pls_answer' => t('Please answer the following:'),
'$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'), $a->profile['name']), false, '', [t('No'), t('Yes')]],
'$add_note' => t('Add a personal note:'),
'$header' => L10n::t('Friend/Connection Request'),
'$desc' => L10n::t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
'$pls_answer' => L10n::t('Please answer the following:'),
'$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'), $a->profile['name']), false, '', [t('No'), L10n::t('Yes')]],
'$add_note' => L10n::t('Add a personal note:'),
'$page_desc' => $page_desc,
'$friendica' => t('Friendica'),
'$statusnet' => t('GNU Social (Pleroma, Mastodon)'),
'$diaspora' => t('Diaspora (Socialhome, Hubzilla)'),
'$friendica' => L10n::t('Friendica'),
'$statusnet' => L10n::t('GNU Social (Pleroma, Mastodon)'),
'$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),
'$your_address' => t('Your Identity Address:'),
'$your_address' => L10n::t('Your Identity Address:'),
'$invite_desc' => $invite_desc,
'$submit' => t('Submit Request'),
'$cancel' => t('Cancel'),
'$submit' => L10n::t('Submit Request'),
'$cancel' => L10n::t('Cancel'),
'$nickname' => $a->argv[1],
'$name' => $a->profile['name'],
'$myaddr' => $myaddr

View file

@ -7,6 +7,7 @@ use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
@ -34,7 +35,7 @@ function directory_content(App $a) {
if((Config::get('system','block_public')) && (! 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;
}
@ -124,10 +125,10 @@ function directory_content(App $a) {
}
// if(strlen($rr['dob'])) {
// if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
// $details .= '<br />' . t('Age: ') . $years ;
// $details .= '<br />' . L10n::t('Age: ') . $years ;
// }
// if(strlen($rr['gender']))
// $details .= '<br />' . t('Gender: ') . $rr['gender'];
// $details .= '<br />' . L10n::t('Gender: ') . $rr['gender'];
$profile = $rr;
@ -136,15 +137,15 @@ function directory_content(App $a) {
|| (x($profile,'region') == 1)
|| (x($profile,'postal-code') == 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;
@ -180,31 +181,30 @@ function directory_content(App $a) {
unset($profile);
unset($location);
if(! $arr['entry'])
if (!$arr['entry']) {
continue;
}
$entries[] = $arr['entry'];
}
$tpl = get_markup_template('directory_header.tpl');
$o .= replace_macros($tpl, [
'$search' => $search,
'$globaldir' => t('Global Directory'),
'$globaldir' => L10n::t('Global Directory'),
'$gdirpath' => $gdirpath,
'$desc' => t('Find on this site'),
'$desc' => L10n::t('Find on this site'),
'$contacts' => $entries,
'$finding' => t('Results for:'),
'$finding' => L10n::t('Results for:'),
'$findterm' => (strlen($search) ? $search : ""),
'$title' => t('Site Directory'),
'$submit' => t('Find'),
'$title' => L10n::t('Site Directory'),
'$submit' => L10n::t('Find'),
'$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;
}

View file

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

View file

@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -63,7 +64,7 @@ function display_init(App $a)
if (!DBM::is_result($r)) {
$a->error = 404;
notice(t('Item not found.') . EOL);
notice(L10n::t('Item not found.') . EOL);
return;
}
} 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) {
if (Config::get('system','block_public') && !local_user() && !remote_user()) {
notice(t('Public access denied.') . EOL);
notice(L10n::t('Public access denied.') . EOL);
return;
}
@ -240,7 +241,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
if (!$item_id) {
$a->error = 404;
notice(t('Item not found.').EOL);
notice(L10n::t('Item not found.').EOL);
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);
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;
}
@ -342,7 +343,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
);
if (!DBM::is_result($r)) {
notice(t('Item not found.') . EOL);
notice(L10n::t('Item not found.') . EOL);
return $o;
}

View file

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

View file

@ -6,6 +6,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
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";
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'])) {
echo t('Event can not end before it has started.');
killme();
@ -108,7 +109,7 @@ function events_post(App $a) {
}
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'])) {
echo t('Event title and start time are required.');
killme();
@ -191,7 +192,7 @@ function events_post(App $a) {
function events_content(App $a) {
if (! local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -552,7 +553,7 @@ function events_content(App $a) {
}
if ($del == 0) {
notice(t('Failed to remove event' ) . EOL);
notice(L10n::t('Failed to remove event') . EOL);
} else {
info(t('Event removed') . EOL);
}

View file

@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
@ -12,7 +13,7 @@ use Friendica\Network\Probe;
function follow_post(App $a) {
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@ -42,7 +43,7 @@ function follow_post(App $a) {
info(t('Contact added').EOL);
if (strstr($return_url,'contacts')) {
if (strstr($return_url, 'contacts')) {
goaway(System::baseUrl().'/contacts/'.$contact_id);
}
@ -53,7 +54,7 @@ function follow_post(App $a) {
function follow_content(App $a) {
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@ -72,7 +73,7 @@ function follow_content(App $a) {
dbesc(normalise_link($url)), dbesc($url), dbesc(NETWORK_STATUSNET));
if ($r) {
notice(t('You already added this contact.').EOL);
notice(L10n::t('You already added this contact.').EOL);
$submit = "";
//goaway($_SESSION['return_url']);
// NOTREACHED
@ -80,22 +81,22 @@ function follow_content(App $a) {
$ret = Probe::uri($url);
if (($ret["network"] == NETWORK_DIASPORA) && !Config::get('system','diaspora_enabled')) {
notice(t("Diaspora support isn't enabled. Contact can't be added.") . EOL);
if (($ret["network"] == NETWORK_DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
notice(L10n::t("Diaspora support isn't enabled. Contact can't be added.") . EOL);
$submit = "";
//goaway($_SESSION['return_url']);
// NOTREACHED
}
if (($ret["network"] == NETWORK_OSTATUS) && Config::get('system','ostatus_disabled')) {
notice(t("OStatus support is disabled. Contact can't be added.") . EOL);
if (($ret["network"] == NETWORK_OSTATUS) && Config::get('system', 'ostatus_disabled')) {
notice(L10n::t("OStatus support is disabled. Contact can't be added.") . EOL);
$submit = "";
//goaway($_SESSION['return_url']);
// NOTREACHED
}
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 = "";
//goaway($_SESSION['return_url']);
// 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));
if (!$r) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}

View file

@ -3,6 +3,7 @@
* @file mod/fsuggest.php
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -23,7 +24,7 @@ function fsuggest_post(App $a) {
intval(local_user())
);
if (! DBM::is_result($r)) {
notice( t('Contact not found.') . EOL);
notice(L10n::t('Contact not found.') . EOL);
return;
}
$contact = $r[0];
@ -66,7 +67,7 @@ function fsuggest_post(App $a) {
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';
if (! local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -97,7 +98,7 @@ function fsuggest_content(App $a)
intval(local_user())
);
if (! DBM::is_result($r)) {
notice(t('Contact not found.') . EOL);
notice(L10n::t('Contact not found.') . EOL);
return;
}
$contact = $r[0];

View file

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

View file

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

View file

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

View file

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

View file

@ -1,10 +1,10 @@
<?php
/**
* @file mod/lostpass.php
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
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];
$user = dba::selectFirst('user', ['uid', 'username', 'email'], $condition);
if (!DBM::is_result($user)) {
notice(t('No valid account found.') . EOL);
notice(L10n::t('No valid account found.') . EOL);
goaway(System::baseUrl());
}
@ -86,7 +86,7 @@ function lostpass_content(App $a)
$user = dba::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]);
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();
}
@ -99,7 +99,7 @@ function lostpass_content(App $a)
];
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();
}

View file

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

View file

@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -43,7 +44,7 @@ function match_content(App $a)
return;
}
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;
}

View file

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

View file

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

View file

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

View file

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

View file

@ -1,13 +1,16 @@
<?php
/* GNU Social -> friendica items permanent-url compatibility */
/**
* @file mod/notice.php
* GNU Social -> friendica items permanent-url compatibility
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
function notice_init(App $a) {
function notice_init(App $a)
{
$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));
if (DBM::is_result($r)) {
@ -16,7 +19,7 @@ function notice_init(App $a) {
goaway($url);
} else {
$a->error = 404;
notice(t('Item not found.') . EOL);
notice(L10n::t('Item not found.') . EOL);
}
return;

View file

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

View file

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

View file

@ -1,7 +1,10 @@
<?php
/**
* @file mod/openid.php
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -61,7 +64,7 @@ function openid_content(App $a) {
// New registration?
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());
}
@ -111,7 +114,7 @@ function openid_content(App $a) {
// NOTREACHED
}
}
notice( t('Login failed.') . EOL);
notice(L10n::t('Login failed.') . EOL);
goaway(System::baseUrl());
// NOTREACHED
}

View file

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

View file

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@ -167,7 +168,7 @@ function photos_post(App $a)
}
if (!$can_post) {
notice( t('Permission denied.') . EOL );
notice(L10n::t('Permission denied.') . EOL );
killme();
}
@ -177,7 +178,7 @@ function photos_post(App $a)
);
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);
killme();
}
@ -197,7 +198,7 @@ function photos_post(App $a)
intval($page_owner_uid)
);
if (!DBM::is_result($r)) {
notice( t('Album not found.') . EOL);
notice(L10n::t('Album not found.') . EOL);
goaway($_SESSION['photo_return']);
return; // NOTREACHED
}
@ -790,21 +791,21 @@ function photos_post(App $a)
if ($error !== UPLOAD_ERR_OK) {
switch ($error) {
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;
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;
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;
case UPLOAD_ERR_NO_FILE:
notice(t('Image file is missing') . EOL);
notice(L10n::t('Image file is missing') . EOL);
break;
case UPLOAD_ERR_NO_TMP_DIR:
case UPLOAD_ERR_CANT_WRITE:
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;
}
@unlink($src);
@ -822,7 +823,7 @@ function photos_post(App $a)
$maximagesize = Config::get('system', '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);
$foo = 0;
Addon::callHooks('photo_post_end', $foo);
@ -830,7 +831,7 @@ function photos_post(App $a)
}
if (!$filesize) {
notice(t('Image file is empty.') . EOL);
notice(L10n::t('Image file is empty.') . EOL);
@unlink($src);
$foo = 0;
Addon::callHooks('photo_post_end', $foo);
@ -845,7 +846,7 @@ function photos_post(App $a)
if (!$Image->isValid()) {
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);
$foo = 0;
Addon::callHooks('photo_post_end',$foo);
@ -874,7 +875,7 @@ function photos_post(App $a)
if (!$r) {
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();
}
@ -959,7 +960,7 @@ function photos_content(App $a)
// photos/name/image/xxxxx/edit
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
notice( t('Public access denied.') . EOL);
notice(L10n::t('Public access denied.') . EOL);
return;
}
@ -968,7 +969,7 @@ function photos_content(App $a)
require_once 'include/conversation.php';
if (!x($a->data,'user')) {
notice( t('No photos selected') . EOL );
notice(L10n::t('No photos selected') . EOL );
return;
}
@ -1064,7 +1065,7 @@ function photos_content(App $a)
}
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;
}
@ -1079,7 +1080,7 @@ function photos_content(App $a)
// Display upload form
if ($datatype === 'upload') {
if (!$can_post) {
notice(t('Permission denied.'));
notice(L10n::t('Permission denied.'));
return;
}
@ -1264,9 +1265,9 @@ function photos_content(App $a)
dbesc($datum)
);
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 {
notice(t('Photo not available') . EOL );
notice(L10n::t('Photo not available') . EOL );
}
return;
}

View file

@ -1,5 +1,4 @@
<?php
/**
* 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
@ -16,13 +15,14 @@
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
require_once 'include/security.php';
require_once 'include/bbcode.php';
require_once 'include/items.php';
function poke_init(App $a) {
@ -155,7 +155,7 @@ function poke_init(App $a) {
function poke_content(App $a) {
if (! local_user()) {
notice( t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}

View file

@ -7,6 +7,7 @@ use Friendica\Content\Widget;
use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -29,7 +30,7 @@ function profile_init(App $a)
goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']);
} else {
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;
return;
}
@ -167,7 +168,7 @@ function profile_content(App $a, $update = 0)
$last_updated_key = "profile:" . $a->profile['profile_uid'] . ":" . local_user() . ":" . remote_user();
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;
}

View file

@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -48,7 +49,7 @@ function profile_photo_post(App $a) {
// phase 2 - we have finished cropping
if($a->argc != 2) {
notice( t('Image uploaded but image cropping failed.') . EOL );
notice(L10n::t('Image uploaded but image cropping failed.') . EOL );
return;
}
@ -131,7 +132,7 @@ function profile_photo_post(App $a) {
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
$url = System::baseUrl() . '/profile/' . $a->user['nickname'];
if ($url && strlen(Config::get('system','directory'))) {
@ -140,7 +141,7 @@ function profile_photo_post(App $a) {
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
} 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);
if (! $ph->isValid()) {
notice(t('Unable to process image.') . EOL);
notice(L10n::t('Unable to process image.') . EOL);
@unlink($src);
return;
}
@ -182,7 +183,7 @@ function profile_photo_post(App $a) {
function profile_photo_content(App $a) {
if (! local_user()) {
notice( t('Permission denied.') . EOL );
notice(L10n::t('Permission denied.') . EOL );
return;
}
@ -193,7 +194,7 @@ function profile_photo_content(App $a) {
if( $a->argv[1]=='use'){
if ($a->argc<3){
notice( t('Permission denied.') . EOL );
notice(L10n::t('Permission denied.') . EOL );
return;
};
@ -206,7 +207,7 @@ function profile_photo_content(App $a) {
dbesc($resource_id)
);
if (!DBM::is_result($r)){
notice( t('Permission denied.') . EOL );
notice(L10n::t('Permission denied.') . EOL );
return;
}
$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 );
if ($r) {
info( t('Image uploaded successfully.') . EOL );
info(L10n::t('Image uploaded successfully.') . EOL );
} else {
notice( t('Image upload failed.') . EOL );
notice(L10n::t('Image upload failed.') . EOL );
}
if ($width > 640 || $height > 640) {

View file

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

View file

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

View file

@ -48,7 +48,7 @@ function register_post(App $a)
default:
case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
$blocked = 1;
@ -109,7 +109,7 @@ function register_post(App $a)
}
} elseif ($a->config['register_policy'] == REGISTER_APPROVE) {
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());
}
@ -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");
if ($r && $r[0]['total'] >= $max_dailies) {
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;
}
}

View file

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

View file

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

View file

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

View file

@ -35,7 +35,7 @@ function get_theme_config_file($theme)
function settings_init(App $a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -134,7 +134,7 @@ function settings_post(App $a)
}
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;
}
@ -161,7 +161,7 @@ function settings_post(App $a)
$icon = defaults($_POST, 'icon' , '');
if ($name == "" || $key == "" || $secret == "") {
notice(t("Missing some important data!"));
notice(L10n::t("Missing some important data!"));
} else {
if ($_POST['submit']==t("Update")) {
q("UPDATE clients SET
@ -272,7 +272,7 @@ function settings_post(App $a)
unset($dcrpass);
if (!$mbox) {
$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;
if ($newpass != $confirm) {
notice(t('Passwords do not match. Password unchanged.') . EOL);
notice(L10n::t('Passwords do not match. Password unchanged.') . EOL);
$err = true;
}
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;
}
// check if the old password was supplied correctly before changing it to the new value
if (!User::authenticate(intval(local_user()), $_POST['opassword'])) {
notice(t('Wrong password.') . EOL);
notice(L10n::t('Wrong password.') . EOL);
$err = true;
}
@ -397,7 +397,7 @@ function settings_post(App $a)
if (DBM::is_result($result)) {
info(t('Password changed.') . EOL);
} 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);
$str_group_allow = '<' . $def_gid . '>';
} 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');
if (!local_user()) {
//notice(t('Permission denied.') . EOL);
//notice(L10n::t('Permission denied.') . EOL);
return;
}
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
@ -691,7 +691,7 @@ function settings_content(App $a)
local_user());
if (!DBM::is_result($r)) {
notice(t("You can't edit this application."));
notice(L10n::t("You can't edit this application."));
return;
}
$app = $r[0];
@ -1001,7 +1001,7 @@ function settings_content(App $a)
$profile = dba::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
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;
}

View file

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

View file

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

View file

@ -6,6 +6,7 @@
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\UserImport;
function uimport_post(App $a) {
@ -23,7 +24,7 @@ function uimport_post(App $a) {
default:
case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
return;
}
$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");
if ($r && $r[0]['total'] >= $max_dailies) {
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;
}
}

View file

@ -3,6 +3,7 @@
* @file mod/unfollow.php
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -11,7 +12,7 @@ use Friendica\Model\Profile;
function unfollow_post(App $a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@ -30,7 +31,7 @@ function unfollow_post(App $a)
$contact = dba::selectFirst('contact', [], $condition);
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 {
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA])) {
$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) {
if (! local_user()) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
@ -69,13 +70,13 @@ function unfollow_content(App $a) {
$contact = dba::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
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 = "";
// NOTREACHED
}
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 = "";
// 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));
if (!$r) {
notice(t('Permission denied.') . EOL);
notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}

View file

@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -207,7 +208,7 @@ function videos_content(App $a) {
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL);
notice(L10n::t('Public access denied.') . EOL);
return;
}
@ -217,7 +218,7 @@ function videos_content(App $a) {
require_once('include/conversation.php');
if(! x($a->data,'user')) {
notice( t('No videos selected') . EOL );
notice(L10n::t('No videos selected') . EOL );
return;
}
@ -319,7 +320,7 @@ function videos_content(App $a) {
}
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;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,11 @@
<?php
/**
* @file src/Model/Group.php
*/
namespace Friendica\Model;
use Friendica\Core\L10n;
use Friendica\BaseObject;
use Friendica\Database\DBM;
use dba;
@ -42,7 +42,7 @@ class Group extends BaseObject
$group = dba::selectFirst('group', ['deleted'], ['id' => $gid]);
if (DBM::is_result($group) && $group['deleted']) {
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;
}

View file

@ -11,6 +11,7 @@ use Friendica\Content\ForumManager;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -91,7 +92,7 @@ class Profile
if (!$user && !count($user) && !count($profiledata)) {
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;
return;
}
@ -112,7 +113,7 @@ class Profile
if (empty($pdata) && empty($profiledata)) {
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;
return;
}

View file

@ -1,10 +1,13 @@
<?php
/**
* @file src/Module/Login.php
*/
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\User;
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 ($noid || strpos($openid_url, '@') || !validate_url($openid_url)) {
notice(t('Login failed.') . EOL);
notice(L10n::t('Login failed.') . EOL);
goaway(self::getApp()->get_baseurl());
// NOTREACHED
}
@ -73,7 +76,7 @@ class Login extends BaseModule
$openid->returnUrl = self::getApp()->get_baseurl(true) . '/openid';
goaway($openid->authUrl());
} 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
}
@ -106,7 +109,7 @@ class Login extends BaseModule
if (!$record || !count($record)) {
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());
}