Hopefully all t()

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

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";