<?php
-
/** @file boot.php
*
* This file defines some global constants and includes the central App class.
use Friendica\Core\System;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendida\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
//send the administrator an e-mail
DBStructure::updateFail(
$x,
- sprintf(t('Update %s failed. See error logs.'), $x)
+ sprintf(L10n::t('Update %s failed. See error logs.'), $x)
);
return false;
} else {
if ($install) {
if (strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) {
if (! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) {
- self::$error = sprintf(t('Cannot locate DNS info for database server \'%s\''), $server);
+ self::$error = sprintf(L10n::t('Cannot locate DNS info for database server \'%s\''), $server);
self::$connected = false;
self::$db = null;
return false;
}
if ($params['type'] == NOTIFY_MAIL) {
- $subject = sprintf(t('[Friendica:Notify] New mail received at %s'), $sitename);
+ $subject = sprintf(L10n::t('[Friendica:Notify] New mail received at %s'), $sitename);
- $preamble = sprintf(t('%1$s sent you a new private message at %2$s.'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s sent you %2$s.'), '[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url=$itemlink]'.t('a private message').'[/url]');
+ $preamble = sprintf(L10n::t('%1$s sent you a new private message at %2$s.'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s sent you %2$s.'), '[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url=$itemlink]'.L10n::t('a private message').'[/url]');
$sitelink = L10n::t('Please visit %s to view and/or reply to your private messages.');
$tsitelink = sprintf($sitelink, $siteurl.'/message/'.$params['item']['id']);
$item_post_type = item_post_type($item);
// "a post"
- $dest_str = sprintf(t('%1$s commented on [url=%2$s]a %3$s[/url]'),
+ $dest_str = sprintf(L10n::t('%1$s commented on [url=%2$s]a %3$s[/url]'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink,
$item_post_type);
// "George Bull's post"
if ($item) {
- $dest_str = sprintf(t('%1$s commented on [url=%2$s]%3$s\'s %4$s[/url]'),
+ $dest_str = sprintf(L10n::t('%1$s commented on [url=%2$s]%3$s\'s %4$s[/url]'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink,
$item['author-name'],
// "your post"
if (DBM::is_result($item) && $item['owner-name'] == $item['author-name'] && $item['wall']) {
- $dest_str = sprintf(t('%1$s commented on [url=%2$s]your %3$s[/url]'),
+ $dest_str = sprintf(L10n::t('%1$s commented on [url=%2$s]your %3$s[/url]'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink,
$item_post_type);
// Before this we have the name of the replier on the subject rendering
// differents subjects for messages on the same thread.
- $subject = sprintf(t('[Friendica:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $params['source_name']);
+ $subject = sprintf(L10n::t('[Friendica:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $params['source_name']);
- $preamble = sprintf(t('%s commented on an item/conversation you have been following.'), $params['source_name']);
+ $preamble = sprintf(L10n::t('%s commented on an item/conversation you have been following.'), $params['source_name']);
$epreamble = $dest_str;
$sitelink = L10n::t('Please visit %s to view and/or reply to the conversation.');
}
if ($params['type'] == NOTIFY_WALL) {
- $subject = sprintf(t('[Friendica:Notify] %s posted to your profile wall'), $params['source_name']);
+ $subject = sprintf(L10n::t('[Friendica:Notify] %s posted to your profile wall'), $params['source_name']);
- $preamble = sprintf(t('%1$s posted to your profile wall at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s posted to [url=%2$s]your wall[/url]'),
+ $preamble = sprintf(L10n::t('%1$s posted to your profile wall at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s posted to [url=%2$s]your wall[/url]'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']);
}
if ($params['type'] == NOTIFY_TAGSELF) {
- $subject = sprintf(t('[Friendica:Notify] %s tagged you'), $params['source_name']);
+ $subject = sprintf(L10n::t('[Friendica:Notify] %s tagged you'), $params['source_name']);
- $preamble = sprintf(t('%1$s tagged you at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s [url=%2$s]tagged you[/url].'),
+ $preamble = sprintf(L10n::t('%1$s tagged you at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s [url=%2$s]tagged you[/url].'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']);
}
if ($params['type'] == NOTIFY_SHARE) {
- $subject = sprintf(t('[Friendica:Notify] %s shared a new post'), $params['source_name']);
+ $subject = sprintf(L10n::t('[Friendica:Notify] %s shared a new post'), $params['source_name']);
- $preamble = sprintf(t('%1$s shared a new post at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s [url=%2$s]shared a post[/url].'),
+ $preamble = sprintf(L10n::t('%1$s shared a new post at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s [url=%2$s]shared a post[/url].'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']);
}
if ($params['type'] == NOTIFY_POKE) {
- $subject = sprintf(t('[Friendica:Notify] %1$s poked you'), $params['source_name']);
+ $subject = sprintf(L10n::t('[Friendica:Notify] %1$s poked you'), $params['source_name']);
- $preamble = sprintf(t('%1$s poked you at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s [url=%2$s]poked you[/url].'),
+ $preamble = sprintf(L10n::t('%1$s poked you at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s [url=%2$s]poked you[/url].'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$params['link']);
}
if ($params['type'] == NOTIFY_TAGSHARE) {
- $subject = sprintf(t('[Friendica:Notify] %s tagged your post'), $params['source_name']);
+ $subject = sprintf(L10n::t('[Friendica:Notify] %s tagged your post'), $params['source_name']);
- $preamble = sprintf(t('%1$s tagged your post at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s tagged [url=%2$s]your post[/url]'),
+ $preamble = sprintf(L10n::t('%1$s tagged your post at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s tagged [url=%2$s]your post[/url]'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink);
}
if ($params['type'] == NOTIFY_INTRO) {
- $subject = sprintf(t('[Friendica:Notify] Introduction received'));
+ $subject = sprintf(L10n::t('[Friendica:Notify] Introduction received'));
- $preamble = sprintf(t('You\'ve received an introduction from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('You\'ve received [url=%1$s]an introduction[/url] from %2$s.'),
+ $preamble = sprintf(L10n::t('You\'ve received an introduction from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('You\'ve received [url=%1$s]an introduction[/url] from %2$s.'),
$itemlink,
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
- $body = sprintf(t('You may visit their profile at %s'), $params['source_link']);
+ $body = sprintf(L10n::t('You may visit their profile at %s'), $params['source_link']);
$sitelink = L10n::t('Please visit %s to approve or reject the introduction.');
$tsitelink = sprintf($sitelink, $siteurl);
switch ($params['verb']) {
case ACTIVITY_FRIEND:
// someone started to share with user (mostly OStatus)
- $subject = sprintf(t('[Friendica:Notify] A new person is sharing with you'));
+ $subject = sprintf(L10n::t('[Friendica:Notify] A new person is sharing with you'));
- $preamble = sprintf(t('%1$s is sharing with you at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%1$s is sharing with you at %2$s'),
+ $preamble = sprintf(L10n::t('%1$s is sharing with you at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%1$s is sharing with you at %2$s'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$sitename);
break;
case ACTIVITY_FOLLOW:
// someone started to follow the user (mostly OStatus)
- $subject = sprintf(t('[Friendica:Notify] You have a new follower'));
+ $subject = sprintf(L10n::t('[Friendica:Notify] You have a new follower'));
- $preamble = sprintf(t('You have a new follower at %2$s : %1$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('You have a new follower at %2$s : %1$s'),
+ $preamble = sprintf(L10n::t('You have a new follower at %2$s : %1$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('You have a new follower at %2$s : %1$s'),
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$sitename);
break;
}
if ($params['type'] == NOTIFY_SUGGEST) {
- $subject = sprintf(t('[Friendica:Notify] Friend suggestion received'));
+ $subject = sprintf(L10n::t('[Friendica:Notify] Friend suggestion received'));
- $preamble = sprintf(t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('You\'ve received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s.'),
+ $preamble = sprintf(L10n::t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('You\'ve received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s.'),
$itemlink,
'[url='.$params['item']['url'].']'.$params['item']['name'].'[/url]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
$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']);
+ $body .= sprintf(L10n::t('You may visit their profile at %s'), $params['item']['url']);
$sitelink = L10n::t('Please visit %s to approve or reject the suggestion.');
$tsitelink = sprintf($sitelink, $siteurl);
if ($params['type'] == NOTIFY_CONFIRM) {
if ($params['verb'] == ACTIVITY_FRIEND) { // mutual connection
- $subject = sprintf(t('[Friendica:Notify] Connection accepted'));
+ $subject = sprintf(L10n::t('[Friendica:Notify] Connection accepted'));
- $preamble = sprintf(t('\'%1$s\' has accepted your connection request at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%2$s has accepted your [url=%1$s]connection request[/url].'),
+ $preamble = sprintf(L10n::t('\'%1$s\' has accepted your connection request at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%2$s has accepted your [url=%1$s]connection request[/url].'),
$itemlink,
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'">'.$sitename.'</a>');
$itemlink = $params['link'];
} else { // ACTIVITY_FOLLOW
- $subject = sprintf(t('[Friendica:Notify] Connection accepted'));
+ $subject = sprintf(L10n::t('[Friendica:Notify] Connection accepted'));
- $preamble = sprintf(t('\'%1$s\' has accepted your connection request at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('%2$s has accepted your [url=%1$s]connection request[/url].'),
+ $preamble = sprintf(L10n::t('\'%1$s\' has accepted your connection request at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('%2$s has accepted your [url=%1$s]connection request[/url].'),
$itemlink,
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
- $body = sprintf(t('\'%1$s\' has chosen to accept you a "fan", which restricts some forms of communication - such as private messaging and some profile interactions. If this is a celebrity or community page, these settings were applied automatically.'), $params['source_name']);
+ $body = sprintf(L10n::t('\'%1$s\' has chosen to accept you a "fan", which restricts some forms of communication - such as private messaging and some profile interactions. If this is a celebrity or community page, these settings were applied automatically.'), $params['source_name']);
$body .= "\n\n";
- $body .= sprintf(t('\'%1$s\' may choose to extend this into a two-way or more permissive relationship in the future.'), $params['source_name']);
+ $body .= sprintf(L10n::t('\'%1$s\' may choose to extend this into a two-way or more permissive relationship in the future.'), $params['source_name']);
$sitelink = L10n::t('Please visit %s if you wish to make any changes to this relationship.');
$tsitelink = sprintf($sitelink, $siteurl);
if ($params['type'] == NOTIFY_SYSTEM) {
switch($params['event']) {
case "SYSTEM_REGISTER_REQUEST":
- $subject = sprintf(t('[Friendica System:Notify] registration request'));
+ $subject = sprintf(L10n::t('[Friendica System:Notify] registration request'));
- $preamble = sprintf(t('You\'ve received a registration request from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
- $epreamble = sprintf(t('You\'ve received a [url=%1$s]registration request[/url] from %2$s.'),
+ $preamble = sprintf(L10n::t('You\'ve received a registration request from \'%1$s\' at %2$s'), $params['source_name'], $sitename);
+ $epreamble = sprintf(L10n::t('You\'ve received a [url=%1$s]registration request[/url] from %2$s.'),
$itemlink,
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
- $body = sprintf(t('Full Name: %1$s\nSite Location: %2$s\nLogin Name: %3$s (%4$s)'),
+ $body = sprintf(L10n::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 = L10n::t('Please visit %s to approve or reject the request.');
$message = unxmlify($xml->message); // human readable text of what may have gone wrong.
switch ($status) {
case 0:
- info(t("Confirmation completed successfully.") . EOL);
+ info(L10n::t("Confirmation completed successfully.") . EOL);
break;
case 1:
// birthday paradox - generate new dfrn-id and fall through.
$_SESSION['visitor_handle'] = $r[0]['addr'];
$_SESSION['visitor_visiting'] = $r[0]['uid'];
if (!$quiet) {
- info(sprintf(t('%1$s welcomes %2$s'), $r[0]['username'], $r[0]['name']) . EOL);
+ info(sprintf(L10n::t('%1$s welcomes %2$s'), $r[0]['username'], $r[0]['name']) . EOL);
}
// Visitors get 1 day session.
$_SESSION['visitor_home'] = $r[0]['url'];
$_SESSION['visitor_visiting'] = $r[0]['uid'];
if (!$quiet) {
- info(sprintf(t('%1$s welcomes %2$s'), $r[0]['username'], $r[0]['name']) . EOL);
+ info(sprintf(L10n::t('%1$s welcomes %2$s'), $r[0]['username'], $r[0]['name']) . EOL);
}
// Visitors get 1 day session.
}
if ($r) {
- info(t("Introduction complete.") . EOL);
+ info(L10n::t("Introduction complete.") . EOL);
}
$r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `site-pubkey` = '%s' LIMIT 1",
intval($uid)
);
if (DBM::is_result($r) && count($r) > $maxreq) {
- notice(sprintf(t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
+ notice(sprintf(L10n::t('%s has received too many connection requests today.'), $a->profile['name']) . 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;
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);
+ notice(sprintf(L10n::t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL);
return;
} else {
$contact_record = $ret[0];
// This notice will only be seen by the requestor if the requestor and requestee are on the same server.
if (!$failed) {
- info(t('Your introduction has been sent.') . EOL);
+ info(L10n::t('Your introduction has been sent.') . EOL);
}
// "Homecoming" - send the requestor back to their site to record the introduction.
// to send us to the post section to record the introduction.
if (x($_GET, 'dfrn_url')) {
if (!local_user()) {
- info(t("Please login to confirm introduction.") . EOL);
+ info(L10n::t("Please login to confirm introduction.") . EOL);
/* setup the return URL to come back to this page if they use openid */
return Login::form();
}
'$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),
+ '$welcome' => sprintf(L10n::t('Welcome home %s.'), $a->user['username']),
+ '$please' => sprintf(L10n::t('Please confirm your introduction/connection request to %s.'), $dfrn_url),
'$submit' => L10n::t('Confirm'),
'$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'],
'$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')]],
+ '$does_know_you' => ['knowyou', sprintf(L10n::t('Does %s know you?'), $a->profile['name']), false, '', [L10n::t('No'), L10n::t('Yes')]],
'$add_note' => L10n::t('Add a personal note:'),
'$page_desc' => $page_desc,
'$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),
+ '$diasnote' => sprintf(L10n::t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.'), $target_addr),
'$your_address' => L10n::t('Your Identity Address:'),
'$invite_desc' => $invite_desc,
'$submit' => L10n::t('Submit Request'),
$location_e = $location;
$photo_menu = [
- 'profile' => [t("View Profile"), Profile::zrl($profile_link)]
+ 'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
];
$entry = [
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = L10n::t('Connect');
$photo_menu = [
- 'profile' => [t("View Profile"), Profile::zrl($jj->url)],
- 'follow' => [t("Connect/Follow"), $connlnk]
+ 'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
+ 'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
}
if ($del == 0) {
notice(L10n::t('Failed to remove event') . EOL);
} else {
- info(t('Event removed') . EOL);
+ info(L10n::t('Event removed') . EOL);
}
goaway(System::baseUrl() . '/events');
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Protocol\Diaspora;
use Friendica\Util\XML;
{
if (($a->argc != 3) || (!in_array($a->argv[1], ["post", "status_message", "reshare"]))) {
- header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
}
}
- header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
);
if (!$r) {
- header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
$user = $r[0];
goaway(System::baseUrl().'/contacts/'.$result['cid']);
}
- info(t('Contact added').EOL);
+ info(L10n::t('Contact added').EOL);
if (strstr($return_url, 'contacts')) {
goaway(System::baseUrl().'/contacts/'.$contact_id);
//'$photo' => proxy_url($ret["photo"], false, PROXY_SIZE_SMALL),
'$desc' => "",
'$pls_answer' => L10n::t('Please answer the following:'),
- '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', [L10n::t('No'), L10n::t('Yes')]],
+ '$does_know_you' => ['knowyou', sprintf(L10n::t('Does %s know you?'),$ret["name"]), false, '', [L10n::t('No'), L10n::t('Yes')]],
'$add_note' => L10n::t('Add a personal note:'),
'$page_desc' => "",
'$friendica' => "",
$o .= '</p>' . PHP_EOL;
$o .= '<p>';
- $o .= L10n::t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a>';
+ $o .= L10n::t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.L10n::t('the bugtracker at github').'</a>';
$o .= '</p>' . PHP_EOL;
$o .= '<p>';
$o .= L10n::t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
$o = '<h3>' . L10n::t('Suggest Friends') . '</h3>';
- $o .= '<div id="fsuggest-desc" >' . sprintf(t('Suggest a friend for %s'), $contact['name']) . '</div>';
+ $o .= '<div id="fsuggest-desc" >' . sprintf(L10n::t('Suggest a friend for %s'), $contact['name']) . '</div>';
$o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
$name = notags(trim($_POST['groupname']));
$r = Group::create(local_user(), $name);
if ($r) {
- info(t('Group created.') . EOL);
+ info(L10n::t('Group created.') . EOL);
$r = Group::getIdByName(local_user(), $name);
if ($r) {
goaway(System::baseUrl() . '/group/' . $r);
);
if ($r) {
- info(t('Group name changed.') . EOL);
+ info(L10n::t('Group name changed.') . EOL);
}
}
}
if ($result) {
- info(t('Group removed.') . EOL);
+ info(L10n::t('Group removed.') . EOL);
} else {
notice(L10n::t('Unable to remove group.') . EOL);
}
$baseurl = System::baseUrl();
return
t('<h1>What next</h1>')
- ."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
- .t('Please see the file "INSTALL.txt".')
+ ."<p>".L10n::t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
+ .L10n::t('Please see the file "INSTALL.txt".')
."</p><p>"
- .t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
+ .L10n::t("Go to your new Friendica node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
."</p>";
}
if ($preview) {
killme();
}
- info(t('Empty post discarded.') . EOL);
+ info(L10n::t('Empty post discarded.') . EOL);
if (x($_REQUEST, 'return')) {
goaway($return_path);
}
if (!strlen($addr)) {
continue;
}
- $disclaimer = '<hr />' . sprintf(t('This message was sent to you by %s, a member of the Friendica social network.'), $a->user['username'])
+ $disclaimer = '<hr />' . sprintf(L10n::t('This message was sent to you by %s, a member of the Friendica social network.'), $a->user['username'])
. '<br />';
- $disclaimer .= sprintf(t('You may visit them online at %s'), System::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
+ $disclaimer .= sprintf(L10n::t('You may visit them online at %s'), System::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
$disclaimer .= L10n::t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
if (!$datarray['title']=='') {
$subject = Email::encodeHeader($datarray['title'], 'UTF-8');
} else {
- $subject = Email::encodeHeader('[Friendica]' . ' ' . sprintf(t('%s posted an update.'), $a->user['username']), 'UTF-8');
+ $subject = Email::encodeHeader('[Friendica]' . ' ' . sprintf(L10n::t('%s posted an update.'), $a->user['username']), 'UTF-8');
}
$link = '<a href="' . System::baseUrl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
$html = prepare_body($datarray);
// NOTREACHED
}
- $o = "<h2>".t("Subscribing to OStatus contacts")."</h2>";
+ $o = "<h2>".L10n::t("Subscribing to OStatus contacts")."</h2>";
$uid = local_user();
if (PConfig::get($uid, "ostatus", "legacy_friends") == "") {
if ($_REQUEST["url"] == "") {
- return $o.t("No contact provided.");
+ return $o.L10n::t("No contact provided.");
}
$contact = Probe::uri($_REQUEST["url"]);
if (!$contact) {
- return $o.t("Couldn't fetch information for contact.");
+ return $o.L10n::t("Couldn't fetch information for contact.");
}
$api = $contact["baseurl"]."/api/";
$data = z_fetch_url($api."statuses/friends.json?screen_name=".$contact["nick"]);
if (!$data["success"]) {
- return $o.t("Couldn't fetch friends for contact.");
+ return $o.L10n::t("Couldn't fetch friends for contact.");
}
PConfig::set($uid, "ostatus", "legacy_friends", $data["body"]);
if ($data["network"] == NETWORK_OSTATUS) {
$result = Contact::createFromProbe($uid, $url, true, NETWORK_OSTATUS);
if ($result["success"]) {
- $o .= " - ".t("success");
+ $o .= " - ".L10n::t("success");
} else {
- $o .= " - ".t("failed");
+ $o .= " - ".L10n::t("failed");
}
} else {
- $o .= " - ".t("ignored");
+ $o .= " - ".L10n::t("ignored");
}
$o .= "</p>";
- $o .= "<p>".t("Keep this window open until done.")."</p>";
+ $o .= "<p>".L10n::t("Keep this window open until done.")."</p>";
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.System::baseUrl().'/ostatus_subscribe?counter='.$counter.'">';
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
function p_init($a){
if ($a->argc != 2) {
- header($_SERVER["SERVER_PROTOCOL"].' 510 '.t('Not Extended'));
+ header($_SERVER["SERVER_PROTOCOL"].' 510 '.L10n::t('Not Extended'));
killme();
}
$guid = $a->argv[1];
if (strtolower(substr($guid, -4)) != ".xml") {
- header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
}
}
- header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
WHERE `user`.`uid` = %d", intval($item[0]["uid"]));
if (!DBM::is_result($r)) {
- header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
$user = $r[0];
L10n::popLang();
if ($res) {
- info(t('Account approved.') . EOL);
+ info(L10n::t('Account approved.') . EOL);
return true;
}
}
dba::delete('user', ['uid' => $register[0]['uid']]);
dba::delete('register', ['hash' => $register[0]['hash']]);
- notice(sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
+ notice(sprintf(L10n::t('Registration revoked for %s'), $user[0]['username']) . EOL);
return true;
}
global $lang;
if (!local_user()) {
- info(t('Please login.') . EOL);
+ info(L10n::t('Please login.') . EOL);
$o .= '<br /><br />' . Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
return $o;
}
// NOTREACHED
}
- $o = "<h2>".t("Resubscribing to OStatus contacts")."</h2>";
+ $o = "<h2>".L10n::t("Resubscribing to OStatus contacts")."</h2>";
$uid = local_user();
intval(CONTACT_IS_SHARING));
if (!$r)
- return($o.t("Error"));
+ return($o.L10n::t("Error"));
$total = $r[0]["total"];
$o .= "<p>".$counter."/".$total.": ".$r[0]["url"]."</p>";
- $o .= "<p>".t("Keep this window open until done.")."</p>";
+ $o .= "<p>".L10n::t("Keep this window open until done.")."</p>";
$result = Contact::createFromProbe($uid, $r[0]["url"], true);
// See update_profile.php for documentation
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
-require_once("mod/community.php");
+require_once 'mod/community.php';
function update_community_content(App $a) {
header("Content-type: text/html");
$text = preg_replace($pattern, $replace, $text);
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
- $replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
+ $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
require_once("mod/notes.php");
$text = preg_replace($pattern, $replace, $text);
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
- $replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
+ $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
-require_once("mod/profile.php");
+require_once 'mod/profile.php';
function update_profile_content(App $a) {
$text = preg_replace($pattern, $replace, $text);
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
- $replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
+ $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
}
if (DBM::is_result($r) > 0) {
- notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));
+ notice(sprintf(L10n::t("User '%s' already exists on this server!"), $account['user']['nickname']));
return;
}
}
if (DBM::is_result($r) > 0) {
- notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));
+ notice(sprintf(L10n::t("User '%s' already exists on this server!"), $account['user']['nickname']));
return;
}
$r = self::dbImportAssoc('profile', $profile);
if ($r === false) {
logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
- info(t("User profile creation error"));
+ info(L10n::t("User profile creation error"));
dba::delete('user', ['uid' => $newuid]);
return;
}
// send relocate messages
Worker::add(PRIORITY_HIGH, 'Notifier', 'relocate', $newuid);
- info(t("Done. You can now login with your username and password"));
+ info(L10n::t("Done. You can now login with your username and password"));
goaway(System::baseUrl() . "/login");
}
}
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
GROUP BY `album` ORDER BY `created` DESC",
intval($uid),
dbesc('Contact Photos'),
- dbesc(t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
} else {
// This query doesn't do the count and is much faster
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra",
intval($uid),
dbesc('Contact Photos'),
- dbesc(t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
}
Cache::set($key, $albums, CACHE_DAY);
use Friendica\Content\OEmbed;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
logger("updating birthday: ".$birthday." for contact ".$contact["id"]);
- $bdtext = sprintf(t("%s\'s birthday"), $contact["name"]);
- $bdtext2 = sprintf(t("Happy Birthday %s"), " [url=".$contact["url"]."]".$contact["name"]."[/url]");
+ $bdtext = sprintf(L10n::t("%s\'s birthday"), $contact["name"]);
+ $bdtext2 = sprintf(L10n::t("Happy Birthday %s"), " [url=".$contact["url"]."]".$contact["name"]."[/url]");
$r = q(
"INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`)
}
}
- $background_image_help = "<strong>" . L10n::t("Note"). ": </strong>".t("Check image permissions if all users are allowed to visit the image");
+ $background_image_help = "<strong>" . L10n::t("Note"). ": </strong>".L10n::t("Check image permissions if all users are allowed to visit the image");
$t = get_markup_template('theme_settings.tpl');
$ctx = [