Hopefully all t()

hopefully the last of the t()
This commit is contained in:
Adam Magness 2018-01-22 16:59:31 -05:00
parent 83f1149d04
commit f0725ae384
27 changed files with 124 additions and 117 deletions

View file

@ -1,5 +1,4 @@
<?php
/** @file boot.php
*
* This file defines some global constants and includes the central App class.
@ -25,6 +24,7 @@ use Friendica\Core\Addon;
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;
@ -781,7 +781,7 @@ function run_update_function($x)
//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 {

View file

@ -55,7 +55,7 @@ class dba {
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;

View file

@ -96,10 +96,10 @@ function notification($params)
}
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']);
@ -139,14 +139,14 @@ function notification($params)
$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'],
@ -155,7 +155,7 @@ function notification($params)
// "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);
@ -166,9 +166,9 @@ function notification($params)
// 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.');
@ -178,10 +178,10 @@ function notification($params)
}
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']);
@ -192,10 +192,10 @@ function notification($params)
}
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']);
@ -206,10 +206,10 @@ function notification($params)
}
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']);
@ -220,10 +220,10 @@ function notification($params)
}
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']);
@ -238,10 +238,10 @@ function notification($params)
}
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);
@ -252,14 +252,14 @@ function notification($params)
}
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);
@ -269,19 +269,19 @@ function notification($params)
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;
@ -292,17 +292,17 @@ function notification($params)
}
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);
@ -312,10 +312,10 @@ function notification($params)
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]');
@ -326,16 +326,16 @@ function notification($params)
$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);
@ -347,14 +347,14 @@ function notification($params)
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.');

View file

@ -256,7 +256,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
$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.

View file

@ -117,7 +117,7 @@ function dfrn_poll_init(App $a)
$_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.
@ -537,7 +537,7 @@ function dfrn_poll_content(App $a)
$_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.

View file

@ -156,7 +156,7 @@ function dfrn_request_post(App $a)
}
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",
@ -242,7 +242,7 @@ function dfrn_request_post(App $a)
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;
@ -313,7 +313,7 @@ function dfrn_request_post(App $a)
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];
@ -433,7 +433,7 @@ function dfrn_request_post(App $a)
// 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.
@ -487,7 +487,7 @@ function dfrn_request_content(App $a)
// 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();
}
@ -524,8 +524,8 @@ function dfrn_request_content(App $a)
'$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'],
@ -647,13 +647,13 @@ function dfrn_request_content(App $a)
'$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'),

View file

@ -150,7 +150,7 @@ function directory_content(App $a) {
$location_e = $location;
$photo_menu = [
'profile' => [t("View Profile"), Profile::zrl($profile_link)]
'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
];
$entry = [

View file

@ -216,8 +216,8 @@ function dirfind_content(App $a, $prefix = "") {
$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]
];
}

View file

@ -555,7 +555,7 @@ function events_content(App $a) {
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');

View file

@ -4,6 +4,7 @@ This file is part of the Diaspora protocol. It is used for fetching single publi
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Protocol\Diaspora;
use Friendica\Util\XML;
@ -12,7 +13,7 @@ function fetch_init(App $a)
{
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();
}
@ -48,7 +49,7 @@ function fetch_init(App $a)
}
}
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
@ -61,7 +62,7 @@ function fetch_init(App $a)
);
if (!$r) {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
$user = $r[0];

View file

@ -41,7 +41,7 @@ function follow_post(App $a) {
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);
@ -149,7 +149,7 @@ function follow_content(App $a) {
//'$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' => "",

View file

@ -83,7 +83,7 @@ function friendica_content(App $a)
$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');

View file

@ -99,7 +99,7 @@ function fsuggest_content(App $a)
$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" >';

View file

@ -33,7 +33,7 @@ function group_post(App $a) {
$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);
@ -67,7 +67,7 @@ function group_post(App $a) {
);
if ($r) {
info(t('Group name changed.') . EOL);
info(L10n::t('Group name changed.') . EOL);
}
}
@ -124,7 +124,7 @@ function group_content(App $a) {
}
if ($result) {
info(t('Group removed.') . EOL);
info(L10n::t('Group removed.') . EOL);
} else {
notice(L10n::t('Unable to remove group.') . EOL);
}

View file

@ -546,9 +546,9 @@ function what_next() {
$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>";
}

View file

@ -272,7 +272,7 @@ function item_post(App $a) {
if ($preview) {
killme();
}
info(t('Empty post discarded.') . EOL);
info(L10n::t('Empty post discarded.') . EOL);
if (x($_REQUEST, 'return')) {
goaway($return_path);
}
@ -800,14 +800,14 @@ function item_post(App $a) {
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);

View file

@ -17,7 +17,7 @@ function ostatus_subscribe_content(App $a) {
// NOTREACHED
}
$o = "<h2>".t("Subscribing to OStatus contacts")."</h2>";
$o = "<h2>".L10n::t("Subscribing to OStatus contacts")."</h2>";
$uid = local_user();
@ -28,13 +28,13 @@ function ostatus_subscribe_content(App $a) {
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/";
@ -43,7 +43,7 @@ function ostatus_subscribe_content(App $a) {
$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"]);
@ -71,17 +71,17 @@ function ostatus_subscribe_content(App $a) {
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.'">';

View file

@ -4,20 +4,21 @@ This file is part of the Diaspora protocol. It is used for fetching single publi
*/
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();
}
@ -44,7 +45,7 @@ function p_init($a){
}
}
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
@ -53,7 +54,7 @@ function p_init($a){
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];

View file

@ -65,7 +65,7 @@ function user_allow($hash)
L10n::popLang();
if ($res) {
info(t('Account approved.') . EOL);
info(L10n::t('Account approved.') . EOL);
return true;
}
}
@ -90,7 +90,7 @@ function user_deny($hash)
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;
}
@ -99,7 +99,7 @@ function regmod_content(App $a)
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;
}

View file

@ -15,7 +15,7 @@ function repair_ostatus_content(App $a) {
// NOTREACHED
}
$o = "<h2>".t("Resubscribing to OStatus contacts")."</h2>";
$o = "<h2>".L10n::t("Resubscribing to OStatus contacts")."</h2>";
$uid = local_user();
@ -31,7 +31,7 @@ function repair_ostatus_content(App $a) {
intval(CONTACT_IS_SHARING));
if (!$r)
return($o.t("Error"));
return($o.L10n::t("Error"));
$total = $r[0]["total"];
@ -51,7 +51,7 @@ function repair_ostatus_content(App $a) {
$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);

View file

@ -3,9 +3,10 @@
// 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");
@ -23,7 +24,7 @@ function update_community_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";

View file

@ -6,6 +6,7 @@
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
require_once("mod/notes.php");
@ -36,7 +37,7 @@ function update_notes_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";

View file

@ -6,9 +6,10 @@
*/
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) {
@ -35,7 +36,7 @@ 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";

View file

@ -120,7 +120,7 @@ class UserImport
}
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;
}
@ -133,7 +133,7 @@ class UserImport
}
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;
}
@ -187,7 +187,7 @@ class UserImport
$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;
}
@ -296,7 +296,7 @@ class UserImport
// 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");
}
}

View file

@ -7,6 +7,7 @@ namespace Friendica\Model;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -235,7 +236,7 @@ class Photo
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
@ -244,7 +245,7 @@ class Photo
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);

View file

@ -12,6 +12,7 @@ use Friendica\App;
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;
@ -1393,8 +1394,8 @@ class DFRN
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`)

View file

@ -106,7 +106,7 @@ function frio_form($arr) {
}
}
$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 = [