<?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;
require_once 'include/network.php';
require_once 'include/text.php';
require_once 'include/datetime.php';
-require_once 'include/pgettext.php';
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Asparagus');
//send the administrator an e-mail
DBStructure::updateFail(
$x,
- sprintf(t('Update %s failed. See error logs.'), $x)
+ L10n::t('Update %s failed. See error logs.', $x)
);
return false;
} else {
All of these take an array holding the values, e.g. for a one line text input field, which is required and should be used to type email addesses use something along the lines of:
- '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
+ '$adminmail' => array('adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
To evaluate the input value, you can then use the $_POST array, more precisely the $_POST['adminemail'] variable.
To make your own variation appear in the menu, all you need to do is to create a new CSS file in the deriv directoy and include it in the array in the config.php:
$colorset = array(
- 'default'=>t('default'),
- 'greenzero'=>t('greenzero'),
- 'purplezero'=>t('purplezero'),
- 'easterbunny'=>t('easterbunny'),
- 'darkzero'=>t('darkzero'),
- 'comix'=>t('comix'),
- 'slackr'=>t('slackr'),
+ 'default'=>L10n::t('default'),
+ 'greenzero'=>L10n::t('greenzero'),
+ 'purplezero'=>L10n::t('purplezero'),
+ 'easterbunny'=>L10n::t('easterbunny'),
+ 'darkzero'=>L10n::t('darkzero'),
+ 'comix'=>L10n::t('comix'),
+ 'slackr'=>L10n::t('slackr'),
);
the 1st part of the line is the name of the CSS file (without the .css) the 2nd part is the common name of the variant.
-Calling the t() function with the common name makes the string translateable.
+Calling the L10n::t() function with the common name makes the string translateable.
The selected 1st part will be saved in the database by the theme_post function.
function theme_post(App $a){
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\GContact;
if (!$user['hidewall']) {
if ($mail_enabled) {
$selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
- $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . t("Post to Email") . '</div>';
+ $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . L10n::t("Post to Email") . '</div>';
}
Addon::callHooks('jot_networks', $jotnets);
} else {
- $jotnets .= sprintf(t('Connectors disabled, since "%s" is enabled.'),
- t('Hide your profile details from unknown viewers?'));
+ $jotnets .= L10n::t('Connectors disabled, since "%s" is enabled.', L10n::t('Hide your profile details from unknown viewers?'));
}
}
$tpl = get_markup_template("acl_selector.tpl");
$o = replace_macros($tpl, [
- '$showall'=> t("Visible to everybody"),
- '$show' => t("show"),
- '$hide' => t("don't show"),
+ '$showall'=> L10n::t("Visible to everybody"),
+ '$show' => L10n::t("show"),
+ '$hide' => L10n::t("don't show"),
'$allowcid' => json_encode($perms['allow_cid']),
'$allowgid' => json_encode($perms['allow_gid']),
'$denycid' => json_encode($perms['deny_cid']),
'$denygid' => json_encode($perms['deny_gid']),
'$networks' => $show_jotnets,
- '$emailcc' => t('CC: email addresses'),
- '$emtitle' => t('Example: bob@example.com, mary@example.com'),
+ '$emailcc' => L10n::t('CC: email addresses'),
+ '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
'$jotnets' => $jotnets,
- '$aclModalTitle' => t('Permissions'),
- '$aclModalDismiss' => t('Close'),
+ '$aclModalTitle' => L10n::t('Permissions'),
+ '$aclModalDismiss' => L10n::t('Close'),
'$features' => [
'aclautomention' => (Feature::isEnabled($user['uid'], "aclautomention") ? "true" : "false")
],
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\NotificationsManager;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
if ($posts_day > $throttle_day) {
logger('Daily posting limit reached for user '.api_user(), LOGGER_DEBUG);
- // die(api_error($type, sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day)));
- throw new TooManyRequestsException(sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day));
+ // die(api_error($type, L10n::t("Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
+ throw new TooManyRequestsException(L10n::tt("Daily posting limit of %d post reached. The post was rejected.", "Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
}
}
if ($posts_week > $throttle_week) {
logger('Weekly posting limit reached for user '.api_user(), LOGGER_DEBUG);
- // die(api_error($type, sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week)));
- throw new TooManyRequestsException(sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week));
+ // die(api_error($type, L10n::t("Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week)));
+ throw new TooManyRequestsException(L10n::tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week));
}
}
if ($posts_month > $throttle_month) {
logger('Monthly posting limit reached for user '.api_user(), LOGGER_DEBUG);
- // die(api_error($type, sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month)));
- throw new TooManyRequestsException(sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month));
+ // die(api_error($type, L10n::t("Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
+ throw new TooManyRequestsException(L10n::t("Monthly posting limit of %d post reached. The post was rejected.", "Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
}
}
$media = $_FILES['media'];
}
// save new profile image
- $data = save_media_to_database("profileimage", $media, $type, t('Profile Photos'), "", "", "", "", "", $is_default_profile);
+ $data = save_media_to_database("profileimage", $media, $type, L10n::t('Profile Photos'), "", "", "", "", "", $is_default_profile);
// get filetype
if (is_array($media['type'])) {
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
$o = 'Friendica event notification:' . "\n";
$o .= '**' . (($ev['summary']) ? bb2diaspora($ev['summary']) : bb2diaspora($ev['desc'])) . '**' . "\n";
- $o .= t('Starts:') . ' ' . '['
+ $o .= L10n::t('Starts:') . ' ' . '['
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
. '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
if (! $ev['nofinish']) {
- $o .= t('Finishes:') . ' ' . '['
+ $o .= L10n::t('Finishes:') . ' ' . '['
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
}
if (strlen($ev['location'])) {
- $o .= t('Location:') . bb2diaspora($ev['location'])
+ $o .= L10n::t('Location:') . bb2diaspora($ev['location'])
. "\n";
}
<?php
-
+/**
+ * @file include/bbcode.php
+ */
use Friendica\App;
use Friendica\Content\Smilies;
use Friendica\Content\OEmbed;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Model\Contact;
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
- $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img src="' . proxy_url($image) .'" alt="' . t('Image/photo') . '" />', $newbody);
+ $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img src="' . proxy_url($image) .'" alt="' . L10n::t('Image/photo') . '" />', $newbody);
$cnt++;
}
break;
case 4:
$headline .= '<br /><b>' . html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8');
- $headline .= t('<a href="%1$s" target="_blank">%2$s</a> %3$s', $link, $userid, $posted);
+ $headline .= L10n::t('<a href="%1$s" target="_blank">%2$s</a> %3$s', $link, $userid, $posted);
$headline .= ":</b><br />";
$text = trim($share[1]);
// Check for [spoiler=Author] text
- $t_wrote = t('$1 wrote:');
+ $t_wrote = L10n::t('$1 wrote:');
// handle nested quotes
$endlessloop = 0;
// Check for [quote=Author] text
- $t_wrote = t('$1 wrote:');
+ $t_wrote = L10n::t('$1 wrote:');
// handle nested quotes
$endlessloop = 0;
// [img]pathtoimage[/img]
$Text = preg_replace_callback("/\[img\](.*?)\[\/img\]/ism", 'bb_PictureCache', $Text);
- $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
- $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
+ $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . L10n::t('Image/photo') . '" />', $Text);
+ $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . L10n::t('Image/photo') . '" />', $Text);
// Shared content
$Text = preg_replace_callback("/(.*?)\[share(.*?)\](.*?)\[\/share\]/ism",
return bb_ShareAttributes($match, $simplehtml);
}, $Text);
- $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
- $Text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
- //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
+ $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . L10n::t('Encrypted content') . '" /><br />', $Text);
+ $Text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $Text);
+ //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $Text);
// Try to Oembed
if ($tryoembed) {
// sanitizes src attributes (http and redir URLs for displaying in a web page, cid used for inline images in emails)
static $allowed_src_protocols = ['http', 'redir', 'cid'];
$Text = preg_replace('#<([^>]*?)(src)="(?!' . implode('|', $allowed_src_protocols) . ')(.*?)"(.*?)>#ism',
- '<$1$2=""$4 data-original-src="$3" class="invalid-src" title="' . t('Invalid source protocol') . '">', $Text);
+ '<$1$2=""$4 data-original-src="$3" class="invalid-src" title="' . L10n::t('Invalid source protocol') . '">', $Text);
// sanitize href attributes (only whitelisted protocols URLs)
// default value for backward compatibility
$allowed_link_protocols[] = 'redir/';
$regex = '#<([^>]*?)(href)="(?!' . implode('|', $allowed_link_protocols) . ')(.*?)"(.*?)>#ism';
- $Text = preg_replace($regex, '<$1$2="javascript:void(0)"$4 data-original-href="$3" class="invalid-href" title="' . t('Invalid link protocol') . '">', $Text);
+ $Text = preg_replace($regex, '<$1$2="javascript:void(0)"$4 data-original-href="$3" class="invalid-href" title="' . L10n::t('Invalid link protocol') . '">', $Text);
if ($saved_image) {
$Text = bb_replace_images($Text, $saved_image);
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
case ACTIVITY_POST:
switch ($obj['object-type']) {
case ACTIVITY_OBJ_EVENT:
- $post_type = t('event');
+ $post_type = L10n::t('event');
break;
default:
- $post_type = t('status');
+ $post_type = L10n::t('status');
}
break;
default:
if ($obj['resource-id']) {
- $post_type = t('photo');
+ $post_type = L10n::t('photo');
$m = [];
preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
} else {
- $post_type = t('status');
+ $post_type = L10n::t('status');
}
}
$plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]';
if (activity_match($item['verb'], ACTIVITY_LIKE)) {
- $bodyverb = t('%1$s likes %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
}
elseif (activity_match($item['verb'], ACTIVITY_DISLIKE)) {
- $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');
}
elseif (activity_match($item['verb'], ACTIVITY_ATTEND)) {
- $bodyverb = t('%1$s attends %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s attends %2$s\'s %3$s');
}
elseif (activity_match($item['verb'], ACTIVITY_ATTENDNO)) {
- $bodyverb = t('%1$s doesn\'t attend %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s doesn\'t attend %2$s\'s %3$s');
}
elseif (activity_match($item['verb'], ACTIVITY_ATTENDMAYBE)) {
- $bodyverb = t('%1$s attends maybe %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s attends maybe %2$s\'s %3$s');
}
$item['body'] = sprintf($bodyverb, $author, $objauthor, $plink);
$Bphoto = '[url=' . Profile::zrl($Blink) . '][img]' . $Bphoto . '[/img][/url]';
}
- $item['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
+ $item['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B)."\n\n\n".$Bphoto;
}
if (stristr($item['verb'], ACTIVITY_POKE)) {
* we can't have a translation string with three positions but no distinguishable text
* So here is the translate string.
*/
- $txt = t('%1$s poked %2$s');
+ $txt = L10n::t('%1$s poked %2$s');
// now translate the verb
$poked_t = trim(sprintf($txt, "", ""));
- $txt = str_replace( $poked_t, t($verb), $txt);
+ $txt = str_replace( $poked_t, L10n::t($verb), $txt);
// then do the sprintf on the translation string
case ACTIVITY_POST:
switch ($obj['object-type']) {
case ACTIVITY_OBJ_EVENT:
- $post_type = t('event');
+ $post_type = L10n::t('event');
break;
default:
- $post_type = t('status');
+ $post_type = L10n::t('status');
}
break;
default:
if ($obj['resource-id']) {
- $post_type = t('photo');
+ $post_type = L10n::t('photo');
$m=[]; preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
} else {
- $post_type = t('status');
+ $post_type = L10n::t('status');
}
// Let's break everthing ... ;-)
break;
$parsedobj = parse_xml_string($xmlhead.$item['object']);
$tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content);
- $item['body'] = sprintf( t('%1$s tagged %2$s\'s %3$s with %4$s'), $author, $objauthor, $plink, $tag );
+ $item['body'] = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag );
}
if (activity_match($item['verb'], ACTIVITY_FAVORITE)) {
$Blink = $target['author-link'];
$A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
- $P = '[url=' . $target['plink'] . ']' . t('post/item') . '[/url]';
- $item['body'] = sprintf( t('%1$s marked %2$s\'s %3$s as favorite'), $A, $B, $P)."\n";
+ $P = '[url=' . $target['plink'] . ']' . L10n::t('post/item') . '[/url]';
+ $item['body'] = L10n::t('%1$s marked %2$s\'s %3$s as favorite', $A, $B, $P)."\n";
}
}
}
$items = $cb['items'];
$conv_responses = [
- 'like' => ['title' => t('Likes','title')], 'dislike' => ['title' => t('Dislikes','title')],
- 'attendyes' => ['title' => t('Attending','title')], 'attendno' => ['title' => t('Not attending','title')], 'attendmaybe' => ['title' => t('Might attend','title')]
+ 'like' => ['title' => L10n::t('Likes','title')], 'dislike' => ['title' => L10n::t('Dislikes','title')],
+ 'attendyes' => ['title' => L10n::t('Attending','title')], 'attendno' => ['title' => L10n::t('Not attending','title')], 'attendmaybe' => ['title' => L10n::t('Might attend','title')]
];
// array with html for each thread (parent+comments)
$drop = [
'dropping' => $dropping,
'pagedrop' => $page_dropping,
- 'select' => t('Select'),
- 'delete' => t('Delete'),
+ 'select' => L10n::t('Select'),
+ 'delete' => L10n::t('Delete'),
];
$star = false;
'guid' => (($preview) ? 'Q0' : $item['guid']),
'network' => $item['item_network'],
'network_name' => ContactSelector::networkToName($item['item_network'], $profile_link),
- 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
+ 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $profile_name_e,
'tags' => $tags_e,
'hashtags' => $hashtags_e,
'mentions' => $mentions_e,
- 'txt_cats' => t('Categories:'),
- 'txt_folders' => t('Filed under:'),
+ 'txt_cats' => L10n::t('Categories:'),
+ 'txt_folders' => L10n::t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
'has_folders' => ((count($folders)) ? 'true' : ''),
'categories' => $categories,
'folders' => $folders,
'text' => strip_tags($body_e),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
- 'ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])),
+ 'ago' => (($item['app']) ? L10n::t('%s from %s', relative_date($item['created']),$item['app']) : relative_date($item['created'])),
'location' => $location_e,
'indent' => '',
'owner_name' => $owner_name_e,
'like' => '',
'dislike' => '',
'comment' => '',
- 'conv' => (($preview) ? '' : ['href'=> 'display/'.$item['guid'], 'title'=> t('View in context')]),
+ 'conv' => (($preview) ? '' : ['href'=> 'display/'.$item['guid'], 'title'=> L10n::t('View in context')]),
'previewing' => $previewing,
- 'wait' => t('Please wait'),
+ 'wait' => L10n::t('Please wait'),
'thread_level' => 1,
];
'$baseurl' => System::baseUrl($ssl_state),
'$return_path' => $a->query_string,
'$live_update' => $live_update_div,
- '$remove' => t('remove'),
+ '$remove' => L10n::t('remove'),
'$mode' => $mode,
'$user' => $a->user,
'$threads' => $threads,
- '$dropping' => ($page_dropping && Feature::isEnabled(local_user(), 'multi_delete') ? t('Delete Selected Items') : False),
+ '$dropping' => ($page_dropping && Feature::isEnabled(local_user(), 'multi_delete') ? L10n::t('Delete Selected Items') : False),
]);
return $o;
if (local_user()) {
$menu = [
- t('Follow Thread') => $sub_link,
- t('View Status') => $status_link,
- t('View Profile') => $profile_link,
- t('View Photos') => $photos_link,
- t('Network Posts') => $posts_link,
- t('View Contact') => $contact_url,
- t('Send PM') => $pm_url
+ L10n::t('Follow Thread') => $sub_link,
+ L10n::t('View Status') => $status_link,
+ L10n::t('View Profile') => $profile_link,
+ L10n::t('View Photos') => $photos_link,
+ L10n::t('Network Posts') => $posts_link,
+ L10n::t('View Contact') => $contact_url,
+ L10n::t('Send PM') => $pm_url
];
if ($network == NETWORK_DFRN) {
- $menu[t("Poke")] = $poke_link;
+ $menu[L10n::t("Poke")] = $poke_link;
}
if ((($cid == 0) || ($rel == CONTACT_IS_FOLLOWER)) &&
in_array($item['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA])) {
- $menu[t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
+ $menu[L10n::t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
}
} else {
- $menu = [t('View Profile') => $item['author-link']];
+ $menu = [L10n::t('View Profile') => $item['author-link']];
}
$args = ['item' => $item, 'menu' => $menu];
// list which show all likers
switch ($type) {
case 'like' :
- $phrase = sprintf( t('%s likes this.'), $likers);
+ $phrase = L10n::t('%s likes this.', $likers);
break;
case 'dislike' :
- $phrase = sprintf( t('%s doesn\'t like this.'), $likers);
+ $phrase = L10n::t('%s doesn\'t like this.', $likers);
break;
case 'attendyes' :
- $phrase = sprintf( t('%s attends.'), $likers);
+ $phrase = L10n::t('%s attends.', $likers);
break;
case 'attendno' :
- $phrase = sprintf( t('%s doesn\'t attend.'), $likers);
+ $phrase = L10n::t('%s doesn\'t attend.', $likers);
break;
case 'attendmaybe' :
- $phrase = sprintf( t('%s attends maybe.'), $likers);
+ $phrase = L10n::t('%s attends maybe.', $likers);
break;
}
}
$arr = array_slice($arr, 0, MAX_LIKERS - 1);
}
if ($total < MAX_LIKERS) {
- $last = t('and') . ' ' . $arr[count($arr)-1];
+ $last = L10n::t('and') . ' ' . $arr[count($arr)-1];
$arr2 = array_slice($arr, 0, -1);
$str = implode(', ', $arr2) . ' ' . $last;
}
if ($total >= MAX_LIKERS) {
$str = implode(', ', $arr);
- $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS );
+ $str .= L10n::t(', and %d other people', $total - MAX_LIKERS );
}
$likers = $str;
switch ($type) {
case 'like':
- $phrase = sprintf( t('<span %1$s>%2$d people</span> like this'), $spanatts, $cnt);
- $explikers = sprintf( t('%s like this.'), $likers);
+ $phrase = L10n::t('<span %1$s>%2$d people</span> like this', $spanatts, $cnt);
+ $explikers = L10n::t('%s like this.', $likers);
break;
case 'dislike':
- $phrase = sprintf( t('<span %1$s>%2$d people</span> don\'t like this'), $spanatts, $cnt);
- $explikers = sprintf( t('%s don\'t like this.'), $likers);
+ $phrase = L10n::t('<span %1$s>%2$d people</span> don\'t like this', $spanatts, $cnt);
+ $explikers = L10n::t('%s don\'t like this.', $likers);
break;
case 'attendyes':
- $phrase = sprintf( t('<span %1$s>%2$d people</span> attend'), $spanatts, $cnt);
- $explikers = sprintf( t('%s attend.'), $likers);
+ $phrase = L10n::t('<span %1$s>%2$d people</span> attend', $spanatts, $cnt);
+ $explikers = L10n::t('%s attend.', $likers);
break;
case 'attendno':
- $phrase = sprintf( t('<span %1$s>%2$d people</span> don\'t attend'), $spanatts, $cnt);
- $explikers = sprintf( t('%s don\'t attend.'), $likers);
+ $phrase = L10n::t('<span %1$s>%2$d people</span> don\'t attend', $spanatts, $cnt);
+ $explikers = L10n::t('%s don\'t attend.', $likers);
break;
case 'attendmaybe':
- $phrase = sprintf( t('<span %1$s>%2$d people</span> attend maybe'), $spanatts, $cnt);
- $explikers = sprintf( t('%s anttend maybe.'), $likers);
+ $phrase = L10n::t('<span %1$s>%2$d people</span> attend maybe', $spanatts, $cnt);
+ $explikers = L10n::t('%s anttend maybe.', $likers);
break;
}
'$baseurl' => System::baseUrl(true),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
- '$ispublic' => t('Visible to <strong>everybody</strong>'),
- '$linkurl' => t('Please enter a link URL:'),
- '$vidurl' => t("Please enter a video link/URL:"),
- '$audurl' => t("Please enter an audio link/URL:"),
- '$term' => t('Tag term:'),
- '$fileas' => t('Save to Folder:'),
- '$whereareu' => t('Where are you right now?'),
- '$delitems' => t('Delete item(s)?')
+ '$ispublic' => L10n::t('Visible to <strong>everybody</strong>'),
+ '$linkurl' => L10n::t('Please enter a link URL:'),
+ '$vidurl' => L10n::t("Please enter a video link/URL:"),
+ '$audurl' => L10n::t("Please enter an audio link/URL:"),
+ '$term' => L10n::t('Tag term:'),
+ '$fileas' => L10n::t('Save to Folder:'),
+ '$whereareu' => L10n::t('Where are you right now?'),
+ '$delitems' => L10n::t('Delete item(s)?')
]);
$tpl = get_markup_template('jot-end.tpl');
'$baseurl' => System::baseUrl(true),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
- '$ispublic' => t('Visible to <strong>everybody</strong>'),
- '$linkurl' => t('Please enter a link URL:'),
- '$vidurl' => t("Please enter a video link/URL:"),
- '$audurl' => t("Please enter an audio link/URL:"),
- '$term' => t('Tag term:'),
- '$fileas' => t('Save to Folder:'),
- '$whereareu' => t('Where are you right now?')
+ '$ispublic' => L10n::t('Visible to <strong>everybody</strong>'),
+ '$linkurl' => L10n::t('Please enter a link URL:'),
+ '$vidurl' => L10n::t("Please enter a video link/URL:"),
+ '$audurl' => L10n::t("Please enter an audio link/URL:"),
+ '$term' => L10n::t('Tag term:'),
+ '$fileas' => L10n::t('Save to Folder:'),
+ '$whereareu' => L10n::t('Where are you right now?')
]);
$jotplugins = '';
$o .= replace_macros($tpl,[
'$return_path' => $query_str,
'$action' => 'item',
- '$share' => defaults($x, 'button', t('Share')),
- '$upload' => t('Upload photo'),
- '$shortupload' => t('upload photo'),
- '$attach' => t('Attach file'),
- '$shortattach' => t('attach file'),
- '$weblink' => t('Insert web link'),
- '$shortweblink' => t('web link'),
- '$video' => t('Insert video link'),
- '$shortvideo' => t('video link'),
- '$audio' => t('Insert audio link'),
- '$shortaudio' => t('audio link'),
- '$setloc' => t('Set your location'),
- '$shortsetloc' => t('set location'),
- '$noloc' => t('Clear browser location'),
- '$shortnoloc' => t('clear location'),
+ '$share' => defaults($x, 'button', L10n::t('Share')),
+ '$upload' => L10n::t('Upload photo'),
+ '$shortupload' => L10n::t('upload photo'),
+ '$attach' => L10n::t('Attach file'),
+ '$shortattach' => L10n::t('attach file'),
+ '$weblink' => L10n::t('Insert web link'),
+ '$shortweblink' => L10n::t('web link'),
+ '$video' => L10n::t('Insert video link'),
+ '$shortvideo' => L10n::t('video link'),
+ '$audio' => L10n::t('Insert audio link'),
+ '$shortaudio' => L10n::t('audio link'),
+ '$setloc' => L10n::t('Set your location'),
+ '$shortsetloc' => L10n::t('set location'),
+ '$noloc' => L10n::t('Clear browser location'),
+ '$shortnoloc' => L10n::t('clear location'),
'$title' => defaults($x, 'title', ''),
- '$placeholdertitle' => t('Set title'),
+ '$placeholdertitle' => L10n::t('Set title'),
'$category' => defaults($x, 'category', ''),
- '$placeholdercategory' => Feature::isEnabled(local_user(), 'categories') ? t('Categories (comma-separated list)') : '',
- '$wait' => t('Please wait'),
- '$permset' => t('Permission settings'),
- '$shortpermset' => t('permissions'),
+ '$placeholdercategory' => Feature::isEnabled(local_user(), 'categories') ? L10n::t('Categories (comma-separated list)') : '',
+ '$wait' => L10n::t('Please wait'),
+ '$permset' => L10n::t('Permission settings'),
+ '$shortpermset' => L10n::t('permissions'),
'$ptyp' => $notes_cid ? 'note' : 'wall',
'$content' => defaults($x, 'content', ''),
'$post_id' => defaults($x, 'post_id', ''),
'$defloc' => $x['default_location'],
'$visitor' => $x['visitor'],
'$pvisit' => $notes_cid ? 'none' : $x['visitor'],
- '$public' => t('Public post'),
+ '$public' => L10n::t('Public post'),
'$lockstate' => $x['lockstate'],
'$bang' => $x['bang'],
'$profile_uid' => $x['profile_uid'],
- '$preview' => Feature::isEnabled($x['profile_uid'], 'preview') ? t('Preview') : '',
+ '$preview' => Feature::isEnabled($x['profile_uid'], 'preview') ? L10n::t('Preview') : '',
'$jotplugins' => $jotplugins,
'$notes_cid' => $notes_cid,
- '$sourceapp' => t($a->sourcename),
- '$cancel' => t('Cancel'),
+ '$sourceapp' => L10n::t($a->sourcename),
+ '$cancel' => L10n::t('Cancel'),
'$rand_num' => random_digits(12),
// ACL permissions box
'$acl' => $x['acl'],
- '$group_perms' => t('Post to Groups'),
- '$contact_perms' => t('Post to Contacts'),
- '$private' => t('Private post'),
+ '$group_perms' => L10n::t('Post to Groups'),
+ '$contact_perms' => L10n::t('Post to Contacts'),
+ '$private' => L10n::t('Private post'),
'$is_private' => $private_post,
'$public_link' => $public_post_link,
//jot nav tab (used in some themes)
- '$message' => t('Message'),
- '$browser' => t('Browser'),
+ '$message' => L10n::t('Message'),
+ '$browser' => L10n::t('Browser'),
]);
if (count($ret[$v]['list']) > MAX_LIKERS) {
$ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS);
array_push($ret[$v]['list_part'], '<a href="#" data-toggle="modal" data-target="#' . $v . 'Modal-'
- . (($ob) ? $ob->getId() : $item['id']) . '"><b>' . t('View all') . '</b></a>');
+ . (($ob) ? $ob->getId() : $item['id']) . '"><b>' . L10n::t('View all') . '</b></a>');
} else {
$ret[$v]['list_part'] = '';
}
{
switch ($v) {
case 'like':
- $return = tt('Like', 'Likes', $count);
+ $return = L10n::tt('Like', 'Likes', $count);
break;
case 'dislike':
- $return = tt('Dislike', 'Dislikes', $count);
+ $return = L10n::tt('Dislike', 'Dislikes', $count);
break;
case 'attendyes':
- $return = tt('Attending', 'Attending', $count);
+ $return = L10n::tt('Attending', 'Attending', $count);
break;
case 'attendno':
- $return = tt('Not Attending', 'Not Attending', $count);
+ $return = L10n::tt('Not Attending', 'Not Attending', $count);
break;
case 'attendmaybe':
- $return = tt('Undecided', 'Undecided', $count);
+ $return = L10n::tt('Undecided', 'Undecided', $count);
break;
}
*/
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
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;
}
/**
$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);
}
} 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>";
}
$o = replace_macros(get_markup_template("field_input.tpl"), [
'$field' => [
'dob',
- t('Birthday:'),
+ L10n::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') . '"'
]
]);
// First day of the week (0 = Sunday)
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
- $lang = substr(get_browser_language(), 0, 2);
+ $lang = substr(L10n::getBrowserLanguage(), 0, 2);
// Check if the detected language is supported by the picker
if (!in_array($lang, ["ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"])) {
$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) {
$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]));
continue;
}
- $bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
- $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
+ $bdtext = L10n::t('%s\'s birthday', $rr['name']);
+ $bdtext2 = 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' ) ",
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 = L10n::t('Cannot locate DNS info for database server \'%s\'', $server);
self::$connected = false;
self::$db = null;
return false;
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Util\Emailer;
$a = get_app();
// from here on everything is in the recipients language
- push_lang($params['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);
+ $site_admin = L10n::t('%s Administrator', $sitename);
} else {
- $site_admin = sprintf(t('%1$s, %2$s Administrator'), $a->config['admin_name'], $sitename);
+ $site_admin = L10n::t('%1$s, %2$s Administrator', $a->config['admin_name'], $sitename);
}
$sender_name = $sitename;
$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) {
}
if ($params['type'] == NOTIFY_MAIL) {
- $subject = sprintf(t('[Friendica:Notify] New mail received at %s'), $sitename);
+ $subject = 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 = L10n::t('%1$s sent you a new private message at %2$s.', $params['source_name'], $sitename);
+ $epreamble = 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 = 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'];
intval($params['uid'])
);
if ($p && count($p)) {
- pop_lang();
+ L10n::popLang();
return;
}
$item_post_type = item_post_type($item);
// "a post"
- $dest_str = sprintf(t('%1$s commented on [url=%2$s]a %3$s[/url]'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $itemlink,
- $item_post_type);
+ $dest_str = 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]'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $itemlink,
- $item['author-name'],
- $item_post_type);
+ $dest_str = 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'],
+ $item_post_type
+ );
}
// "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]'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $itemlink,
- $item_post_type);
+ $dest_str = 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
+ );
}
// Some mail softwares relies on subject field for threading.
// 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 = 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 = L10n::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'];
}
if ($params['type'] == NOTIFY_WALL) {
- $subject = sprintf(t('[Friendica:Notify] %s posted to your profile wall'), $params['source_name']);
+ $subject = 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]'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $params['link']);
+ $preamble = L10n::t('%1$s posted to your profile wall at %2$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('%1$s posted to [url=%2$s]your wall[/url]',
+ '[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'];
}
if ($params['type'] == NOTIFY_TAGSELF) {
- $subject = sprintf(t('[Friendica:Notify] %s tagged you'), $params['source_name']);
+ $subject = 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].'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $params['link']);
+ $preamble = L10n::t('%1$s tagged you at %2$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('%1$s [url=%2$s]tagged you[/url].',
+ '[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'];
}
if ($params['type'] == NOTIFY_SHARE) {
- $subject = sprintf(t('[Friendica:Notify] %s shared a new post'), $params['source_name']);
+ $subject = 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].'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $params['link']);
+ $preamble = L10n::t('%1$s shared a new post at %2$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('%1$s [url=%2$s]shared a post[/url].',
+ '[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'];
}
if ($params['type'] == NOTIFY_POKE) {
- $subject = sprintf(t('[Friendica:Notify] %1$s poked you'), $params['source_name']);
+ $subject = 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].'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $params['link']);
+ $preamble = L10n::t('%1$s poked you at %2$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('%1$s [url=%2$s]poked you[/url].',
+ '[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'];
}
if ($params['type'] == NOTIFY_TAGSHARE) {
- $subject = sprintf(t('[Friendica:Notify] %s tagged your post'), $params['source_name']);
+ $subject = 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]'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $itemlink);
+ $preamble = L10n::t('%1$s tagged your post at %2$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('%1$s tagged [url=%2$s]your post[/url]',
+ '[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'];
}
if ($params['type'] == NOTIFY_INTRO) {
- $subject = sprintf(t('[Friendica:Notify] Introduction received'));
+ $subject = 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.'),
- $itemlink,
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
+ $preamble = L10n::t('You\'ve received an introduction from \'%1$s\' at %2$s', $params['source_name'], $sitename);
+ $epreamble = 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 = L10n::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'];
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 = 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'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $sitename);
+ $preamble = L10n::t('%1$s is sharing with you at %2$s', $params['source_name'], $sitename);
+ $epreamble = 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 = 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'),
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
- $sitename);
+ $preamble = L10n::t('You have a new follower at %2$s : %1$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('You have a new follower at %2$s : %1$s',
+ '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
+ $sitename
+ );
break;
default:
// ACTIVITY_REQ_FRIEND is default activity for notifications
}
if ($params['type'] == NOTIFY_SUGGEST) {
- $subject = sprintf(t('[Friendica:Notify] Friend suggestion received'));
+ $subject = 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.'),
- $itemlink,
- '[url='.$params['item']['url'].']'.$params['item']['name'].'[/url]',
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
+ $preamble = L10n::t('You\'ve received a friend suggestion from \'%1$s\' at %2$s', $params['source_name'], $sitename);
+ $epreamble = 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 = t('Name:').' '.$params['item']['name']."\n";
- $body .= t('Photo:').' '.$params['item']['photo']."\n";
- $body .= sprintf(t('You may visit their profile at %s'), $params['item']['url']);
+ $body = L10n::t('Name:').' '.$params['item']['name']."\n";
+ $body .= L10n::t('Photo:').' '.$params['item']['photo']."\n";
+ $body .= L10n::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'];
if ($params['type'] == NOTIFY_CONFIRM) {
if ($params['verb'] == ACTIVITY_FRIEND) { // mutual connection
- $subject = sprintf(t('[Friendica:Notify] Connection accepted'));
+ $subject = 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].'),
- $itemlink,
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
+ $preamble = L10n::t('\'%1$s\' has accepted your connection request at %2$s', $params['source_name'], $sitename);
+ $epreamble = L10n::t('%2$s has accepted your [url=%1$s]connection request[/url].',
+ $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'];
} else { // ACTIVITY_FOLLOW
- $subject = sprintf(t('[Friendica:Notify] Connection accepted'));
+ $subject = 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].'),
- $itemlink,
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
+ $preamble = L10n::t('\'%1$s\' has accepted your connection request at %2$s', $params['source_name'], $sitename);
+ $epreamble = 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 = 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 .= L10n::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'];
if ($params['type'] == NOTIFY_SYSTEM) {
switch($params['event']) {
case "SYSTEM_REGISTER_REQUEST":
- $subject = sprintf(t('[Friendica System:Notify] registration request'));
+ $subject = 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.'),
- $itemlink,
- '[url='.$params['source_link'].']'.$params['source_name'].'[/url]');
+ $preamble = L10n::t('You\'ve received a registration request from \'%1$s\' at %2$s', $params['source_name'], $sitename);
+ $epreamble = 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)'),
- $params['source_name'], $siteurl, $params['source_mail'], $params['source_nick']);
+ $body = 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 = 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'];
Addon::callHooks('enotify_store', $datarray);
if ($datarray['abort']) {
- pop_lang();
+ L10n::popLang();
return False;
}
if ($r) {
$notify_id = $r[0]['id'];
} else {
- pop_lang();
+ L10n::popLang();
return False;
}
// only continue on if we stored the first one
if ($notify_id != $p[0]['id']) {
- pop_lang();
- return False;
+ L10n::popLang();
+ return false;
}
}
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;
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 ))
$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;
$o .= '<div class="summary event-summary">' . bbcode($ev['summary']) . '</div>' . "\r\n";
- $o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span> <span class="dtstart" title="'
+ $o .= '<div class="event-start"><span class="event-label">' . L10n::t('Starts:') . '</span> <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> <span class="dtend" title="'
+ $o .= '<div class="event-end" ><span class="event-label">' . L10n::t('Finishes:') . '</span> <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";
$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> <span class="location">'
+ $o .= '<div class="event-location"><span class="event-label">' . L10n::t('Location:') . '</span> <span class="location">'
. bbcode($ev['location'])
. '</span></div>' . "\r\n";
$i18n = [
"firstDay" => $firstDay,
- "allday" => t("all-day"),
-
- "Sun" => t("Sun"),
- "Mon" => t("Mon"),
- "Tue" => t("Tue"),
- "Wed" => t("Wed"),
- "Thu" => t("Thu"),
- "Fri" => t("Fri"),
- "Sat" => t("Sat"),
-
- "Sunday" => t("Sunday"),
- "Monday" => t("Monday"),
- "Tuesday" => t("Tuesday"),
- "Wednesday" => t("Wednesday"),
- "Thursday" => t("Thursday"),
- "Friday" => t("Friday"),
- "Saturday" => 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"),
-
- "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"),
-
- "today" => t("today"),
- "month" => t("month"),
- "week" => t("week"),
- "day" => t("day"),
-
- "noevent" => t("No events to display"),
-
- "dtstart_label" => t("Starts:"),
- "dtend_label" => t("Finishes:"),
- "location_label" => t("Location:")
+ "allday" => L10n::t("all-day"),
+
+ "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" => 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" => 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" => 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" => L10n::t("today"),
+ "month" => L10n::t("month"),
+ "week" => L10n::t("week"),
+ "day" => L10n::t("day"),
+
+ "noevent" => L10n::t("No events to display"),
+
+ "dtstart_label" => L10n::t("Starts:"),
+ "dtend_label" => L10n::t("Finishes:"),
+ "location_label" => L10n::t("Location:")
];
return $i18n;
$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'));
$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'));
'is_first' => $is_first,
'item' => $rr,
'html' => $html,
- 'plink' => [$rr['plink'], t('link to source'), '', ''],
+ 'plink' => [$rr['plink'], L10n::t('link to source'), '', ''],
];
}
}
}
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
]);
}
$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)));
$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,
'$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
]);
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;
'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),
);
if (!DBM::is_result($r)) {
- notice(t('Item not found.') . EOL);
+ notice(L10n::t('Item not found.') . EOL);
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
}
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
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
}
$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;
<?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;
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:
}
// 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") ;
*/
use Friendica\App;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Network\Probe;
$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
);
+++ /dev/null
-<?php
-
-/**
- * @brief translation support
- *
- * Get the language setting directly from system variables, bypassing Config::get()
- * as database may not yet be configured.
- *
- * If possible, we use the value from the browser.
- *
- */
-
-use Friendica\Core\Config;
-
-require_once "include/dba.php";
-
-/**
- * @brief get the prefered language from the HTTP_ACCEPT_LANGUAGE header
- */
-function get_browser_language() {
-
- $lang_list = [];
- if (x($_SERVER, 'HTTP_ACCEPT_LANGUAGE')) {
- // break up string into pieces (languages and q factors)
- preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i',
- $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
-
- if (count($lang_parse[1])) {
- // go through the list of prefered languages and add a generic language
- // for sub-linguas (e.g. de-ch will add de) if not already in array
- for ($i = 0; $i < count($lang_parse[1]); $i++) {
- $lang_list[] = strtolower($lang_parse[1][$i]);
- if (strlen($lang_parse[1][$i])>3 ) {
- $dashpos = strpos($lang_parse[1][$i], '-');
- if (!in_array(substr($lang_parse[1][$i], 0, $dashpos), $lang_list ) ) {
- $lang_list[] = strtolower(substr($lang_parse[1][$i], 0, $dashpos));
- }
- }
- }
- }
- }
-
- // check if we have translations for the preferred languages and pick the 1st that has
- foreach ($lang_list as $lang) {
- if ($lang === 'en' || (file_exists("view/lang/$lang") && is_dir("view/lang/$lang"))) {
- $preferred = $lang;
- break;
- }
- }
- if (isset($preferred)) {
- return $preferred;
- }
-
- // in case none matches, get the system wide configured language, or fall back to English
- return Config::get('system', 'language', 'en');
-}
-
-
-function push_lang($language) {
- global $lang, $a;
-
- $a->langsave = $lang;
-
- if ($language === $lang) {
- return;
- }
-
- if (isset($a->strings) && count($a->strings)) {
- $a->stringsave = $a->strings;
- }
- $a->strings = [];
- load_translation_table($language);
- $lang = $language;
-}
-
-function pop_lang() {
- global $lang, $a;
-
- if ($lang === $a->langsave) {
- return;
- }
-
- if (isset($a->stringsave)) {
- $a->strings = $a->stringsave;
- } else {
- $a->strings = [];
- }
-
- $lang = $a->langsave;
-}
-
-// l
-
-/**
- * load string translation table for alternate language
- *
- * first addon strings are loaded, then globals
- *
- * @param string $lang language code to load
- */
-function load_translation_table($lang) {
- $a = get_app();
-
- $a->strings = [];
- // load enabled addons strings
- $addons = dba::select('addon', ['name'], ['installed' => true]);
- while ($p = dba::fetch($addons)) {
- $name = $p['name'];
- if (file_exists("addon/$name/lang/$lang/strings.php")) {
- include("addon/$name/lang/$lang/strings.php");
- }
- }
-
- if (file_exists("view/lang/$lang/strings.php")) {
- include("view/lang/$lang/strings.php");
- }
-
-}
-
-/**
- * @brief Return the localized version of the provided string with optional string interpolation
- *
- * This function takes a english string as parameter, and if a localized version
- * exists for the current language, substitutes it before performing an eventual
- * string interpolation (sprintf) with additional optional arguments.
- *
- * Usages:
- * - t('This is an example')
- * - t('URL %s returned no result', $url)
- * - t('Current version: %s, new version: %s', $current_version, $new_version)
- *
- * @param string $s
- * @return string
- */
-function t($s)
-{
- $a = get_app();
-
- if (x($a->strings, $s)) {
- $t = $a->strings[$s];
- $s = is_array($t) ? $t[0] : $t;
- }
- if (func_num_args() > 1) {
- $args = array_slice(func_get_args(), 1);
- $s = @vsprintf($s, $args);
- }
-
- return $s;
-}
-
-/**
- * @brief Return the localized version of a singular/plural string with optional string interpolation
- *
- * This function takes two english strings as parameters, singular and plural, as
- * well as a count. If a localized version exists for the current language, they
- * are used instead. Discrimination between singular and plural is done using the
- * localized function if any or the default one. Finally, a string interpolation
- * is performed using the count as parameter.
- *
- * Usages:
- * - tt('Like', 'Likes', $count)
- * - tt("%s user deleted", "%s users deleted", count($users))
- *
- * @global type $lang
- * @param string $singular
- * @param string $plural
- * @param int $count
- * @return string
- */
-function tt($singular, $plural, $count)
-{
- global $lang;
- $a = get_app();
-
- if (x($a->strings, $singular)) {
- $t = $a->strings[$singular];
- if (is_array($t)) {
- $plural_function = 'string_plural_select_' . str_replace('-', '_', $lang);
- if (function_exists($plural_function)) {
- $plural_function = 'string_plural_select_default';
- }
- $i = $plural_function($count);
- $s = $t[$i];
- } else {
- $s = $t;
- }
- } elseif (string_plural_select_default($count)) {
- $s = $plural;
- } else {
- $s = $singular;
- }
-
- $s = @sprintf($s, $count);
-
- return $s;
-}
-
-// provide a fallback which will not collide with
-// a function defined in any language file
-function string_plural_select_default($n)
-{
- return $n != 1;
-}
-
-
-
-/**
- * @brief Return installed languages codes as associative array
- *
- * Scans the view/lang directory for the existence of "strings.php" files, and
- * returns an alphabetical list of their folder names (@-char language codes).
- * Adds the english language if it's missing from the list.
- *
- * Ex: array('de' => 'de', 'en' => 'en', 'fr' => 'fr', ...)
- *
- * @return array
- */
-function get_available_languages() {
- $langs = [];
- $strings_file_paths = glob('view/lang/*/strings.php');
-
- if (is_array($strings_file_paths) && count($strings_file_paths)) {
- if (!in_array('view/lang/en/strings.php', $strings_file_paths)) {
- $strings_file_paths[] = 'view/lang/en/strings.php';
- }
- asort($strings_file_paths);
- foreach ($strings_file_paths as $strings_file_path) {
- $path_array = explode('/', $strings_file_path);
- $langs[$path_array[2]] = $path_array[2];
- }
- }
- return $langs;
-}
<?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;
if ($a->user['login_date'] <= NULL_DATE) {
$_SESSION['return_url'] = 'profile_photo/new';
$a->module = 'profile_photo';
- info(t("Welcome ") . $a->user['username'] . EOL);
- info(t('Please upload a profile photo.') . EOL);
+ info(L10n::t("Welcome ") . $a->user['username'] . EOL);
+ info(L10n::t('Please upload a profile photo.') . EOL);
} else {
- info(t("Welcome back ") . $a->user['username'] . EOL);
+ info(L10n::t("Welcome back ") . $a->user['username'] . EOL);
}
}
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')
<?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;
$tpl = get_markup_template('tagblock_widget.tpl');
$o = replace_macros($tpl, [
- '$title' => t('Tags'),
+ '$title' => L10n::t('Tags'),
'$tags' => $tags
]);
}
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;
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'];
$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' : '');
}
}
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')
]);
}
$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
dbesc(implode(",", $contacts)));
if (DBM::is_result($r)) {
- $contacts = sprintf(tt('%d Contact','%d Contacts', $total),$total);
+ $contacts = L10n::tt('%d Contact', '%d Contacts', $total);
$micropro = [];
foreach ($r as $rr) {
- $micropro[] = micropro($rr,true,'mpfriend');
+ $micropro[] = micropro($rr, true, 'mpfriend');
}
}
}
$o = replace_macros($tpl, [
'$contacts' => $contacts,
'$nickname' => $a->profile['nickname'],
- '$viewcontacts' => t('View Contacts'),
+ '$viewcontacts' => L10n::t('View Contacts'),
'$micropro' => $micropro,
]);
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
];
if (!$aside) {
$values['$searchoption'] = [
- t("Full Text"),
- t("Tags"),
- t("Contacts")];
+ L10n::t("Full Text"),
+ L10n::t("Tags"),
+ L10n::t("Contacts")];
if (Config::get('system','poco_local_search')) {
- $values['$searchoption'][] = t("Forums");
+ $values['$searchoption'][] = L10n::t("Forums");
}
}
// 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;
*/
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;
*/
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;
}
$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,
],
}
$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>';
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 . '\');">' . 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));
}
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 . '\');">' . 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));
}
//'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 = [];
*/
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.
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;
}
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
$maintenance = Config::get('system', 'maintenance');
}
-$lang = get_browser_language();
+$lang = L10n::getBrowserLanguage();
-load_translation_table($lang);
+L10n::loadTranslationTable($lang);
/**
* Important stuff we always need to do.
if ((x($_SESSION, 'language')) && ($_SESSION['language'] !== $lang)) {
$lang = $_SESSION['language'];
- load_translation_table($lang);
+ L10n::loadTranslationTable($lang);
}
if ((x($_GET, 'zrl')) && (!$install && !$maintenance)) {
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')) {
}
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.')]
);
}
}
* 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.'));
}
/*
get_markup_template("toggle_mobile_footer.tpl"),
[
'$toggle_link' => $link,
- '$toggle_text' => t('toggle mobile')]
+ '$toggle_text' => L10n::t('toggle mobile')]
);
}
use Friendica\Content\Text\Markdown;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
$a->page = $orig_page;
}
- info(t('Theme settings updated.'));
+ info(L10n::t('Theme settings updated.'));
if (is_ajax()) {
return;
}
// array(url, name, extra css classes)
// not part of $aside to make the template more adjustable
$aside_sub = [
- 'site' => ["admin/site/" , t("Site") , "site"],
- 'users' => ["admin/users/" , t("Users") , "users"],
- 'addons' => ["admin/addons/" , t("Addons") , "addons"],
- 'themes' => ["admin/themes/" , t("Themes") , "themes"],
- 'features' => ["admin/features/" , t("Additional features") , "features"],
- 'dbsync' => ["admin/dbsync/" , t('DB updates') , "dbsync"],
- 'queue' => ["admin/queue/" , t('Inspect Queue') , "queue"],
- 'contactblock' => ["admin/contactblock/", t('Contact Blocklist') , "contactblock"],
- 'blocklist' => ["admin/blocklist/" , t('Server Blocklist') , "blocklist"],
- 'federation' => ["admin/federation/" , t('Federation Statistics'), "federation"],
- 'deleteitem' => ["admin/deleteitem/" , t('Delete Item') , 'deleteitem'],
+ 'site' => ["admin/site/" , L10n::t("Site") , "site"],
+ 'users' => ["admin/users/" , L10n::t("Users") , "users"],
+ 'addons' => ["admin/addons/" , L10n::t("Addons") , "addons"],
+ 'themes' => ["admin/themes/" , L10n::t("Themes") , "themes"],
+ 'features' => ["admin/features/" , L10n::t("Additional features") , "features"],
+ 'dbsync' => ["admin/dbsync/" , L10n::t('DB updates') , "dbsync"],
+ 'queue' => ["admin/queue/" , L10n::t('Inspect Queue') , "queue"],
+ 'contactblock' => ["admin/contactblock/", L10n::t('Contact Blocklist') , "contactblock"],
+ 'blocklist' => ["admin/blocklist/" , L10n::t('Server Blocklist') , "blocklist"],
+ 'federation' => ["admin/federation/" , L10n::t('Federation Statistics'), "federation"],
+ 'deleteitem' => ["admin/deleteitem/" , L10n::t('Delete Item') , 'deleteitem'],
];
/* get addons admin page */
$a->addons_admin[] = $addon;
}
- $aside_tools['logs'] = ["admin/logs/", t("Logs"), "logs"];
- $aside_tools['viewlogs'] = ["admin/viewlogs/", t("View Logs"), 'viewlogs'];
- $aside_tools['diagnostics_probe'] = ['probe/', t('probe address'), 'probe'];
- $aside_tools['diagnostics_webfinger'] = ['webfinger/', t('check webfinger'), 'webfinger'];
+ $aside_tools['logs'] = ["admin/logs/", L10n::t("Logs"), "logs"];
+ $aside_tools['viewlogs'] = ["admin/viewlogs/", L10n::t("View Logs"), 'viewlogs'];
+ $aside_tools['diagnostics_probe'] = ['probe/', L10n::t('probe address'), 'probe'];
+ $aside_tools['diagnostics_webfinger'] = ['webfinger/', L10n::t('check webfinger'), 'webfinger'];
$t = get_markup_template('admin/aside.tpl');
$a->page['aside'] .= replace_macros($t, [
'$admin' => $aside_tools,
'$subpages' => $aside_sub,
- '$admtxt' => t('Admin'),
- '$plugadmtxt' => t('Addon Features'),
- '$logtxt' => t('Logs'),
- '$diagnosticstxt' => t('diagnostics'),
- '$h_pending' => t('User registrations waiting for confirmation'),
+ '$admtxt' => L10n::t('Admin'),
+ '$plugadmtxt' => L10n::t('Addon Features'),
+ '$logtxt' => L10n::t('Logs'),
+ '$diagnosticstxt' => L10n::t('diagnostics'),
+ '$h_pending' => L10n::t('User registrations waiting for confirmation'),
'$admurl' => "admin/"
]);
$o = admin_page_deleteitem($a);
break;
default:
- notice(t("Item not found."));
+ notice(L10n::t("Item not found."));
}
} else {
$o = admin_page_summary($a);
if (is_array($blocklist)) {
foreach ($blocklist as $id => $b) {
$blocklistform[] = [
- 'domain' => ["domain[$id]", t('Blocked domain'), $b['domain'], '', t('The blocked domain'), 'required', '', ''],
- 'reason' => ["reason[$id]", t("Reason for the block"), $b['reason'], t('The reason why you blocked this domain.') . '(' . $b['domain'] . ')', 'required', '', ''],
- 'delete' => ["delete[$id]", t("Delete domain") . ' (' . $b['domain'] . ')', False, t("Check to delete this entry from the blocklist")]
+ 'domain' => ["domain[$id]", L10n::t('Blocked domain'), $b['domain'], '', L10n::t('The blocked domain'), 'required', '', ''],
+ 'reason' => ["reason[$id]", L10n::t("Reason for the block"), $b['reason'], L10n::t('The reason why you blocked this domain.') . '(' . $b['domain'] . ')', 'required', '', ''],
+ 'delete' => ["delete[$id]", L10n::t("Delete domain") . ' (' . $b['domain'] . ')', false, L10n::t("Check to delete this entry from the blocklist")]
];
}
}
$t = get_markup_template('admin/blocklist.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Server Blocklist'),
- '$intro' => t('This page can be used to define a black list of servers from the federated network that are not allowed to interact with your node. For all entered domains you should also give a reason why you have blocked the remote server.'),
- '$public' => t('The list of blocked servers will be made publically available on the /friendica page so that your users and people investigating communication problems can find the reason easily.'),
- '$addtitle' => t('Add new entry to block list'),
- '$newdomain' => ['newentry_domain', t('Server Domain'), '', t('The domain of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''],
- '$newreason' => ['newentry_reason', t('Block reason'), '', t('The reason why you blocked this domain.'), 'required', '', ''],
- '$submit' => t('Add Entry'),
- '$savechanges' => t('Save changes to the blocklist'),
- '$currenttitle' => t('Current Entries in the Blocklist'),
- '$thurl' => t('Blocked domain'),
- '$threason' => t('Reason for the block'),
- '$delentry' => t('Delete entry from blocklist'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Server Blocklist'),
+ '$intro' => L10n::t('This page can be used to define a black list of servers from the federated network that are not allowed to interact with your node. For all entered domains you should also give a reason why you have blocked the remote server.'),
+ '$public' => L10n::t('The list of blocked servers will be made publically available on the /friendica page so that your users and people investigating communication problems can find the reason easily.'),
+ '$addtitle' => L10n::t('Add new entry to block list'),
+ '$newdomain' => ['newentry_domain', L10n::t('Server Domain'), '', L10n::t('The domain of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''],
+ '$newreason' => ['newentry_reason', L10n::t('Block reason'), '', L10n::t('The reason why you blocked this domain.'), 'required', '', ''],
+ '$submit' => L10n::t('Add Entry'),
+ '$savechanges' => L10n::t('Save changes to the blocklist'),
+ '$currenttitle' => L10n::t('Current Entries in the Blocklist'),
+ '$thurl' => L10n::t('Blocked domain'),
+ '$threason' => L10n::t('Reason for the block'),
+ '$delentry' => L10n::t('Delete entry from blocklist'),
'$entries' => $blocklistform,
'$baseurl' => System::baseUrl(true),
- '$confirm_delete' => t('Delete entry from blocklist?'),
+ '$confirm_delete' => L10n::t('Delete entry from blocklist?'),
'$form_security_token' => get_form_security_token("admin_blocklist")
]);
}
'reason' => notags(trim($_POST['newentry_reason']))
];
Config::set('system', 'blocklist', $blocklist);
- info(t('Server added to blocklist.') . EOL);
+ info(L10n::t('Server added to blocklist.') . EOL);
} else {
// Edit the entries from blocklist
$blocklist = [];
}
}
Config::set('system', 'blocklist', $blocklist);
- info(t('Site blocklist updated.') . EOL);
+ info(L10n::t('Site blocklist updated.') . EOL);
}
goaway('admin/blocklist');
$contact_id = Contact::getIdForURL($contact_url, 0);
if ($contact_id) {
Contact::block($contact_id);
- notice(t('The contact has been blocked from the node'));
+ notice(L10n::t('The contact has been blocked from the node'));
} else {
- notice(t('Could not find any contact entry for this URL (%s)', $contact_url));
+ notice(L10n::t('Could not find any contact entry for this URL (%s)', $contact_url));
}
}
if (x($_POST, 'page_contactblock_unblock')) {
foreach ($contacts as $uid) {
Contact::unblock($uid);
}
- notice(tt("%s contact unblocked", "%s contacts unblocked", count($contacts)));
+ notice(L10n::tt("%s contact unblocked", "%s contacts unblocked", count($contacts)));
}
goaway('admin/contactblock');
return; // NOTREACHED
$t = get_markup_template('admin/contactblock.tpl');
$o = replace_macros($t, [
// strings //
- '$title' => t('Administration'),
- '$page' => t('Remote Contact Blocklist'),
- '$description' => t('This page allows you to prevent any message from a remote contact to reach your node.'),
- '$submit' => t('Block Remote Contact'),
- '$select_all' => t('select all'),
- '$select_none' => t('select none'),
- '$block' => t('Block'),
- '$unblock' => t('Unblock'),
- '$no_data' => t('No remote contact is blocked from this node.'),
-
- '$h_contacts' => t('Blocked Remote Contacts'),
- '$h_newblock' => t('Block New Remote Contact'),
- '$th_contacts' => [t('Photo'), t('Name'), t('Address'), t('Profile URL')],
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Remote Contact Blocklist'),
+ '$description' => L10n::t('This page allows you to prevent any message from a remote contact to reach your node.'),
+ '$submit' => L10n::t('Block Remote Contact'),
+ '$select_all' => L10n::t('select all'),
+ '$select_none' => L10n::t('select none'),
+ '$block' => L10n::t('Block'),
+ '$unblock' => L10n::t('Unblock'),
+ '$no_data' => L10n::t('No remote contact is blocked from this node.'),
+
+ '$h_contacts' => L10n::t('Blocked Remote Contacts'),
+ '$h_newblock' => L10n::t('Block New Remote Contact'),
+ '$th_contacts' => [L10n::t('Photo'), L10n::t('Name'), L10n::t('Address'), L10n::t('Profile URL')],
'$form_security_token' => get_form_security_token("admin_contactblock"),
'$baseurl' => System::baseUrl(true),
'$contacts' => $contacts,
- '$total_contacts' => tt('%s total blocked contact', '%s total blocked contacts', $total),
+ '$total_contacts' => L10n::tt('%s total blocked contact', '%s total blocked contacts', $total),
'$paginate' => paginate($a),
- '$contacturl' => ['contact_url', t("Profile URL"), '', t("URL of the remote contact to block.")],
+ '$contacturl' => ['contact_url', L10n::t("Profile URL"), '', L10n::t("URL of the remote contact to block.")],
]);
return $o;
}
$t = get_markup_template('admin/deleteitem.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Delete Item'),
- '$submit' => t('Delete this Item'),
- '$intro1' => t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
- '$intro2' => t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
- '$deleteitemguid' => ['deleteitemguid', t("GUID"), '', t("The GUID of the item you want to delete."), 'required', 'autofocus'],
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Delete Item'),
+ '$submit' => L10n::t('Delete this Item'),
+ '$intro1' => L10n::t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
+ '$intro2' => L10n::t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
+ '$deleteitemguid' => ['deleteitemguid', L10n::t("GUID"), '', L10n::t("The GUID of the item you want to delete."), 'required', 'autofocus'],
'$baseurl' => System::baseUrl(),
'$form_security_token' => get_form_security_token("admin_deleteitem")
]);
dba::close($r);
}
- info(t('Item marked for deletion.') . EOL);
+ info(L10n::t('Item marked for deletion.') . EOL);
goaway('admin/deleteitem');
return; // NOTREACHED
}
// to the version string for the displayed list.
foreach ($v as $key => $value) {
if ($v[$key]['version'] == '') {
- $v[$key] = ['total' => $v[$key]['total'], 'version' => t('unknown')];
+ $v[$key] = ['total' => $v[$key]['total'], 'version' => L10n::t('unknown')];
}
}
// in the DB the Diaspora versions have the format x.x.x.x-xx the last
}
// some helpful text
- $intro = t('This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.');
- $hint = t('The <em>Auto Discovered Contact Directory</em> feature is not enabled, it will improve the data displayed here.');
+ $intro = L10n::t('This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.');
+ $hint = L10n::t('The <em>Auto Discovered Contact Directory</em> feature is not enabled, it will improve the data displayed here.');
// load the template, replace the macros and return the page content
$t = get_markup_template('admin/federation.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Federation Statistics'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Federation Statistics'),
'$intro' => $intro,
'$hint' => $hint,
'$autoactive' => Config::get('system', 'poco_completion'),
'$counts' => $counts,
'$version' => FRIENDICA_VERSION,
- '$legendtext' => t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users),
+ '$legendtext' => L10n::t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users),
'$baseurl' => System::baseUrl(),
]);
}
$t = get_markup_template('admin/queue.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Inspect Queue'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Inspect Queue'),
'$count' => count($r),
- 'id_header' => t('ID'),
- '$to_header' => t('Recipient Name'),
- '$url_header' => t('Recipient Profile'),
- '$network_header' => t('Network'),
- '$created_header' => t('Created'),
- '$last_header' => t('Last Tried'),
- '$info' => t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
+ 'id_header' => L10n::t('ID'),
+ '$to_header' => L10n::t('Recipient Name'),
+ '$url_header' => L10n::t('Recipient Profile'),
+ '$network_header' => L10n::t('Network'),
+ '$created_header' => L10n::t('Created'),
+ '$last_header' => L10n::t('Last Tried'),
+ '$info' => L10n::t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
'$entries' => $r,
]);
}
$warningtext = [];
if (DBM::is_result($r)) {
$showwarning = true;
- $warningtext[] = t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php scripts/dbstructure.php toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
+ $warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php scripts/dbstructure.php toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
}
// Check if github.com/friendica/master/VERSION is higher then
// the local version of Friendica. Check is opt-in, source may be master or devel branch
if (Config::get('system', 'check_new_version_url', 'none') != 'none') {
$gitversion = Config::get('system', 'git_friendica_version');
if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) {
- $warningtext[] = t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion);
+ $warningtext[] = L10n::t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion);
$showwarning = true;
}
}
}
if (Config::get('system', 'dbupdate') == DB_UPDATE_FAILED) {
$showwarning = true;
- $warningtext[] = t('The database update failed. Please run "php scripts/dbstructure.php update" from the command line and have a look at the errors that might appear.');
+ $warningtext[] = L10n::t('The database update failed. Please run "php scripts/dbstructure.php update" from the command line and have a look at the errors that might appear.');
}
$last_worker_call = Config::get('system', 'last_poller_execution', false);
if (!$last_worker_call) {
$showwarning = true;
- $warningtext[] = t('The worker was never executed. Please check your database structure!');
+ $warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
} elseif ((strtotime(datetime_convert()) - strtotime($last_worker_call)) > 60 * 60) {
$showwarning = true;
- $warningtext[] = t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
+ $warningtext[] = L10n::t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
}
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
$accounts = [
- [t('Normal Account'), 0],
- [t('Automatic Follower Account'), 0],
- [t('Public Forum Account'), 0],
- [t('Automatic Friend Account'), 0],
- [t('Blog Account'), 0],
- [t('Private Forum Account'), 0]
+ [L10n::t('Normal Account'), 0],
+ [L10n::t('Automatic Follower Account'), 0],
+ [L10n::t('Public Forum Account'), 0],
+ [L10n::t('Automatic Friend Account'), 0],
+ [L10n::t('Blog Account'), 0],
+ [L10n::t('Private Forum Account'), 0]
];
$users = 0;
// We can do better, but this is a quick queue status
- $queues = ['label' => t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue];
+ $queues = ['label' => L10n::t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue];
$t = get_markup_template('admin/summary.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Summary'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Summary'),
'$queues' => $queues,
- '$users' => [t('Registered users'), $users],
+ '$users' => [L10n::t('Registered users'), $users],
'$accounts' => $accounts,
- '$pending' => [t('Pending registrations'), $pending],
- '$version' => [t('Version'), FRIENDICA_VERSION],
+ '$pending' => [L10n::t('Pending registrations'), $pending],
+ '$version' => [L10n::t('Version'), FRIENDICA_VERSION],
'$baseurl' => System::baseUrl(),
'$platform' => FRIENDICA_PLATFORM,
'$codename' => FRIENDICA_CODENAME,
'$build' => Config::get('system', 'build'),
- '$addons' => [t('Active addons'), $a->addons],
+ '$addons' => [L10n::t('Active addons'), $a->addons],
'$showwarning' => $showwarning,
'$warningtext' => $warningtext
]);
$parsed = @parse_url($new_url);
if (!is_array($parsed) || !x($parsed, 'host') || !x($parsed, 'scheme')) {
- notice(t("Can not parse base url. Must have at least <scheme>://<domain>"));
+ notice(L10n::t("Can not parse base url. Must have at least <scheme>://<domain>"));
goaway('admin/site');
}
Config::set('system', 'frontend_worker', $worker_frontend);
Config::set('system', 'rino_encrypt', $rino);
- info(t('Site settings updated.') . EOL);
+ info(L10n::t('Site settings updated.') . EOL);
goaway('admin/site');
return; // NOTREACHED
}
function admin_page_site(App $a)
{
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
if (strlen(Config::get('system', 'directory_submit_url')) &&
!strlen(Config::get('system', 'directory'))) {
/* Installed themes */
$theme_choices = [];
$theme_choices_mobile = [];
- $theme_choices_mobile["---"] = t("No special theme for mobile devices");
+ $theme_choices_mobile["---"] = L10n::t("No special theme for mobile devices");
$files = glob('view/theme/*');
if (is_array($files)) {
$allowed_theme_list = Config::get('system', 'allowed_themes');
/* Community page style */
$community_page_style_choices = [
- CP_NO_COMMUNITY_PAGE => t("No community page"),
- CP_USERS_ON_SERVER => t("Public postings from users of this site"),
- CP_GLOBAL_COMMUNITY => t("Public postings from the federated network"),
- CP_USERS_AND_GLOBAL => t("Public postings from local users and the federated network")
+ CP_NO_COMMUNITY_PAGE => L10n::t("No community page"),
+ CP_USERS_ON_SERVER => L10n::t("Public postings from users of this site"),
+ CP_GLOBAL_COMMUNITY => L10n::t("Public postings from the federated network"),
+ CP_USERS_AND_GLOBAL => L10n::t("Public postings from local users and the federated network")
];
$poco_discovery_choices = [
- "0" => t("Disabled"),
- "1" => t("Users"),
- "2" => t("Users, Global Contacts"),
- "3" => t("Users, Global Contacts/fallback"),
+ "0" => L10n::t("Disabled"),
+ "1" => L10n::t("Users"),
+ "2" => L10n::t("Users, Global Contacts"),
+ "3" => L10n::t("Users, Global Contacts/fallback"),
];
$poco_discovery_since_choices = [
- "30" => t("One month"),
- "91" => t("Three months"),
- "182" => t("Half a year"),
- "365" => t("One year"),
+ "30" => L10n::t("One month"),
+ "91" => L10n::t("Three months"),
+ "182" => L10n::t("Half a year"),
+ "365" => L10n::t("One year"),
];
/* get user names to make the install a personal install of X */
$user_names = [];
- $user_names['---'] = t('Multi user instance');
+ $user_names['---'] = L10n::t('Multi user instance');
$users = q("SELECT `username`, `nickname` FROM `user`");
foreach ($users as $user) {
$user_names[$user['nickname']] = $user['username'];
/* Register policy */
$register_choices = [
- REGISTER_CLOSED => t("Closed"),
- REGISTER_APPROVE => t("Requires approval"),
- REGISTER_OPEN => t("Open")
+ REGISTER_CLOSED => L10n::t("Closed"),
+ REGISTER_APPROVE => L10n::t("Requires approval"),
+ REGISTER_OPEN => L10n::t("Open")
];
$ssl_choices = [
- SSL_POLICY_NONE => t("No SSL policy, links will track page SSL state"),
- SSL_POLICY_FULL => t("Force all links to use SSL"),
- SSL_POLICY_SELFSIGN => t("Self-signed certificate, use SSL for local links only (discouraged)")
+ SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"),
+ SSL_POLICY_FULL => L10n::t("Force all links to use SSL"),
+ SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only (discouraged)")
];
$check_git_version_choices = [
- "none" => t("Don't check"),
- "master" => t("check the stable version"),
- "develop" => t("check the development version")
+ "none" => L10n::t("Don't check"),
+ "master" => L10n::t("check the stable version"),
+ "develop" => L10n::t("check the development version")
];
if ($a->config['hostname'] == "") {
$t = get_markup_template('admin/site.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Site'),
- '$submit' => t('Save Settings'),
- '$republish' => t('Republish users to directory'),
- '$registration' => t('Registration'),
- '$upload' => t('File upload'),
- '$corporate' => t('Policies'),
- '$advanced' => t('Advanced'),
- '$portable_contacts' => t('Auto Discovered Contact Directory'),
- '$performance' => t('Performance'),
- '$worker_title' => t('Worker'),
- '$relocate' => t('Relocate - WARNING: advanced function. Could make this server unreachable.'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Site'),
+ '$submit' => L10n::t('Save Settings'),
+ '$republish' => L10n::t('Republish users to directory'),
+ '$registration' => L10n::t('Registration'),
+ '$upload' => L10n::t('File upload'),
+ '$corporate' => L10n::t('Policies'),
+ '$advanced' => L10n::t('Advanced'),
+ '$portable_contacts' => L10n::t('Auto Discovered Contact Directory'),
+ '$performance' => L10n::t('Performance'),
+ '$worker_title' => L10n::t('Worker'),
+ '$relocate' => L10n::t('Relocate - WARNING: advanced function. Could make this server unreachable.'),
'$baseurl' => System::baseUrl(true),
// name, label, value, help string, extra data...
- '$sitename' => ['sitename', t("Site name"), $a->config['sitename'],''],
- '$hostname' => ['hostname', t("Host name"), $a->config['hostname'], ""],
- '$sender_email' => ['sender_email', t("Sender Email"), $a->config['sender_email'], t("The email address your server shall use to send notification emails from."), "", "", "email"],
- '$banner' => ['banner', t("Banner/Logo"), $banner, ""],
- '$shortcut_icon' => ['shortcut_icon', t("Shortcut icon"), Config::get('system','shortcut_icon'), t("Link to an icon that will be used for browsers.")],
- '$touch_icon' => ['touch_icon', t("Touch icon"), Config::get('system','touch_icon'), t("Link to an icon that will be used for tablets and mobiles.")],
- '$info' => ['info', t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())],
- '$language' => ['language', t("System language"), Config::get('system','language'), "", $lang_choices],
- '$theme' => ['theme', t("System theme"), Config::get('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices],
- '$theme_mobile' => ['theme_mobile', t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), t("Theme for mobile devices"), $theme_choices_mobile],
- '$ssl_policy' => ['ssl_policy', t("SSL link policy"), (string) intval(Config::get('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices],
- '$force_ssl' => ['force_ssl', t("Force SSL"), Config::get('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")],
- '$hide_help' => ['hide_help', t("Hide help entry from navigation menu"), Config::get('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")],
- '$singleuser' => ['singleuser', t("Single user instance"), Config::get('system', 'singleuser', '---'), t("Make this instance multi-user or single-user for the named user"), $user_names],
- '$maximagesize' => ['maximagesize', t("Maximum image size"), Config::get('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")],
- '$maximagelength' => ['maximagelength', t("Maximum image length"), Config::get('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")],
- '$jpegimagequality' => ['jpegimagequality', t("JPEG image quality"), Config::get('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")],
-
- '$register_policy' => ['register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices],
- '$daily_registrations' => ['max_daily_registrations', t("Maximum Daily Registrations"), Config::get('system', 'max_daily_registrations'), t("If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.")],
- '$register_text' => ['register_text', t("Register text"), $a->config['register_text'], t("Will be displayed prominently on the registration page.")],
- '$abandon_days' => ['abandon_days', t('Accounts abandoned after x days'), Config::get('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
- '$allowed_sites' => ['allowed_sites', t("Allowed friend domains"), Config::get('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")],
- '$allowed_email' => ['allowed_email', t("Allowed email domains"), Config::get('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")],
- '$no_oembed_rich_content' => ['no_oembed_rich_content', t("No OEmbed rich content"), Config::get('system','no_oembed_rich_content'), t("Don't show the rich content (e.g. embedded PDF), except from the domains listed below.")],
- '$allowed_oembed' => ['allowed_oembed', t("Allowed OEmbed domains"), Config::get('system','allowed_oembed'), t("Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.")],
- '$block_public' => ['block_public', t("Block public"), Config::get('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")],
- '$force_publish' => ['publish_all', t("Force publish"), Config::get('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")],
- '$global_directory' => ['directory', t("Global directory URL"), Config::get('system','directory'), t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")],
- '$newuser_private' => ['newuser_private', t("Private posts by default for new users"), Config::get('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")],
- '$enotify_no_content' => ['enotify_no_content', t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")],
- '$private_addons' => ['private_addons', t("Disallow public access to addons listed in the apps menu."), Config::get('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")],
- '$disable_embedded' => ['disable_embedded', t("Don't embed private images in posts"), Config::get('system','disable_embedded'), t("Don't replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.")],
- '$allow_users_remote_self' => ['allow_users_remote_self', t('Allow Users to set remote_self'), Config::get('system','allow_users_remote_self'), t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
- '$no_multi_reg' => ['no_multi_reg', t("Block multiple registrations"), Config::get('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")],
- '$no_openid' => ['no_openid', t("OpenID support"), !Config::get('system','no_openid'), t("OpenID support for registration and logins.")],
- '$no_regfullname' => ['no_regfullname', t("Fullname check"), !Config::get('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")],
- '$community_page_style' => ['community_page_style', t("Community pages for visitors"), Config::get('system','community_page_style'), t("Which community pages should be available for visitors. Local users always see both pages."), $community_page_style_choices],
- '$max_author_posts_community_page' => ['max_author_posts_community_page', t("Posts per user on community page"), Config::get('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")],
- '$ostatus_disabled' => ['ostatus_disabled', t("Enable OStatus support"), !Config::get('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")],
- '$ostatus_full_threads' => ['ostatus_full_threads', t("Only import OStatus threads from our contacts"), Config::get('system','ostatus_full_threads'), t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")],
- '$ostatus_not_able' => t("OStatus support can only be enabled if threading is enabled."),
+ '$sitename' => ['sitename', L10n::t("Site name"), $a->config['sitename'],''],
+ '$hostname' => ['hostname', L10n::t("Host name"), $a->config['hostname'], ""],
+ '$sender_email' => ['sender_email', L10n::t("Sender Email"), $a->config['sender_email'], L10n::t("The email address your server shall use to send notification emails from."), "", "", "email"],
+ '$banner' => ['banner', L10n::t("Banner/Logo"), $banner, ""],
+ '$shortcut_icon' => ['shortcut_icon', L10n::t("Shortcut icon"), Config::get('system','shortcut_icon'), L10n::t("Link to an icon that will be used for browsers.")],
+ '$touch_icon' => ['touch_icon', L10n::t("Touch icon"), Config::get('system','touch_icon'), L10n::t("Link to an icon that will be used for tablets and mobiles.")],
+ '$info' => ['info', L10n::t('Additional Info'), $info, L10n::t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())],
+ '$language' => ['language', L10n::t("System language"), Config::get('system','language'), "", $lang_choices],
+ '$theme' => ['theme', L10n::t("System theme"), Config::get('system','theme'), L10n::t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices],
+ '$theme_mobile' => ['theme_mobile', L10n::t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), L10n::t("Theme for mobile devices"), $theme_choices_mobile],
+ '$ssl_policy' => ['ssl_policy', L10n::t("SSL link policy"), (string) intval(Config::get('system','ssl_policy')), L10n::t("Determines whether generated links should be forced to use SSL"), $ssl_choices],
+ '$force_ssl' => ['force_ssl', L10n::t("Force SSL"), Config::get('system','force_ssl'), L10n::t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")],
+ '$hide_help' => ['hide_help', L10n::t("Hide help entry from navigation menu"), Config::get('system','hide_help'), L10n::t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")],
+ '$singleuser' => ['singleuser', L10n::t("Single user instance"), Config::get('system', 'singleuser', '---'), L10n::t("Make this instance multi-user or single-user for the named user"), $user_names],
+ '$maximagesize' => ['maximagesize', L10n::t("Maximum image size"), Config::get('system','maximagesize'), L10n::t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")],
+ '$maximagelength' => ['maximagelength', L10n::t("Maximum image length"), Config::get('system','max_image_length'), L10n::t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")],
+ '$jpegimagequality' => ['jpegimagequality', L10n::t("JPEG image quality"), Config::get('system','jpeg_quality'), L10n::t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")],
+
+ '$register_policy' => ['register_policy', L10n::t("Register policy"), $a->config['register_policy'], "", $register_choices],
+ '$daily_registrations' => ['max_daily_registrations', L10n::t("Maximum Daily Registrations"), Config::get('system', 'max_daily_registrations'), L10n::t("If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.")],
+ '$register_text' => ['register_text', L10n::t("Register text"), $a->config['register_text'], L10n::t("Will be displayed prominently on the registration page.")],
+ '$abandon_days' => ['abandon_days', L10n::t('Accounts abandoned after x days'), Config::get('system','account_abandon_days'), L10n::t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
+ '$allowed_sites' => ['allowed_sites', L10n::t("Allowed friend domains"), Config::get('system','allowed_sites'), L10n::t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")],
+ '$allowed_email' => ['allowed_email', L10n::t("Allowed email domains"), Config::get('system','allowed_email'), L10n::t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")],
+ '$no_oembed_rich_content' => ['no_oembed_rich_content', L10n::t("No OEmbed rich content"), Config::get('system','no_oembed_rich_content'), L10n::t("Don't show the rich content (e.g. embedded PDF), except from the domains listed below.")],
+ '$allowed_oembed' => ['allowed_oembed', L10n::t("Allowed OEmbed domains"), Config::get('system','allowed_oembed'), L10n::t("Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.")],
+ '$block_public' => ['block_public', L10n::t("Block public"), Config::get('system','block_public'), L10n::t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")],
+ '$force_publish' => ['publish_all', L10n::t("Force publish"), Config::get('system','publish_all'), L10n::t("Check to force all profiles on this site to be listed in the site directory.")],
+ '$global_directory' => ['directory', L10n::t("Global directory URL"), Config::get('system','directory'), L10n::t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")],
+ '$newuser_private' => ['newuser_private', L10n::t("Private posts by default for new users"), Config::get('system','newuser_private'), L10n::t("Set default post permissions for all new members to the default privacy group rather than public.")],
+ '$enotify_no_content' => ['enotify_no_content', L10n::t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), L10n::t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")],
+ '$private_addons' => ['private_addons', L10n::t("Disallow public access to addons listed in the apps menu."), Config::get('config','private_addons'), L10n::t("Checking this box will restrict addons listed in the apps menu to members only.")],
+ '$disable_embedded' => ['disable_embedded', L10n::t("Don't embed private images in posts"), Config::get('system','disable_embedded'), L10n::t("Don't replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.")],
+ '$allow_users_remote_self' => ['allow_users_remote_self', L10n::t('Allow Users to set remote_self'), Config::get('system','allow_users_remote_self'), L10n::t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
+ '$no_multi_reg' => ['no_multi_reg', L10n::t("Block multiple registrations"), Config::get('system','block_extended_register'), L10n::t("Disallow users to register additional accounts for use as pages.")],
+ '$no_openid' => ['no_openid', L10n::t("OpenID support"), !Config::get('system','no_openid'), L10n::t("OpenID support for registration and logins.")],
+ '$no_regfullname' => ['no_regfullname', L10n::t("Fullname check"), !Config::get('system','no_regfullname'), L10n::t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")],
+ '$community_page_style' => ['community_page_style', L10n::t("Community pages for visitors"), Config::get('system','community_page_style'), L10n::t("Which community pages should be available for visitors. Local users always see both pages."), $community_page_style_choices],
+ '$max_author_posts_community_page' => ['max_author_posts_community_page', L10n::t("Posts per user on community page"), Config::get('system','max_author_posts_community_page'), L10n::t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")],
+ '$ostatus_disabled' => ['ostatus_disabled', L10n::t("Enable OStatus support"), !Config::get('system','ostatus_disabled'), L10n::t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")],
+ '$ostatus_full_threads' => ['ostatus_full_threads', L10n::t("Only import OStatus threads from our contacts"), Config::get('system','ostatus_full_threads'), L10n::t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")],
+ '$ostatus_not_able' => L10n::t("OStatus support can only be enabled if threading is enabled."),
'$diaspora_able' => $diaspora_able,
- '$diaspora_not_able' => t("Diaspora support can't be enabled because Friendica was installed into a sub directory."),
- '$diaspora_enabled' => ['diaspora_enabled', t("Enable Diaspora support"), Config::get('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")],
- '$dfrn_only' => ['dfrn_only', t('Only allow Friendica contacts'), Config::get('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")],
- '$verifyssl' => ['verifyssl', t("Verify SSL"), Config::get('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")],
- '$proxyuser' => ['proxyuser', t("Proxy user"), Config::get('system','proxyuser'), ""],
- '$proxy' => ['proxy', t("Proxy URL"), Config::get('system','proxy'), ""],
- '$timeout' => ['timeout', t("Network timeout"), (x(Config::get('system','curl_timeout'))?Config::get('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")],
- '$maxloadavg' => ['maxloadavg', t("Maximum Load Average"), ((intval(Config::get('system','maxloadavg')) > 0)?Config::get('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")],
- '$maxloadavg_frontend' => ['maxloadavg_frontend', t("Maximum Load Average (Frontend)"), ((intval(Config::get('system','maxloadavg_frontend')) > 0)?Config::get('system','maxloadavg_frontend'):50), t("Maximum system load before the frontend quits service - default 50.")],
- '$min_memory' => ['min_memory', t("Minimal Memory"), ((intval(Config::get('system','min_memory')) > 0)?Config::get('system','min_memory'):0), t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).")],
- '$optimize_max_tablesize'=> ['optimize_max_tablesize', t("Maximum table size for optimization"), $optimize_max_tablesize, t("Maximum table size (in MB) for the automatic optimization - default 100 MB. Enter -1 to disable it.")],
- '$optimize_fragmentation'=> ['optimize_fragmentation', t("Minimum level of fragmentation"), ((intval(Config::get('system','optimize_fragmentation')) > 0)?Config::get('system','optimize_fragmentation'):30), t("Minimum fragmenation level to start the automatic optimization - default value is 30%.")],
-
- '$poco_completion' => ['poco_completion', t("Periodical check of global contacts"), Config::get('system','poco_completion'), t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")],
- '$poco_requery_days' => ['poco_requery_days', t("Days between requery"), Config::get('system','poco_requery_days'), t("Number of days after which a server is requeried for his contacts.")],
- '$poco_discovery' => ['poco_discovery', t("Discover contacts from other servers"), (string) intval(Config::get('system','poco_discovery')), t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommened setting is 'Users, Global Contacts'."), $poco_discovery_choices],
- '$poco_discovery_since' => ['poco_discovery_since', t("Timeframe for fetching global contacts"), (string) intval(Config::get('system','poco_discovery_since')), t("When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers."), $poco_discovery_since_choices],
- '$poco_local_search' => ['poco_local_search', t("Search the local directory"), Config::get('system','poco_local_search'), t("Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.")],
-
- '$nodeinfo' => ['nodeinfo', t("Publish server information"), Config::get('system','nodeinfo'), t("If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href='http://the-federation.info/'>the-federation.info</a> for details.")],
-
- '$check_new_version_url' => ['check_new_version_url', t("Check upstream version"), Config::get('system', 'check_new_version_url'), t("Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview."), $check_git_version_choices],
- '$suppress_tags' => ['suppress_tags', t("Suppress Tags"), Config::get('system','suppress_tags'), t("Suppress showing a list of hashtags at the end of the posting.")],
- '$itemcache' => ['itemcache', t("Path to item cache"), Config::get('system','itemcache'), t("The item caches buffers generated bbcode and external images.")],
- '$itemcache_duration' => ['itemcache_duration', t("Cache duration in seconds"), Config::get('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")],
- '$max_comments' => ['max_comments', t("Maximum numbers of comments per post"), Config::get('system','max_comments'), t("How much comments should be shown for each post? Default value is 100.")],
- '$temppath' => ['temppath', t("Temp path"), Config::get('system','temppath'), t("If you have a restricted system where the webserver can't access the system temp path, enter another path here.")],
- '$basepath' => ['basepath', t("Base path to installation"), Config::get('system','basepath'), t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot.")],
- '$proxy_disabled' => ['proxy_disabled', t("Disable picture proxy"), Config::get('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")],
- '$only_tag_search' => ['only_tag_search', t("Only search in tags"), Config::get('system','only_tag_search'), t("On large systems the text search can slow down the system extremely.")],
-
- '$relocate_url' => ['relocate_url', t("New base url"), System::baseUrl(), t("Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.")],
-
- '$rino' => ['rino', t("RINO Encryption"), intval(Config::get('system','rino_encrypt')), t("Encryption layer between nodes."), [0 => "Disabled", 1 => "Enabled"]],
-
- '$worker_queues' => ['worker_queues', t("Maximum number of parallel workers"), Config::get('system','worker_queues'), t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")],
- '$worker_dont_fork' => ['worker_dont_fork', t("Don't use 'proc_open' with the worker"), Config::get('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.")],
- '$worker_fastlane' => ['worker_fastlane', t("Enable fastlane"), Config::get('system','worker_fastlane'), t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")],
- '$worker_frontend' => ['worker_frontend', t('Enable frontend worker'), Config::get('system','frontend_worker'), t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', System::baseUrl())],
+ '$diaspora_not_able' => L10n::t("Diaspora support can't be enabled because Friendica was installed into a sub directory."),
+ '$diaspora_enabled' => ['diaspora_enabled', L10n::t("Enable Diaspora support"), Config::get('system','diaspora_enabled'), L10n::t("Provide built-in Diaspora network compatibility.")],
+ '$dfrn_only' => ['dfrn_only', L10n::t('Only allow Friendica contacts'), Config::get('system','dfrn_only'), L10n::t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")],
+ '$verifyssl' => ['verifyssl', L10n::t("Verify SSL"), Config::get('system','verifyssl'), L10n::t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")],
+ '$proxyuser' => ['proxyuser', L10n::t("Proxy user"), Config::get('system','proxyuser'), ""],
+ '$proxy' => ['proxy', L10n::t("Proxy URL"), Config::get('system','proxy'), ""],
+ '$timeout' => ['timeout', L10n::t("Network timeout"), (x(Config::get('system','curl_timeout'))?Config::get('system','curl_timeout'):60), L10n::t("Value is in seconds. Set to 0 for unlimited (not recommended).")],
+ '$maxloadavg' => ['maxloadavg', L10n::t("Maximum Load Average"), ((intval(Config::get('system','maxloadavg')) > 0)?Config::get('system','maxloadavg'):50), L10n::t("Maximum system load before delivery and poll processes are deferred - default 50.")],
+ '$maxloadavg_frontend' => ['maxloadavg_frontend', L10n::t("Maximum Load Average (Frontend)"), ((intval(Config::get('system','maxloadavg_frontend')) > 0)?Config::get('system','maxloadavg_frontend'):50), L10n::t("Maximum system load before the frontend quits service - default 50.")],
+ '$min_memory' => ['min_memory', L10n::t("Minimal Memory"), ((intval(Config::get('system','min_memory')) > 0)?Config::get('system','min_memory'):0), L10n::t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).")],
+ '$optimize_max_tablesize'=> ['optimize_max_tablesize', L10n::t("Maximum table size for optimization"), $optimize_max_tablesize, L10n::t("Maximum table size (in MB) for the automatic optimization - default 100 MB. Enter -1 to disable it.")],
+ '$optimize_fragmentation'=> ['optimize_fragmentation', L10n::t("Minimum level of fragmentation"), ((intval(Config::get('system','optimize_fragmentation')) > 0)?Config::get('system','optimize_fragmentation'):30), L10n::t("Minimum fragmenation level to start the automatic optimization - default value is 30%.")],
+
+ '$poco_completion' => ['poco_completion', L10n::t("Periodical check of global contacts"), Config::get('system','poco_completion'), L10n::t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")],
+ '$poco_requery_days' => ['poco_requery_days', L10n::t("Days between requery"), Config::get('system','poco_requery_days'), L10n::t("Number of days after which a server is requeried for his contacts.")],
+ '$poco_discovery' => ['poco_discovery', L10n::t("Discover contacts from other servers"), (string) intval(Config::get('system','poco_discovery')), L10n::t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommened setting is 'Users, Global Contacts'."), $poco_discovery_choices],
+ '$poco_discovery_since' => ['poco_discovery_since', L10n::t("Timeframe for fetching global contacts"), (string) intval(Config::get('system','poco_discovery_since')), L10n::t("When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers."), $poco_discovery_since_choices],
+ '$poco_local_search' => ['poco_local_search', L10n::t("Search the local directory"), Config::get('system','poco_local_search'), L10n::t("Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.")],
+
+ '$nodeinfo' => ['nodeinfo', L10n::t("Publish server information"), Config::get('system','nodeinfo'), L10n::t("If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href='http://the-federation.info/'>the-federation.info</a> for details.")],
+
+ '$check_new_version_url' => ['check_new_version_url', L10n::t("Check upstream version"), Config::get('system', 'check_new_version_url'), L10n::t("Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview."), $check_git_version_choices],
+ '$suppress_tags' => ['suppress_tags', L10n::t("Suppress Tags"), Config::get('system','suppress_tags'), L10n::t("Suppress showing a list of hashtags at the end of the posting.")],
+ '$itemcache' => ['itemcache', L10n::t("Path to item cache"), Config::get('system','itemcache'), L10n::t("The item caches buffers generated bbcode and external images.")],
+ '$itemcache_duration' => ['itemcache_duration', L10n::t("Cache duration in seconds"), Config::get('system','itemcache_duration'), L10n::t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")],
+ '$max_comments' => ['max_comments', L10n::t("Maximum numbers of comments per post"), Config::get('system','max_comments'), L10n::t("How much comments should be shown for each post? Default value is 100.")],
+ '$temppath' => ['temppath', L10n::t("Temp path"), Config::get('system','temppath'), L10n::t("If you have a restricted system where the webserver can't access the system temp path, enter another path here.")],
+ '$basepath' => ['basepath', L10n::t("Base path to installation"), Config::get('system','basepath'), L10n::t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot.")],
+ '$proxy_disabled' => ['proxy_disabled', L10n::t("Disable picture proxy"), Config::get('system','proxy_disabled'), L10n::t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")],
+ '$only_tag_search' => ['only_tag_search', L10n::t("Only search in tags"), Config::get('system','only_tag_search'), L10n::t("On large systems the text search can slow down the system extremely.")],
+
+ '$relocate_url' => ['relocate_url', L10n::t("New base url"), System::baseUrl(), L10n::t("Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.")],
+
+ '$rino' => ['rino', L10n::t("RINO Encryption"), intval(Config::get('system','rino_encrypt')), L10n::t("Encryption layer between nodes."), [0 => "Disabled", 1 => "Enabled"]],
+
+ '$worker_queues' => ['worker_queues', L10n::t("Maximum number of parallel workers"), Config::get('system','worker_queues'), L10n::t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")],
+ '$worker_dont_fork' => ['worker_dont_fork', L10n::t("Don't use 'proc_open' with the worker"), Config::get('system','worker_dont_fork'), L10n::t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.")],
+ '$worker_fastlane' => ['worker_fastlane', L10n::t("Enable fastlane"), Config::get('system','worker_fastlane'), L10n::t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")],
+ '$worker_frontend' => ['worker_frontend', L10n::t('Enable frontend worker'), Config::get('system','frontend_worker'), L10n::t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', System::baseUrl())],
'$form_security_token' => get_form_security_token("admin_site")
]);
if (intval($curr) == intval($a->argv[3])) {
Config::set('system', 'build', intval($curr) + 1);
}
- info(t('Update has been marked successful') . EOL);
+ info(L10n::t('Update has been marked successful') . EOL);
goaway('admin/dbsync');
}
if (($a->argc > 2) && (intval($a->argv[2]) || ($a->argv[2] === 'check'))) {
$retval = DBStructure::update(false, true);
if ($retval === '') {
- $o .= t("Database structure update %s was successfully applied.", DB_UPDATE_VERSION) . "<br />";
+ $o .= L10n::t("Database structure update %s was successfully applied.", DB_UPDATE_VERSION) . "<br />";
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
} else {
- $o .= t("Executing of database structure update %s failed with error: %s", DB_UPDATE_VERSION, $retval) . "<br />";
+ $o .= L10n::t("Executing of database structure update %s failed with error: %s", DB_UPDATE_VERSION, $retval) . "<br />";
}
if ($a->argv[2] === 'check') {
return $o;
if (function_exists($func)) {
$retval = $func();
if ($retval === UPDATE_FAILED) {
- $o .= t("Executing %s failed with error: %s", $func, $retval);
+ $o .= L10n::t("Executing %s failed with error: %s", $func, $retval);
} elseif ($retval === UPDATE_SUCCESS) {
- $o .= t('Update %s was successfully applied.', $func);
+ $o .= L10n::t('Update %s was successfully applied.', $func);
Config::set('database', $func, 'success');
} else {
- $o .= t('Update %s did not return a status. Unknown if it succeeded.', $func);
+ $o .= L10n::t('Update %s did not return a status. Unknown if it succeeded.', $func);
}
} else {
- $o .= t('There was no additional update function %s that needed to be called.', $func) . "<br />";
+ $o .= L10n::t('There was no additional update function %s that needed to be called.', $func) . "<br />";
Config::set('database', $func, 'success');
}
return $o;
if (!count($failed)) {
$o = replace_macros(get_markup_template('structure_check.tpl'), [
'$base' => System::baseUrl(true),
- '$banner' => t('No failed updates.'),
- '$check' => t('Check database structure'),
+ '$banner' => L10n::t('No failed updates.'),
+ '$check' => L10n::t('Check database structure'),
]);
} else {
$o = replace_macros(get_markup_template('failed_updates.tpl'), [
'$base' => System::baseUrl(true),
- '$banner' => t('Failed Updates'),
- '$desc' => t('This does not include updates prior to 1139, which did not return a status.'),
- '$mark' => t('Mark success (if update was manually applied)'),
- '$apply' => t('Attempt to execute this update step automatically'),
+ '$banner' => L10n::t('Failed Updates'),
+ '$desc' => L10n::t('This does not include updates prior to 1139, which did not return a status.'),
+ '$mark' => L10n::t('Mark success (if update was manually applied)'),
+ '$apply' => L10n::t('Attempt to execute this update step automatically'),
'$failed' => $failed
]);
}
}
$user = $result['user'];
- $preamble = deindent(t('
+ $preamble = deindent(L10n::t('
Dear %1$s,
the administrator of %2$s has set up an account for you.'));
- $body = deindent(t('
+ $body = deindent(L10n::t('
The login details are as follows:
Site Location: %1$s
notification([
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
- 'subject' => t('Registration details for %s', $a->config['sitename']),
+ 'subject' => L10n::t('Registration details for %s', $a->config['sitename']),
'preamble' => $preamble,
'body' => $body]);
}
q("UPDATE `user` SET `blocked` = 1-`blocked` WHERE `uid` = %s", intval($uid)
);
}
- notice(tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)));
+ notice(L10n::tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)));
}
if (x($_POST, 'page_users_delete')) {
foreach ($users as $uid) {
User::remove($uid);
}
- notice(tt("%s user deleted", "%s users deleted", count($users)));
+ notice(L10n::tt("%s user deleted", "%s users deleted", count($users)));
}
if (x($_POST, 'page_users_approve')) {
// delete user
User::remove($uid);
- notice(t("User '%s' deleted", $user['username']) . EOL);
+ notice(L10n::t("User '%s' deleted", $user['username']) . EOL);
break;
case "block":
check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
intval(1 - $user['blocked']),
intval($uid)
);
- notice(sprintf(($user['blocked'] ? t("User '%s' unblocked") : t("User '%s' blocked")), $user['username']) . EOL);
+ notice(sprintf(($user['blocked'] ? L10n::t("User '%s' unblocked") : L10n::t("User '%s' blocked")), $user['username']) . EOL);
break;
}
goaway('admin/users');
$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
$_setup_users = function ($e) use ($adminlist) {
$accounts = [
- t('Normal Account'),
- t('Automatic Follower Account'),
- t('Public Forum Account'),
- t('Automatic Friend Account')
+ L10n::t('Normal Account'),
+ L10n::t('Automatic Follower Account'),
+ L10n::t('Public Forum Account'),
+ L10n::t('Automatic Friend Account')
];
$e['page-flags'] = $accounts[$e['page-flags']];
$e['register_date'] = relative_date($e['register_date']);
array_push($users, array_pop($tmp_users));
}
- $th_users = array_map(null, [t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')], $valid_orders
+ $th_users = array_map(null, [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Account')], $valid_orders
);
$t = get_markup_template('admin/users.tpl');
$o = replace_macros($t, [
// strings //
- '$title' => t('Administration'),
- '$page' => t('Users'),
- '$submit' => t('Add User'),
- '$select_all' => t('select all'),
- '$h_pending' => t('User registrations waiting for confirm'),
- '$h_deleted' => t('User waiting for permanent deletion'),
- '$th_pending' => [t('Request date'), t('Name'), t('Email')],
- '$no_pending' => t('No registrations.'),
- '$pendingnotetext' => t('Note from the user'),
- '$approve' => t('Approve'),
- '$deny' => t('Deny'),
- '$delete' => t('Delete'),
- '$block' => t('Block'),
- '$unblock' => t('Unblock'),
- '$siteadmin' => t('Site admin'),
- '$accountexpired' => t('Account expired'),
-
- '$h_users' => t('Users'),
- '$h_newuser' => t('New User'),
- '$th_deleted' => [t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since')],
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Users'),
+ '$submit' => L10n::t('Add User'),
+ '$select_all' => L10n::t('select all'),
+ '$h_pending' => L10n::t('User registrations waiting for confirm'),
+ '$h_deleted' => L10n::t('User waiting for permanent deletion'),
+ '$th_pending' => [L10n::t('Request date'), L10n::t('Name'), L10n::t('Email')],
+ '$no_pending' => L10n::t('No registrations.'),
+ '$pendingnotetext' => L10n::t('Note from the user'),
+ '$approve' => L10n::t('Approve'),
+ '$deny' => L10n::t('Deny'),
+ '$delete' => L10n::t('Delete'),
+ '$block' => L10n::t('Block'),
+ '$unblock' => L10n::t('Unblock'),
+ '$siteadmin' => L10n::t('Site admin'),
+ '$accountexpired' => L10n::t('Account expired'),
+
+ '$h_users' => L10n::t('Users'),
+ '$h_newuser' => L10n::t('New User'),
+ '$th_deleted' => [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Deleted since')],
'$th_users' => $th_users,
'$order_users' => $order,
'$order_direction_users' => $order_direction,
- '$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
- '$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
+ '$confirm_delete_multi' => L10n::t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
+ '$confirm_delete' => L10n::t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => get_form_security_token("admin_users"),
'$pending' => $pending,
'deleted' => $deleted,
'$users' => $users,
- '$newusername' => ['new_user_name', t("Name"), '', t("Name of the new user.")],
- '$newusernickname' => ['new_user_nickname', t("Nickname"), '', t("Nickname of the new user.")],
- '$newuseremail' => ['new_user_email', t("Email"), '', t("Email address of the new user."), '', '', 'email'],
+ '$newusername' => ['new_user_name', L10n::t("Name"), '', L10n::t("Name of the new user.")],
+ '$newusernickname' => ['new_user_nickname', L10n::t("Nickname"), '', L10n::t("Nickname of the new user.")],
+ '$newuseremail' => ['new_user_email', L10n::t("Email"), '', L10n::t("Email address of the new user."), '', '', 'email'],
]);
$o .= paginate($a);
return $o;
if ($a->argc == 3) {
$addon = $a->argv[2];
if (!is_file("addon/$addon/$addon.php")) {
- notice(t("Item not found."));
+ notice(L10n::t("Item not found."));
return '';
}
if ($idx !== false) {
unset($a->addons[$idx]);
Addon::uninstall($addon);
- info(t("Addon %s disabled.", $addon));
+ info(L10n::t("Addon %s disabled.", $addon));
} else {
$a->addons[] = $addon;
Addon::install($addon);
- info(t("Addon %s enabled.", $addon));
+ info(L10n::t("Addon %s enabled.", $addon));
}
Config::set("system", "addon", implode(", ", $a->addons));
goaway('admin/addons');
// display addon details
if (in_array($addon, $a->addons)) {
$status = "on";
- $action = t("Disable");
+ $action = L10n::t("Disable");
} else {
$status = "off";
- $action = t("Enable");
+ $action = L10n::t("Enable");
}
- $readme = Null;
+ $readme = null;
if (is_file("addon/$addon/README.md")) {
$readme = Markdown::convert(file_get_contents("addon/$addon/README.md"), false);
} elseif (is_file("addon/$addon/README")) {
$t = get_markup_template('admin/plugins_details.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Addons'),
- '$toggle' => t('Toggle'),
- '$settings' => t('Settings'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Addons'),
+ '$toggle' => L10n::t('Toggle'),
+ '$settings' => L10n::t('Settings'),
'$baseurl' => System::baseUrl(true),
'$addon' => $addon,
'$status' => $status,
'$action' => $action,
'$info' => Addon::getInfo($addon),
- '$str_author' => t('Author: '),
- '$str_maintainer' => t('Maintainer: '),
+ '$str_author' => L10n::t('Author: '),
+ '$str_maintainer' => L10n::t('Maintainer: '),
'$admin_form' => $admin_form,
'$function' => 'addons',
$t = get_markup_template('admin/addons.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Addons'),
- '$submit' => t('Save Settings'),
- '$reload' => t('Reload active addons'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Addons'),
+ '$submit' => L10n::t('Save Settings'),
+ '$reload' => L10n::t('Reload active addons'),
'$baseurl' => System::baseUrl(true),
'$function' => 'addons',
'$addons' => $addons,
'$pcount' => count($addons),
- '$noplugshint' => t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
+ '$noplugshint' => L10n::t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
'$form_security_token' => get_form_security_token("admin_themes"),
]);
}
}
if (!count($themes)) {
- notice(t('No themes found.'));
+ notice(L10n::t('No themes found.'));
return '';
}
if ($a->argc == 3) {
$theme = $a->argv[2];
if (!is_dir("view/theme/$theme")) {
- notice(t("Item not found."));
+ notice(L10n::t("Item not found."));
return '';
}
// display theme details
if (theme_status($themes, $theme)) {
$status = "on";
- $action = t("Disable");
+ $action = L10n::t("Disable");
} else {
$status = "off";
- $action = t("Enable");
+ $action = L10n::t("Enable");
}
$readme = null;
$a->page = $orig_page;
}
- $screenshot = [Theme::getScreenshot($theme), t('Screenshot')];
+ $screenshot = [Theme::getScreenshot($theme), L10n::t('Screenshot')];
if (!stristr($screenshot[0], $theme)) {
$screenshot = null;
}
$t = get_markup_template('admin/plugins_details.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Themes'),
- '$toggle' => t('Toggle'),
- '$settings' => t('Settings'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Themes'),
+ '$toggle' => L10n::t('Toggle'),
+ '$settings' => L10n::t('Settings'),
'$baseurl' => System::baseUrl(true),
'$addon' => $theme,
'$status' => $status,
'$info' => Theme::getInfo($theme),
'$function' => 'themes',
'$admin_form' => $admin_form,
- '$str_author' => t('Author: '),
- '$str_maintainer' => t('Maintainer: '),
+ '$str_author' => L10n::t('Author: '),
+ '$str_maintainer' => L10n::t('Maintainer: '),
'$screenshot' => $screenshot,
'$readme' => $readme,
$t = get_markup_template('admin/addons.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Themes'),
- '$submit' => t('Save Settings'),
- '$reload' => t('Reload active themes'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Themes'),
+ '$submit' => L10n::t('Save Settings'),
+ '$reload' => L10n::t('Reload active themes'),
'$baseurl' => System::baseUrl(true),
'$function' => 'themes',
'$addons' => $addons,
'$pcount' => count($themes),
- '$noplugshint' => t('No themes found on the system. They should be placed in %1$s', '<code>/view/themes</code>'),
- '$experimental' => t('[Experimental]'),
- '$unsupported' => t('[Unsupported]'),
+ '$noplugshint' => L10n::t('No themes found on the system. They should be placed in %1$s', '<code>/view/themes</code>'),
+ '$experimental' => L10n::t('[Experimental]'),
+ '$unsupported' => L10n::t('[Unsupported]'),
'$form_security_token' => get_form_security_token("admin_themes"),
]);
}
Config::set('system', 'loglevel', $loglevel);
}
- info(t("Log settings updated."));
+ info(L10n::t("Log settings updated."));
goaway('admin/logs');
return; // NOTREACHED
}
];
if (ini_get('log_errors')) {
- $phplogenabled = t('PHP log currently enabled.');
+ $phplogenabled = L10n::t('PHP log currently enabled.');
} else {
- $phplogenabled = t('PHP log currently disabled.');
+ $phplogenabled = L10n::t('PHP log currently disabled.');
}
$t = get_markup_template('admin/logs.tpl');
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('Logs'),
- '$submit' => t('Save Settings'),
- '$clear' => t('Clear'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('Logs'),
+ '$submit' => L10n::t('Save Settings'),
+ '$clear' => L10n::t('Clear'),
'$baseurl' => System::baseUrl(true),
'$logname' => Config::get('system', 'logfile'),
// name, label, value, help string, extra data...
- '$debugging' => ['debugging', t("Enable Debugging"), Config::get('system', 'debugging'), ""],
- '$logfile' => ['logfile', t("Log file"), Config::get('system', 'logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")],
- '$loglevel' => ['loglevel', t("Log level"), Config::get('system', 'loglevel'), "", $log_choices],
+ '$debugging' => ['debugging', L10n::t("Enable Debugging"), Config::get('system', 'debugging'), ""],
+ '$logfile' => ['logfile', L10n::t("Log file"), Config::get('system', 'logfile'), L10n::t("Must be writable by web server. Relative to your Friendica top-level directory.")],
+ '$loglevel' => ['loglevel', L10n::t("Log level"), Config::get('system', 'loglevel'), "", $log_choices],
'$form_security_token' => get_form_security_token("admin_logs"),
- '$phpheader' => t("PHP logging"),
- '$phphint' => t("To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
+ '$phpheader' => L10n::t("PHP logging"),
+ '$phphint' => L10n::t("To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
'$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE);\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
'$phplogenabled' => $phplogenabled,
]);
$data = '';
if (!file_exists($f)) {
- $data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is readable.");
+ $data = L10n::t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is readable.");
} else {
$fp = fopen($f, 'r');
if (!$fp) {
- $data = t("Couldn't open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f is readable.");
+ $data = L10n::t("Couldn't open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f is readable.");
} else {
$fstat = fstat($fp);
$size = $fstat['size'];
}
}
return replace_macros($t, [
- '$title' => t('Administration'),
- '$page' => t('View Logs'),
+ '$title' => L10n::t('Administration'),
+ '$page' => L10n::t('View Logs'),
'$data' => $data,
'$logname' => Config::get('system', 'logfile')
]);
foreach (array_slice($fdata, 1) as $f) {
$set = Config::get('feature', $f[0], $f[3]);
$arr[$fname][1][] = [
- ['feature_' . $f[0], $f[1], $set, $f[2], [t('Off'), t('On')]],
- ['featurelock_' . $f[0], t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [t('Off'), t('On')]]
+ ['feature_' . $f[0], $f[1], $set, $f[2], [L10n::t('Off'), L10n::t('On')]],
+ ['featurelock_' . $f[0], L10n::t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [L10n::t('Off'), L10n::t('On')]]
];
}
}
$tpl = get_markup_template('admin/settings_features.tpl');
$o = replace_macros($tpl, [
'$form_security_token' => get_form_security_token("admin_manage_features"),
- '$title' => t('Manage Additional Features'),
+ '$title' => L10n::t('Manage Additional Features'),
'$features' => $arr,
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
]);
return $o;
*/
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';
{
$o = '';
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$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;
}
} 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]
];
}
'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,
];
$tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl, [
- //'$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])),
+ //'$title' => L10n::t('Friends of %s', htmlentities($c[0]['name'])),
'$tab_str' => $tab_str,
'$contacts' => $entries,
'$paginate' => paginate($a),
<?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)
{
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];
}
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;
}
}
$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,
]);
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);
$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;
<?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');
<?php
-
+/**
+ * @file mod/attach.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
-require_once('include/security.php');
-
-function attach_init(App $a) {
+require_once 'include/dba.php';
+require_once 'include/security.php';
- 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;
}
// 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
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;
}
// 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();
<?php
-
+/**
+ * @file mod/babel.php
+ */
use Friendica\Content\Text\Markdown;
+use Friendica\Core\L10n;
require_once 'include/bbcode.php';
require_once 'include/bb2diaspora.php';
require_once 'include/html2bbcode.php';
-require_once 'include/pgettext.php';
function visible_lf($s)
{
$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>';
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;
}
<?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()
{
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;
}
$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>";
}
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;
$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;
}
$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')) {
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);
}
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
// 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();
}
*/
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';
$zcid = 0;
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
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;
}
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');
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
$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;
}
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 {
}
if (!in_array($content, ['local', 'global'])) {
- notice(t('Community option not available.') . EOL);
+ notice(L10n::t('Community option not available.') . EOL);
return;
}
}
if (!$available) {
- notice(t('Not available.') . EOL);
+ notice(L10n::t('Not available.') . EOL);
return;
}
}
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'
];
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'
];
$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;
}
'$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 node’s 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 node’s users.")
]);
}
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;
'$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'])
]);
}
}
if ($count_actions > 0) {
- info(tt("%d contact edited.", "%d contacts edited.", $count_actions));
+ info(L10n::tt("%d contact edited.", "%d contacts edited.", $count_actions));
}
if (x($_SESSION, 'return_url')) {
}
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
}
$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;
}
}
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()]);
Nav::setSelected('contacts');
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$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
}
$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);
$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);
$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);
$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
}
_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 {
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;
$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')
]
];
}
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");
}
}
$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];
$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',
],
$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),
]);
// 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',
]
// 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'];
}
// 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'
];
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;
}
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,
// 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' => '',
if ($poll_enabled) {
$contact_actions['update'] = [
- 'label' => t('Update now'),
+ 'label' => L10n::t('Update now'),
'url' => 'contacts/' . $contact['id'] . '/update',
'title' => '',
'sel' => '',
}
$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',
];
<?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()
{
$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,
]);
}
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
}
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;
function crepair_content(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
}
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";
}
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]);
'$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;
<?php
-
+/**
+ * @file mod/delegate.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
function delegate_content(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
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;
}
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.')
]);
<?php
-
/**
* @file mod/dfrn_confirm.php
* @brief Module: dfrn_confirm
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
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;
}
);
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;
}
// 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;
}
$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.
);
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)) {
/// @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
$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>';
// 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
}
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);
}
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
}
$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
}
$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);
}
}
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
}
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);
}
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);
}
'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),
$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");
$_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(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(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
}
// Visitors get 1 day session.
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
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];
$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) {
- notice(sprintf(tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid), $invalid) . EOL);
+ notice(L10n::tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
return;
}
}
}
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",
}
// invalid/bogus request
- notice(t('Unrecoverable protocol error.') . EOL);
+ notice(L10n::t('Unrecoverable protocol error.') . EOL);
goaway(System::baseUrl());
return; // NOTREACHED
}
*
*/
if (!(is_array($a->profile) && count($a->profile))) {
- notice(t('Profile unavailable.') . EOL);
+ notice(L10n::t('Profile unavailable.') . EOL);
return;
}
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(t('Spam protection measures have been invoked.') . EOL);
- notice(t('Friends are advised to please try again in 24 hours.') . EOL);
+ notice(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;
}
}
$url = trim($_POST['dfrn_url']);
if (!strlen($url)) {
- notice(t("Invalid locator") . EOL);
+ notice(L10n::t("Invalid locator") . EOL);
return;
}
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);
+ notice(L10n::t('Apparently you are already friends with %s.', $a->profile['name']) . EOL);
return;
} else {
$contact_record = $ret[0];
} 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
}
$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) {
- notice(sprintf(tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid), $invalid) . EOL);
+ notice(L10n::tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
return;
}
}
}
if ($r === false) {
- notice(t('Failed to update contact record.') . EOL);
+ notice(L10n::t('Failed to update contact record.') . EOL);
return;
}
// 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.
// 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;
// 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();
}
// 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();
}
$_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);
$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'),
+ '$welcome' => L10n::t('Welcome home %s.', $a->user['username']),
+ '$please' => L10n::t('Please confirm your introduction/connection request to %s.', $dfrn_url),
+ '$submit' => L10n::t('Confirm'),
'$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'],
'dfrn_rawurl' => $_GET['dfrn_url']
'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,
// 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;
}
}
$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>.'),
+ L10n::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>.'),
get_server() . '/servers'
);
$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', 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' => t('Friendica'),
- '$statusnet' => t('GNU Social (Pleroma, Mastodon)'),
- '$diaspora' => 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:'),
+ '$friendica' => L10n::t('Friendica'),
+ '$statusnet' => L10n::t('GNU Social (Pleroma, Mastodon)'),
+ '$diaspora' => L10n::t('Diaspora (Socialhome, Hubzilla)'),
+ '$diasnote' => 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' => 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
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;
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;
}
}
// 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;
|| (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;
$photo_menu = [
- 'profile' => [t("View Profile"), Profile::zrl($profile_link)]
+ 'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
];
$entry = [
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;
}
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;
function dirfind_init(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
return;
}
if (strpos($search,'@') === 0) {
$search = substr($search,1);
- $header = sprintf( t('People Search - %s'), $search);
+ $header = 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);
if (strpos($search,'!') === 0) {
$search = substr($search,1);
$community = true;
- $header = sprintf( t('Forum Search - %s'), $search);
+ $header = L10n::t('Forum Search - %s', $search);
}
$o = '';
}
} 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]
+ 'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
+ 'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
}
]);
} else {
- info( t('No matches') . EOL);
+ info(L10n::t('No matches') . EOL);
}
}
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
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')) {
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;
}
if (!$item_id) {
$a->error = 404;
- notice(t('Item not found.').EOL);
+ notice(L10n::t('Item not found.').EOL);
return;
}
$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;
}
);
if (!DBM::is_result($r)) {
- notice(t('Item not found.') . EOL);
+ notice(L10n::t('Item not found.') . EOL);
return $o;
}
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;
}
);
if (! DBM::is_result($itm)) {
- notice( t('Item not found') . EOL);
+ notice(L10n::t('Item not found') . EOL);
return;
}
$o .= replace_macros(get_markup_template("section_title.tpl"),[
- '$title' => t('Edit post')
+ '$title' => L10n::t('Edit post')
]);
$tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
- '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
+ '$ispublic' => ' ', // L10n::t('Visible to <strong>everybody</strong>'),
'$geotag' => $geotag,
'$nickname' => $a->user['nickname']
]);
$tpl = get_markup_template('jot-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
- '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
+ '$ispublic' => ' ', // L10n::t('Visible to <strong>everybody</strong>'),
'$geotag' => $geotag,
'$nickname' => $a->user['nickname']
]);
/* if($mail_enabled) {
$selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
- . t("Post to Email") . '</div>';
+ . L10n::t("Post to Email") . '</div>';
}*/
'$is_edit' => true,
'$return_path' => $_SESSION['return_url'],
'$action' => 'item',
- '$share' => t('Save'),
- '$upload' => t('Upload photo'),
- '$shortupload' => t('upload photo'),
- '$attach' => t('Attach file'),
- '$shortattach' => t('attach file'),
- '$weblink' => t('Insert web link'),
- '$shortweblink' => t('web link'),
- '$video' => t('Insert video link'),
- '$shortvideo' => t('video link'),
- '$audio' => t('Insert audio link'),
- '$shortaudio' => t('audio link'),
- '$setloc' => t('Set your location'),
- '$shortsetloc' => t('set location'),
- '$noloc' => t('Clear browser location'),
- '$shortnoloc' => t('clear location'),
- '$wait' => t('Please wait'),
- '$permset' => t('Permission settings'),
+ '$share' => L10n::t('Save'),
+ '$upload' => L10n::t('Upload photo'),
+ '$shortupload' => L10n::t('upload photo'),
+ '$attach' => L10n::t('Attach file'),
+ '$shortattach' => L10n::t('attach file'),
+ '$weblink' => L10n::t('Insert web link'),
+ '$shortweblink' => L10n::t('web link'),
+ '$video' => L10n::t('Insert video link'),
+ '$shortvideo' => L10n::t('video link'),
+ '$audio' => L10n::t('Insert audio link'),
+ '$shortaudio' => L10n::t('audio link'),
+ '$setloc' => L10n::t('Set your location'),
+ '$shortsetloc' => L10n::t('set location'),
+ '$noloc' => L10n::t('Clear browser location'),
+ '$shortnoloc' => L10n::t('clear location'),
+ '$wait' => L10n::t('Please wait'),
+ '$permset' => L10n::t('Permission settings'),
'$ptyp' => $itm[0]['type'],
'$content' => undo_post_tagging($itm[0]['body']),
'$post_id' => $post_id,
'$defloc' => $a->user['default-location'],
'$visitor' => 'none',
'$pvisit' => 'none',
- '$emailcc' => t('CC: email addresses'),
- '$public' => t('Public post'),
+ '$emailcc' => L10n::t('CC: email addresses'),
+ '$public' => L10n::t('Public post'),
'$jotnets' => $jotnets,
'$title' => htmlspecialchars($itm[0]['title']),
- '$placeholdertitle' => t('Set title'),
+ '$placeholdertitle' => L10n::t('Set title'),
'$category' => file_tag_file_to_list($itm[0]['file'], 'category'),
- '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? t('Categories (comma-separated list)') : ''),
- '$emtitle' => t('Example: bob@example.com, mary@example.com'),
+ '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? L10n::t('Categories (comma-separated list)') : ''),
+ '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
'$bang' => (($group) ? '!' : ''),
'$profile_uid' => $_SESSION['uid'],
- '$preview' => t('Preview'),
+ '$preview' => L10n::t('Preview'),
'$jotplugins' => $jotplugins,
- '$sourceapp' => t($a->sourcename),
- '$cancel' => t('Cancel'),
+ '$sourceapp' => L10n::t($a->sourcename),
+ '$cancel' => L10n::t('Cancel'),
'$rand_num' => random_digits(12),
//jot nav tab (used in some themes)
- '$message' => t('Message'),
- '$browser' => t('Browser'),
- '$shortpermset' => t('permissions'),
+ '$message' => L10n::t('Message'),
+ '$browser' => L10n::t('Browser'),
+ '$shortpermset' => L10n::t('permissions'),
]);
return $o;
-
}
-
-
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;
$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.');
+ echo L10n::t('Event can not end before it has started.');
killme();
}
goaway($onerror_url);
}
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.');
+ echo L10n::t('Event title and start time are required.');
killme();
}
goaway($onerror_url);
function events_content(App $a) {
if (! local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$tabs' => $tabs,
- '$title' => t('Events'),
- '$view' => t('View'),
- '$new_event' => [System::baseUrl() . '/events/new', t('Create New Event'), '', ''],
- '$previous' => [System::baseUrl() . '/events/$prevyear/$prevmonth', t('Previous'), '', ''],
- '$next' => [System::baseUrl() . '/events/$nextyear/$nextmonth', t('Next'), '', ''],
+ '$title' => L10n::t('Events'),
+ '$view' => L10n::t('View'),
+ '$new_event' => [System::baseUrl() . '/events/new', L10n::t('Create New Event'), '', ''],
+ '$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')) {
'$deny_cid' => json_encode($perms['deny_cid']),
'$deny_gid' => json_encode($perms['deny_gid']),
- '$title' => t('Event details'),
- '$desc' => t('Starting date and Title are required.'),
- '$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>',
- '$s_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), t('Event Starts:'), 'start_text', true, true, '', '', true),
- '$n_text' => t('Finish date/time is not known or not relevant'),
+ '$title' => L10n::t('Event details'),
+ '$desc' => L10n::t('Starting date and Title are required.'),
+ '$s_text' => L10n::t('Event Starts:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
+ '$s_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), L10n::t('Event Starts:'), 'start_text', true, true, '', '', true),
+ '$n_text' => L10n::t('Finish date/time is not known or not relevant'),
'$n_checked' => $n_checked,
- '$f_text' => t('Event Finishes:'),
- '$f_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $fyear+5), DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"), t('Event Finishes:'), 'finish_text', true, true, 'start_text'),
- '$a_text' => t('Adjust for viewer timezone'),
+ '$f_text' => L10n::t('Event Finishes:'),
+ '$f_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $fyear+5), DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"), L10n::t('Event Finishes:'), 'finish_text', true, true, 'start_text'),
+ '$a_text' => L10n::t('Adjust for viewer timezone'),
'$a_checked' => $a_checked,
- '$d_text' => t('Description:'),
+ '$d_text' => L10n::t('Description:'),
'$d_orig' => $d_orig,
- '$l_text' => t('Location:'),
+ '$l_text' => L10n::t('Location:'),
'$l_orig' => $l_orig,
- '$t_text' => t('Title:') . ' <span class="required" title="' . t('Required') . '">*</span>',
+ '$t_text' => L10n::t('Title:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
'$t_orig' => $t_orig,
- '$summary' => ['summary', t('Title:'), $t_orig, '', '*'],
- '$sh_text' => t('Share this event'),
- '$share' => ['share', t('Share this event'), $sh_checked, '', $sh_disabled],
+ '$summary' => ['summary', L10n::t('Title:'), $t_orig, '', '*'],
+ '$sh_text' => L10n::t('Share this event'),
+ '$share' => ['share', L10n::t('Share this event'), $sh_checked, '', $sh_disabled],
'$sh_checked' => $sh_checked,
- '$nofinish' => ['nofinish', t('Finish date/time is not known or not relevant'), $n_checked],
- '$adjust' => ['adjust', t('Adjust for viewer timezone'), $a_checked],
- '$preview' => t('Preview'),
+ '$nofinish' => ['nofinish', L10n::t('Finish date/time is not known or not relevant'), $n_checked],
+ '$adjust' => ['adjust', L10n::t('Adjust for viewer timezone'), $a_checked],
+ '$preview' => L10n::t('Preview'),
'$acl' => $acl,
- '$submit' => t('Submit'),
- '$basic' => t('Basic'),
- '$advanced' => t('Advanced'),
- '$permissions' => t('Permissions'),
+ '$submit' => L10n::t('Submit'),
+ '$basic' => L10n::t('Basic'),
+ '$advanced' => L10n::t('Advanced'),
+ '$permissions' => L10n::t('Permissions'),
]);
}
if ($del == 0) {
- notice(t('Failed to remove event' ) . EOL);
+ 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\Object\Image;
/**
* @param App $a
*/
-function fbrowser_content(App $a) {
-
+function fbrowser_content(App $a)
+{
if (!local_user()) {
killme();
}
$template_file = "filebrowser.tpl";
$mode = "";
- if (x($_GET,'mode')) {
+ if (x($_GET, 'mode')) {
$mode = "?mode=".$_GET['mode'];
}
switch ($a->argv[1]) {
case "image":
- $path = [["", t("Photos")]];
+ $path = [["", L10n::t("Photos")]];
$albums = false;
$sql_extra = "";
$sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
- if ($a->argc==2){
+ if ($a->argc==2) {
$albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' ",
intval(local_user()),
dbesc('Contact Photos'),
- dbesc( t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
- function _map_folder1($el){return [bin2hex($el['album']),$el['album']];};
- $albums = array_map( "_map_folder1" , $albums);
+ function _map_folder1($el)
+ {
+ return [bin2hex($el['album']),$el['album']];
+ };
+ $albums = array_map("_map_folder1", $albums);
}
$album = "";
- if ($a->argc==3){
+ if ($a->argc==3) {
$album = hex2bin($a->argv[2]);
- $sql_extra = sprintf("AND `album` = '%s' ",dbesc($album));
+ $sql_extra = sprintf("AND `album` = '%s' ", dbesc($album));
$sql_extra2 = "";
$path[]=[$a->argv[2], $album];
}
GROUP BY `resource-id` $sql_extra2",
intval(local_user()),
dbesc('Contact Photos'),
- dbesc( t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
- function _map_files1($rr){
+ function _map_files1($rr)
+ {
$a = get_app();
$types = Image::supportedTypes();
$ext = $types[$rr['type']];
// Take the largest picture that is smaller or equal 640 pixels
$p = q("SELECT `scale` FROM `photo` WHERE `resource-id` = '%s' AND `height` <= 640 AND `width` <= 640 ORDER BY `resource-id`, `scale` LIMIT 1",
dbesc($rr['resource-id']));
- if ($p)
+ if ($p) {
$scale = $p[0]["scale"];
- else
+ } else {
$scale = $rr['loq'];
+ }
return [
System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
'$path' => $path,
'$folders' => $albums,
'$files' => $files,
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
'$nickname' => $a->user['nickname'],
+ '$upload' => L10n::t('Upload')
]);
-
break;
case "file":
if ($a->argc==2) {
intval(local_user())
);
- function _map_files2($rr){
+ function _map_files2($rr)
+ {
$a = get_app();
- list($m1,$m2) = explode("/",$rr['filetype']);
+ list($m1,$m2) = explode("/", $rr['filetype']);
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
$filename_e = $rr['filename'];
$o = replace_macros($tpl, [
'$type' => 'file',
'$baseurl' => System::baseUrl(),
- '$path' => [ [ "", t("Files")] ],
+ '$path' => [ [ "", L10n::t("Files")] ],
'$folders' => false,
- '$files' =>$files,
- '$cancel' => t('Cancel'),
+ '$files' => $files,
+ '$cancel' => L10n::t('Cancel'),
'$nickname' => $a->user['nickname'],
+ '$upload' => L10n::t('Upload')
]);
-
}
break;
}
- if (x($_GET,'mode')) {
+ if (x($_GET, 'mode')) {
return $o;
} else {
echo $o;
killme();
}
-
-
}
*/
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];
<?php
-
+/**
+ * @file mod/filer.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
-require_once('include/security.php');
-require_once('include/bbcode.php');
-require_once('include/items.php');
-
-function filer_content(App $a) {
+require_once 'include/security.php';
+require_once 'include/bbcode.php';
+require_once 'include/items.php';
+function filer_content(App $a)
+{
if (! local_user()) {
killme();
}
logger('filer: tag ' . $term . ' item ' . $item_id);
- if($item_id && strlen($term)){
+ if ($item_id && strlen($term)) {
// file item
- file_tag_save_file(local_user(),$item_id,$term);
+ file_tag_save_file(local_user(), $item_id, $term);
} else {
// return filer dialog
- $filetags = PConfig::get(local_user(),'system','filetags');
- $filetags = file_tag_file_to_list($filetags,'file');
- $filetags = explode(",", $filetags);
+ $filetags = PConfig::get(local_user(), 'system', 'filetags');
+ $filetags = file_tag_file_to_list($filetags, 'file');
+ $filetags = explode(",", $filetags);
$tpl = get_markup_template("filer_dialog.tpl");
$o = replace_macros($tpl, [
- '$field' => ['term', t("Save to Folder:"), '', '', $filetags, t('- select -')],
- '$submit' => t('Save'),
+ '$field' => ['term', L10n::t("Save to Folder:"), '', '', $filetags, L10n::t('- select -')],
+ '$submit' => L10n::t('Save'),
]);
echo $o;
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
function follow_post(App $a) {
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
goaway(System::baseUrl().'/contacts/'.$result['cid']);
}
- info(t('Contact added').EOL);
+ info(L10n::t('Contact added').EOL);
- if (strstr($return_url,'contacts')) {
+ if (strstr($return_url, 'contacts')) {
goaway(System::baseUrl().'/contacts/'.$contact_id);
}
function follow_content(App $a) {
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
- $submit = t('Submit Request');
+ $submit = L10n::t('Submit Request');
// There is a current issue. It seems as if you can't start following a Friendica that is following you
// With Diaspora this works - but Friendica is special, it seems ...
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
$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
$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
}
$r[0]["about"] = "";
}
- $header = t("Connect/Follow");
+ $header = L10n::t("Connect/Follow");
- $o = replace_macros($tpl,[
+ $o = replace_macros($tpl, [
'$header' => htmlentities($header),
//'$photo' => proxy_url($ret["photo"], false, PROXY_SIZE_SMALL),
'$desc' => "",
- '$pls_answer' => t('Please answer the following:'),
- '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', [t('No'), t('Yes')]],
- '$add_note' => t('Add a personal note:'),
+ '$pls_answer' => L10n::t('Please answer the following:'),
+ '$does_know_you' => ['knowyou', 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' => "",
'$statusnet' => "",
'$diaspora' => "",
'$diasnote' => "",
- '$your_address' => t('Your Identity Address:'),
+ '$your_address' => L10n::t('Your Identity Address:'),
'$invite_desc' => "",
'$emailnet' => "",
'$submit' => $submit,
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
'$nickname' => "",
'$name' => $ret["name"],
'$url' => $ret["url"],
'$zrl' => Profile::zrl($ret["url"]),
- '$url_label' => t("Profile URL"),
+ '$url_label' => L10n::t("Profile URL"),
'$myaddr' => $myaddr,
'$request' => $request,
/*'$location' => bbcode($r[0]["location"]),
- '$location_label' => t("Location:"),
+ '$location_label' => L10n::t("Location:"),
'$about' => bbcode($r[0]["about"], false, false),
- '$about_label' => t("About:"), */
+ '$about_label' => L10n::t("About:"), */
'$keywords' => $r[0]["keywords"],
- '$keywords_label' => t("Tags:")
+ '$keywords_label' => L10n::t("Tags:")
]);
$a->page['aside'] = "";
if ($gcontact_id <> 0) {
$o .= replace_macros(get_markup_template('section_title.tpl'),
- ['$title' => t('Status Messages and Posts')
- ]);
+ ['$title' => L10n::t('Status Messages and Posts')]
+ );
// Show last public posts
$o .= Contact::getPostsFromUrl($ret["url"]);
<?php
-
+/**
+ * @file mod/friendica.php
+ */
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
-function friendica_init(App $a) {
- if ($a->argv[1] == "json"){
+function friendica_init(App $a)
+{
+ if ($a->argv[1] == "json") {
$register_policy = ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'];
$sql_extra = '';
- if (x($a->config,'admin_nickname')) {
+ if (x($a->config, 'admin_nickname')) {
$sql_extra = sprintf(" AND `nickname` = '%s' ", dbesc($a->config['admin_nickname']));
}
if (isset($a->config['admin_email']) && $a->config['admin_email']!='') {
if (is_array($a->addons) && count($a->addons)) {
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
if (DBM::is_result($r)) {
- foreach($r as $rr) {
+ foreach ($r as $rr) {
$visible_addons[] = $rr['name'];
}
}
'admin' => $admin,
'site_name' => $a->config['sitename'],
'platform' => FRIENDICA_PLATFORM,
- 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
+ 'info' => ((x($a->config, 'info')) ? $a->config['info'] : ''),
'no_scrape_url' => System::baseUrl().'/noscrape'
];
}
}
-function friendica_content(App $a) {
+function friendica_content(App $a)
+{
$o = '<h1>Friendica</h1>' . PHP_EOL;
$o .= '<p>';
- $o .= t('This is Friendica, version') . ' <strong>' . FRIENDICA_VERSION . '</strong> ';
- $o .= t('running at web location') . ' ' . System::baseUrl();
+ $o .= L10n::t('This is Friendica, version') . ' <strong>' . FRIENDICA_VERSION . '</strong> ';
+ $o .= L10n::t('running at web location') . ' ' . System::baseUrl();
$o .= '</p>' . PHP_EOL;
$o .= '<p>';
- $o .= t('Please visit <a href="https://friendi.ca">Friendi.ca</a> to learn more about the Friendica project.') . PHP_EOL;
+ $o .= L10n::t('Please visit <a href="https://friendi.ca">Friendi.ca</a> to learn more about the Friendica project.') . PHP_EOL;
$o .= '</p>' . PHP_EOL;
$o .= '<p>';
- $o .= 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 .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
+ $o .= L10n::t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
$o .= '</p>' . PHP_EOL;
$visible_addons = [];
if (is_array($a->addons) && count($a->addons)) {
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
if (DBM::is_result($r)) {
- foreach($r as $rr) {
+ foreach ($r as $rr) {
$visible_addons[] = $rr['name'];
}
}
}
if (count($visible_addons)) {
- $o .= '<p>' . t('Installed addons/addons/apps:') . '</p>' . PHP_EOL;
+ $o .= '<p>' . L10n::t('Installed addons/addons/apps:') . '</p>' . PHP_EOL;
$sorted = $visible_addons;
$s = '';
sort($sorted);
}
$o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>' . PHP_EOL;
} else {
- $o .= '<p>' . t('No installed addons/addons/apps') . '</p>' . PHP_EOL;
+ $o .= '<p>' . L10n::t('No installed addons/addons/apps') . '</p>' . PHP_EOL;
}
$blocklist = Config::get('system', 'blocklist');
if (count($blocklist)) {
- $o .= '<div id="about_blocklist"><p>' . t('On this server the following remote servers are blocked.') . '</p>' . PHP_EOL;
- $o .= '<table class="table"><thead><tr><th>' . t('Blocked domain') . '</th><th>' . t('Reason for the block') . '</th></thead><tbody>' . PHP_EOL;
+ $o .= '<div id="about_blocklist"><p>' . L10n::t('On this server the following remote servers are blocked.') . '</p>' . PHP_EOL;
+ $o .= '<table class="table"><thead><tr><th>' . L10n::t('Blocked domain') . '</th><th>' . L10n::t('Reason for the block') . '</th></thead><tbody>' . PHP_EOL;
foreach ($blocklist as $b) {
$o .= '<tr><td>' . $b['domain'] .'</td><td>' . $b['reason'] . '</td></tr>' . PHP_EOL;
}
* @file mod/fsuggest.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
-function fsuggest_post(App $a) {
-
+function fsuggest_post(App $a)
+{
if (! local_user()) {
return;
}
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];
$note = escape_tags(trim($_POST['note']));
- if($new_contact) {
+ if ($new_contact) {
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($new_contact),
intval(local_user())
);
if (DBM::is_result($r)) {
-
$x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)
VALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')",
intval(local_user()),
Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', $fsuggest_id);
}
- info( t('Friend suggestion sent.') . EOL);
+ info(L10n::t('Friend suggestion sent.') . EOL);
}
-
}
-
-
}
-
-
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;
}
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];
- $o = '<h3>' . t('Suggest Friends') . '</h3>';
+ $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" >' . L10n::t('Suggest a friend for %s', $contact['name']) . '</div>';
$o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
);
- $o .= '<div id="fsuggest-submit-wrapper"><input id="fsuggest-submit" type="submit" name="submit" value="' . t('Submit') . '" /></div>';
+ $o .= '<div id="fsuggest-submit-wrapper"><input id="fsuggest-submit" type="submit" name="submit" value="' . L10n::t('Submit') . '" /></div>';
$o .= '</form>';
return $o;
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
function group_post(App $a) {
if (! local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$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);
}
} else {
- notice(t('Could not create group.') . EOL);
+ notice(L10n::t('Could not create group.') . EOL);
}
goaway(System::baseUrl() . '/group');
return; // NOTREACHED
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
}
);
if ($r) {
- info(t('Group name changed.') . EOL);
+ info(L10n::t('Group name changed.') . EOL);
}
}
$change = false;
if (! local_user()) {
- notice(t('Permission denied') . EOL);
+ notice(L10n::t('Permission denied') . EOL);
return;
}
$tpl = get_markup_template('group_edit.tpl');
$context = [
- '$submit' => t('Save Group'),
+ '$submit' => L10n::t('Save Group'),
];
if (($a->argc == 2) && ($a->argv[1] === 'new')) {
return replace_macros($tpl, $context + [
- '$title' => t('Create a group of contacts/friends.'),
- '$gname' => ['groupname', t('Group Name: '), '', ''],
+ '$title' => L10n::t('Create a group of contacts/friends.'),
+ '$gname' => ['groupname', L10n::t('Group Name: '), '', ''],
'$gid' => 'new',
'$form_security_token' => get_form_security_token("group_edit"),
]);
}
if ($result) {
- info(t('Group removed.') . EOL);
+ info(L10n::t('Group removed.') . EOL);
} else {
- notice(t('Unable to remove group.') . EOL);
+ notice(L10n::t('Unable to remove group.') . EOL);
}
}
goaway(System::baseUrl() . '/group');
);
if (! DBM::is_result($r)) {
- notice(t('Group not found.') . EOL);
+ notice(L10n::t('Group not found.') . EOL);
goaway(System::baseUrl() . '/contacts');
}
$drop_tpl = get_markup_template('group_drop.tpl');
$drop_txt = replace_macros($drop_tpl, [
'$id' => $group['id'],
- '$delete' => t('Delete Group'),
+ '$delete' => L10n::t('Delete Group'),
'$form_security_token' => get_form_security_token("group_drop"),
]);
$context = $context + [
- '$title' => t('Group Editor'),
- '$gname' => ['groupname', t('Group Name: '), $group['name'], ''],
+ '$title' => L10n::t('Group Editor'),
+ '$gname' => ['groupname', L10n::t('Group Name: '), $group['name'], ''],
'$gid' => $group['id'],
'$drop' => $drop_txt,
'$form_security_token' => get_form_security_token('group_edit'),
- '$edit_name' => t('Edit Group Name')
+ '$edit_name' => L10n::t('Edit Group Name')
];
}
}
$groupeditor = [
- 'label_members' => t('Members'),
+ 'label_members' => L10n::t('Members'),
'members' => [],
- 'label_contacts' => t('All Contacts'),
- 'group_is_empty' => t('Group is empty'),
+ 'label_contacts' => L10n::t('All Contacts'),
+ 'group_is_empty' => L10n::t('Group is empty'),
'contacts' => [],
];
$entry['label'] = 'members';
$entry['photo_menu'] = '';
$entry['change_member'] = [
- 'title' => t("Remove Contact"),
+ 'title' => L10n::t("Remove Contact"),
'gid' => $group['id'],
'cid' => $member['id'],
'sec_token' => $sec_token
$entry['label'] = 'contacts';
$entry['photo_menu'] = '';
$entry['change_member'] = [
- 'title' => t("Add Contact"),
+ 'title' => L10n::t("Add Contact"),
'gid' => $group['id'],
'cid' => $member['id'],
'sec_token' => $sec_token
}
$context['$groupeditor'] = $groupeditor;
- $context['$desc'] = t('Click on a contact to add or remove.');
+ $context['$desc'] = L10n::t('Click on a contact to add or remove.');
// If there are to many contacts we could provide an alternative view mode
$total = count($groupeditor['members']) + count($groupeditor['contacts']);
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\Profile;
if ($a->argc > 1) {
$which = $a->argv[1];
} else {
- notice(t('No profile') . EOL);
+ notice(L10n::t('No profile') . EOL);
$a->error = 404;
return;
}
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Text\Markdown;
+use Friendica\Core\L10n;
use Friendica\Core\System;
if (!function_exists('load_doc_file')) {
$title = basename($path);
$filename = $path;
$text = load_doc_file('doc/' . $path . '.md');
- $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($title));
+ $a->page['title'] = L10n::t('Help:') . ' ' . str_replace('-', ' ', notags($title));
}
$home = load_doc_file('doc/Home.md');
if (!$text) {
$text = $home;
$filename = "Home";
- $a->page['title'] = t('Help');
+ $a->page['title'] = L10n::t('Help');
} else {
$a->page['aside'] = Markdown::convert($home, false);
}
if (!strlen($text)) {
- header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
+ header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . L10n::t('Not Found'));
$tpl = get_markup_template("404.tpl");
return replace_macros($tpl, [
- '$message' => t('Page not found.')
+ '$message' => L10n::t('Page not found.')
]);
}
<?php
-
+/**
+ * @file mod/home.php
+ */
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Module\Login;
}
$customhome = false;
- $defaultheader = '<h1>'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'</h1>';
+ $defaultheader = '<h1>'.((x($a->config,'sitename')) ? L10n::t("Welcome to %s", $a->config['sitename']) : "").'</h1>';
$homefilepath = $a->basepath . "/home.html";
$cssfilepath = $a->basepath . "/home.css";
* @file mod/install.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Database\DBStructure;
global $install_wizard_pass;
$o = '';
$wizard_status = "";
- $install_title = t('Friendica Communications Server - Setup');
+ $install_title = L10n::t('Friendica Communications Server - Setup');
if (x($a->data, 'db_conn_failed')) {
$install_wizard_pass = 2;
- $wizard_status = t('Could not connect to database.');
+ $wizard_status = L10n::t('Could not connect to database.');
}
if (x($a->data, 'db_create_failed')) {
$install_wizard_pass = 2;
- $wizard_status = t('Could not create table.');
+ $wizard_status = L10n::t('Could not create table.');
}
$db_return_text = "";
if (x($a->data, 'db_installed')) {
$txt = '<p style="font-size: 130%;">';
- $txt .= t('Your Friendica site database has been installed.') . EOL;
+ $txt .= L10n::t('Your Friendica site database has been installed.') . EOL;
$db_return_text .= $txt;
}
if (x($a->data, 'db_failed')) {
- $txt = t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
- $txt .= t('Please see the file "INSTALL.txt".') . EOL ."<hr>";
+ $txt = L10n::t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
+ $txt .= L10n::t('Please see the file "INSTALL.txt".') . EOL ."<hr>";
$txt .= "<pre>".$a->data['db_failed'] . "</pre>". EOL;
$db_return_text .= $txt;
}
return replace_macros($tpl, [
'$title' => $install_title,
'$pass' => '',
- '$status' => t('Database already in use.'),
+ '$status' => L10n::t('Database already in use.'),
'$text' => '',
]);
}
$tpl = get_markup_template('install_checks.tpl');
$o .= replace_macros($tpl, [
'$title' => $install_title,
- '$pass' => t('System check'),
+ '$pass' => L10n::t('System check'),
'$checks' => $checks,
'$passed' => $checkspassed,
- '$see_install' => t('Please see the file "INSTALL.txt".'),
- '$next' => t('Next'),
- '$reload' => t('Check again'),
+ '$see_install' => L10n::t('Please see the file "INSTALL.txt".'),
+ '$next' => L10n::t('Next'),
+ '$reload' => L10n::t('Check again'),
'$phpath' => $phpath,
'$baseurl' => System::baseUrl(),
]);
$tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, [
'$title' => $install_title,
- '$pass' => t('Database connection'),
- '$info_01' => t('In order to install Friendica we need to know how to connect to your database.'),
- '$info_02' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
- '$info_03' => t('The database you specify below should already exist. If it does not, please create it before continuing.'),
+ '$pass' => L10n::t('Database connection'),
+ '$info_01' => L10n::t('In order to install Friendica we need to know how to connect to your database.'),
+ '$info_02' => L10n::t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
+ '$info_03' => L10n::t('The database you specify below should already exist. If it does not, please create it before continuing.'),
'$status' => $wizard_status,
- '$dbhost' => ['dbhost', t('Database Server Name'), $dbhost, '', 'required'],
- '$dbuser' => ['dbuser', t('Database Login Name'), $dbuser, '', 'required', 'autofocus'],
- '$dbpass' => ['dbpass', t('Database Login Password'), $dbpass, t("For security reasons the password must not be empty"), 'required'],
- '$dbdata' => ['dbdata', t('Database Name'), $dbdata, '', 'required'],
- '$adminmail' => ['adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
+ '$dbhost' => ['dbhost', L10n::t('Database Server Name'), $dbhost, '', 'required'],
+ '$dbuser' => ['dbuser', L10n::t('Database Login Name'), $dbuser, '', 'required', 'autofocus'],
+ '$dbpass' => ['dbpass', L10n::t('Database Login Password'), $dbpass, L10n::t("For security reasons the password must not be empty"), 'required'],
+ '$dbdata' => ['dbdata', L10n::t('Database Name'), $dbdata, '', 'required'],
+ '$adminmail' => ['adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
- '$lbl_10' => t('Please select a default timezone for your website'),
+ '$lbl_10' => L10n::t('Please select a default timezone for your website'),
'$baseurl' => System::baseUrl(),
'$phpath' => $phpath,
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
]);
return $o;
$adminmail = notags(trim($_POST['adminmail']));
$timezone = ((x($_POST, 'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles');
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
$tpl = get_markup_template('install_settings.tpl');
$o .= replace_macros($tpl, [
'$title' => $install_title,
- '$pass' => t('Site settings'),
+ '$pass' => L10n::t('Site settings'),
'$status' => $wizard_status,
'$dbdata' => $dbdata,
'$phpath' => $phpath,
- '$adminmail' => ['adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
+ '$adminmail' => ['adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
- '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''),
- '$language' => ['language', t('System Language:'), 'en', t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices],
+ '$timezone' => field_timezone('timezone', L10n::t('Please select a default timezone for your website'), $timezone, ''),
+ '$language' => ['language', L10n::t('System Language:'), 'en', L10n::t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices],
'$baseurl' => System::baseUrl(),
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
]);
return $o;
}
$help = "";
if (!$passed) {
- $help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL;
- $help .= t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
+ $help .= L10n::t('Could not find a command line version of PHP in the web server PATH.'). EOL;
+ $help .= L10n::t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
$help .= EOL . EOL;
$tpl = get_markup_template('field_input.tpl');
$help .= replace_macros($tpl, [
- '$field' => ['phpath', t('PHP executable path'), $phpath, t('Enter full path to php executable. You can leave this blank to continue the installation.')],
+ '$field' => ['phpath', L10n::t('PHP executable path'), $phpath, L10n::t('Enter full path to php executable. You can leave this blank to continue the installation.')],
]);
$phpath = "";
}
- check_add($checks, t('Command line PHP').($passed?" (<tt>$phpath</tt>)":""), $passed, false, $help);
+ check_add($checks, L10n::t('Command line PHP').($passed?" (<tt>$phpath</tt>)":""), $passed, false, $help);
if ($passed) {
$cmd = "$phpath -v";
list($result) = explode("\n", $result);
$help = "";
if (!$passed2) {
- $help .= t('PHP executable is not the php cli binary (could be cgi-fgci version)'). EOL;
- $help .= t('Found PHP version: ')."<tt>$result</tt>";
+ $help .= L10n::t('PHP executable is not the php cli binary (could be cgi-fgci version)'). EOL;
+ $help .= L10n::t('Found PHP version: ')."<tt>$result</tt>";
}
- check_add($checks, t('PHP cli binary'), $passed2, true, $help);
+ check_add($checks, L10n::t('PHP cli binary'), $passed2, true, $help);
}
$passed3 = $result == $str;
$help = "";
if (!$passed3) {
- $help .= t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL;
- $help .= t('This is required for message delivery to work.');
+ $help .= L10n::t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL;
+ $help .= L10n::t('This is required for message delivery to work.');
}
- check_add($checks, t('PHP register_argc_argv'), $passed3, true, $help);
+ check_add($checks, L10n::t('PHP register_argc_argv'), $passed3, true, $help);
}
// Get private key
if (! $res) {
- $help .= t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys'). EOL;
- $help .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
+ $help .= L10n::t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys'). EOL;
+ $help .= L10n::t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
}
- check_add($checks, t('Generate encryption keys'), $res, true, $help);
+ check_add($checks, L10n::t('Generate encryption keys'), $res, true, $help);
}
function check_funcs(&$checks) {
$ck_funcs = [];
- check_add($ck_funcs, t('libCurl PHP module'), true, true, "");
- check_add($ck_funcs, t('GD graphics PHP module'), true, true, "");
- check_add($ck_funcs, t('OpenSSL PHP module'), true, true, "");
- check_add($ck_funcs, t('PDO or MySQLi PHP module'), true, true, "");
- check_add($ck_funcs, t('mb_string PHP module'), true, true, "");
- check_add($ck_funcs, t('XML PHP module'), true, true, "");
- check_add($ck_funcs, t('iconv module'), true, true, "");
+ check_add($ck_funcs, L10n::t('libCurl PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('GD graphics PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('OpenSSL PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('PDO or MySQLi PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('mb_string PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('XML PHP module'), true, true, "");
+ check_add($ck_funcs, L10n::t('iconv module'), true, true, "");
if (function_exists('apache_get_modules')) {
if (! in_array('mod_rewrite',apache_get_modules())) {
- check_add($ck_funcs, t('Apache mod_rewrite module'), false, true, t('Error: Apache webserver mod-rewrite module is required but not installed.'));
+ check_add($ck_funcs, L10n::t('Apache mod_rewrite module'), false, true, L10n::t('Error: Apache webserver mod-rewrite module is required but not installed.'));
} else {
- check_add($ck_funcs, t('Apache mod_rewrite module'), true, true, "");
+ check_add($ck_funcs, L10n::t('Apache mod_rewrite module'), true, true, "");
}
}
if (! function_exists('curl_init')) {
$ck_funcs[0]['status'] = false;
- $ck_funcs[0]['help'] = t('Error: libCURL PHP module required but not installed.');
+ $ck_funcs[0]['help'] = L10n::t('Error: libCURL PHP module required but not installed.');
}
if (! function_exists('imagecreatefromjpeg')) {
$ck_funcs[1]['status'] = false;
- $ck_funcs[1]['help'] = t('Error: GD graphics PHP module with JPEG support required but not installed.');
+ $ck_funcs[1]['help'] = L10n::t('Error: GD graphics PHP module with JPEG support required but not installed.');
}
if (! function_exists('openssl_public_encrypt')) {
$ck_funcs[2]['status'] = false;
- $ck_funcs[2]['help'] = t('Error: openssl PHP module required but not installed.');
+ $ck_funcs[2]['help'] = L10n::t('Error: openssl PHP module required but not installed.');
}
if (! function_exists('mysqli_connect') && !class_exists('pdo')) {
$ck_funcs[3]['status'] = false;
- $ck_funcs[3]['help'] = t('Error: PDO or MySQLi PHP module required but not installed.');
+ $ck_funcs[3]['help'] = L10n::t('Error: PDO or MySQLi PHP module required but not installed.');
}
if (!function_exists('mysqli_connect') && class_exists('pdo') && !in_array('mysql', PDO::getAvailableDrivers())) {
$ck_funcs[3]['status'] = false;
- $ck_funcs[3]['help'] = t('Error: The MySQL driver for PDO is not installed.');
+ $ck_funcs[3]['help'] = L10n::t('Error: The MySQL driver for PDO is not installed.');
}
if (! function_exists('mb_strlen')) {
$ck_funcs[4]['status'] = false;
- $ck_funcs[4]['help'] = t('Error: mb_string PHP module required but not installed.');
+ $ck_funcs[4]['help'] = L10n::t('Error: mb_string PHP module required but not installed.');
}
if (! function_exists('iconv_strlen')) {
$ck_funcs[7]['status'] = false;
- $ck_funcs[7]['help'] = t('Error: iconv PHP module required but not installed.');
+ $ck_funcs[7]['help'] = L10n::t('Error: iconv PHP module required but not installed.');
}
$checks = array_merge($checks, $ck_funcs);
$xml = new DOMDocument();
} catch (Exception $e) {
$ck_funcs[6]['status'] = false;
- $ck_funcs[6]['help'] = t('Error, XML PHP module required but not installed.');
+ $ck_funcs[6]['help'] = L10n::t('Error, XML PHP module required but not installed.');
}
}
(!file_exists('.htconfig.php') && !is_writable('.'))) {
$status = false;
- $help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL;
- $help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL;
- $help .= t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Friendica top folder.').EOL;
- $help .= t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.').EOL;
+ $help = L10n::t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL;
+ $help .= L10n::t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL;
+ $help .= L10n::t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Friendica top folder.').EOL;
+ $help .= L10n::t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.').EOL;
}
- check_add($checks, t('.htconfig.php is writable'), $status, false, $help);
+ check_add($checks, L10n::t('.htconfig.php is writable'), $status, false, $help);
}
if (!is_writable('view/smarty3')) {
$status = false;
- $help = t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL;
- $help .= t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.').EOL;
- $help .= t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL;
- $help .= t('Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files (.tpl) that it contains.').EOL;
+ $help = L10n::t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL;
+ $help .= L10n::t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.').EOL;
+ $help .= L10n::t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL;
+ $help .= L10n::t('Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files (.tpl) that it contains.').EOL;
}
- check_add($checks, t('view/smarty3 is writable'), $status, true, $help);
+ check_add($checks, L10n::t('view/smarty3 is writable'), $status, true, $help);
}
if ($test != "ok") {
$status = false;
- $help = t('Url rewrite in .htaccess is not working. Check your server configuration.');
+ $help = L10n::t('Url rewrite in .htaccess is not working. Check your server configuration.');
}
- check_add($checks, t('Url rewrite is working'), $status, true, $help);
+ check_add($checks, L10n::t('Url rewrite is working'), $status, true, $help);
} else {
// cannot check modrewrite if libcurl is not installed
/// @TODO Maybe issue warning here?
}
}
if ($imagick == false) {
- check_add($checks, t('ImageMagick PHP extension is not installed'), $imagick, false, "");
+ check_add($checks, L10n::t('ImageMagick PHP extension is not installed'), $imagick, false, "");
} else {
- check_add($checks, t('ImageMagick PHP extension is installed'), $imagick, false, "");
+ check_add($checks, L10n::t('ImageMagick PHP extension is installed'), $imagick, false, "");
if ($imagick) {
- check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
+ check_add($checks, L10n::t('ImageMagick supports GIF'), $gif, false, "");
}
}
}
function manual_config(App $a) {
$data = htmlentities($a->data['txt'],ENT_COMPAT, 'UTF-8');
- $o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
+ $o = L10n::t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
return $o;
}
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".')
+ L10n::t('<h1>What next</h1>')
+ ."<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>";
}
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Protocol\Email;
-function invite_post(App $a) {
-
+function invite_post(App $a)
+{
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
check_form_security_token_redirectOnErr('/', 'send_invite');
- $max_invites = intval(Config::get('system','max_invites'));
+ $max_invites = intval(Config::get('system', 'max_invites'));
if (! $max_invites) {
$max_invites = 50;
}
- $current_invites = intval(PConfig::get(local_user(),'system','sent_invites'));
+ $current_invites = intval(PConfig::get(local_user(), 'system', 'sent_invites'));
if ($current_invites > $max_invites) {
- notice( t('Total invitation limit exceeded.') . EOL);
+ notice(L10n::t('Total invitation limit exceeded.') . EOL);
return;
}
- $recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : []);
- $message = ((x($_POST,'message')) ? notags(trim($_POST['message'])) : '');
+ $recips = ((x($_POST, 'recipients')) ? explode("\n", $_POST['recipients']) : []);
+ $message = ((x($_POST, 'message')) ? notags(trim($_POST['message'])) : '');
$total = 0;
- if (Config::get('system','invitation_only')) {
+ if (Config::get('system', 'invitation_only')) {
$invonly = true;
- $x = PConfig::get(local_user(),'system','invites_remaining');
+ $x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ((! $x) && (! is_site_admin())) {
return;
}
}
foreach ($recips as $recip) {
-
$recip = trim($recip);
if (! valid_email($recip)) {
- notice( sprintf( t('%s : Not a valid email address.'), $recip) . EOL);
+ notice(L10n::t('%s : Not a valid email address.', $recip) . EOL);
continue;
}
if ($invonly && ($x || is_site_admin())) {
- $code = autoname(8) . srand(1000,9999);
- $nmessage = str_replace('$invite_code',$code,$message);
+ $code = autoname(8) . srand(1000, 9999);
+ $nmessage = str_replace('$invite_code', $code, $message);
$r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ",
dbesc($code),
if (! is_site_admin()) {
$x --;
if ($x >= 0) {
- PConfig::set(local_user(),'system','invites_remaining',$x);
+ PConfig::set(local_user(), 'system', 'invites_remaining', $x);
} else {
return;
}
$nmessage = $message;
}
- $res = mail($recip, Email::encodeHeader(t('Please join us on Friendica'),'UTF-8'),
+ $res = mail($recip, Email::encodeHeader(L10n::t('Please join us on Friendica'), 'UTF-8'),
$nmessage,
"From: " . $a->user['email'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
if ($res) {
$total ++;
$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);
+ PConfig::set(local_user(), 'system', 'sent_invites', $current_invites);
+ if ($current_invites > $max_invites) {
+ notice(L10n::t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
return;
}
} else {
- notice( sprintf( t('%s : Message delivery failed.'), $recip) . EOL);
+ notice(L10n::t('%s : Message delivery failed.', $recip) . EOL);
}
}
- notice( sprintf( tt("%d message sent.", "%d messages sent.", $total) , $total) . EOL);
+ notice(L10n::tt("%d message sent.", "%d messages sent.", $total) . EOL);
return;
}
-
function invite_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$tpl = get_markup_template('invite.tpl');
$invonly = false;
- if (Config::get('system','invitation_only')) {
+ if (Config::get('system', 'invitation_only')) {
$invonly = true;
- $x = PConfig::get(local_user(),'system','invites_remaining');
+ $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 '';
}
}
- $dirloc = Config::get('system','directory');
+ $dirloc = Config::get('system', 'directory');
if (strlen($dirloc)) {
if ($a->config['register_policy'] == REGISTER_CLOSED) {
- $linktxt = sprintf( t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.'), $dirloc . '/servers');
+ $linktxt = L10n::t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.', $dirloc . '/servers');
} else {
- $linktxt = sprintf( t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), System::baseUrl())
- . "\r\n" . "\r\n" . sprintf( t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.'),$dirloc . '/servers');
+ $linktxt = L10n::t('To accept this invitation, please visit and register at %s or any other public Friendica website.', System::baseUrl())
+ . "\r\n" . "\r\n" . L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.', $dirloc . '/servers');
}
} else { // there is no global directory URL defined
if ($a->config['register_policy'] == REGISTER_CLOSED) {
- $o = t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
+ $o = L10n::t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
return $o;
} else {
- $linktxt = sprintf( t('To accept this invitation, please visit and register at %s.'), System::baseUrl()
- . "\r\n" . "\r\n" . t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
+ $linktxt = L10n::t('To accept this invitation, please visit and register at %s.', System::baseUrl()
+ . "\r\n" . "\r\n" . L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
}
}
$o = replace_macros($tpl, [
'$form_security_token' => get_form_security_token("send_invite"),
- '$invite' => t('Send invitations'),
- '$addr_text' => t('Enter email addresses, one per line:'),
- '$msg_text' => t('Your message:'),
- '$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
+ '$invite' => L10n::t('Send invitations'),
+ '$addr_text' => L10n::t('Enter email addresses, one per line:'),
+ '$msg_text' => L10n::t('Your message:'),
+ '$default_message' => L10n::t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
. $linktxt
- . "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:')
+ . "\r\n" . "\r\n" . (($invonly) ? L10n::t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .L10n::t('Once you have registered, please connect with me via my profile page at:')
. "\r\n" . "\r\n" . System::baseUrl() . '/profile/' . $a->user['nickname']
- . "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" ,
- '$submit' => t('Submit')
+ . "\r\n" . "\r\n" . L10n::t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" ,
+ '$submit' => L10n::t('Submit')
]);
return $o;
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;
}
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);
}
// 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);
}
if ($preview) {
killme();
}
- info(t('Empty post discarded.') . EOL);
+ info(L10n::t('Empty post discarded.') . EOL);
if (x($_REQUEST, 'return')) {
goaway($return_path);
}
$fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny];
- $condition = ['resource-id' => $image_uri, 'uid' => $profile_uid, 'album' => t('Wall Photos')];
+ $condition = ['resource-id' => $image_uri, 'uid' => $profile_uid, 'album' => L10n::t('Wall Photos')];
dba::update('photo', $fields, $condition);
}
}
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 />' . 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 .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
+ $disclaimer .= 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]' . ' ' . 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);
<?php
-
+/**
+ * @file mod/localtime.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
-require_once('include/datetime.php');
-
-function localtime_post(App $a) {
+require_once 'include/datetime.php';
+function localtime_post(App $a)
+{
$t = $_REQUEST['time'];
- if(! $t)
+ if (! $t) {
$t = 'now';
+ }
- $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
-
- if($_POST['timezone'])
- $a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
+ $bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
+ if ($_POST['timezone']) {
+ $a->data['mod-localtime'] = datetime_convert('UTC', $_POST['timezone'], $t, $bd_format);
+ }
}
-function localtime_content(App $a) {
+function localtime_content(App $a)
+{
$t = $_REQUEST['time'];
- if(! $t)
+ if (! $t) {
$t = 'now';
+ }
- $o .= '<h3>' . t('Time Conversion') . '</h3>';
+ $o .= '<h3>' . L10n::t('Time Conversion') . '</h3>';
- $o .= '<p>' . t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
+ $o .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
- $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
+ $o .= '<p>' . L10n::t('UTC time: %s', $t) . '</p>';
- if($_REQUEST['timezone'])
- $o .= '<p>' . sprintf( t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
+ if ($_REQUEST['timezone']) {
+ $o .= '<p>' . L10n::t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
+ }
- if(x($a->data,'mod-localtime'))
- $o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
+ if (x($a->data, 'mod-localtime')) {
+ $o .= '<p>' . L10n::t('Converted localtime: %s', $a->data['mod-localtime']) . '</p>';
+ }
$o .= '<form action ="' . System::baseUrl() . '/localtime?f=&time=' . $t . '" method="post" >';
- $o .= '<p>' . t('Please select your timezone:') . '</p>';
+ $o .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
$o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
- $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
+ $o .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';
return $o;
-
}
<?php
-
+/**
+ * @file mod/lockview.php
+ */
use Friendica\App;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
function lockview_content(App $a) {
Addon::callHooks('lockview_content', $item);
if($item['uid'] != local_user()) {
- echo t('Remote privacy information not available.') . '<br />';
+ echo L10n::t('Remote privacy information not available.') . '<br />';
killme();
}
if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
- echo t('Remote privacy information not available.') . '<br />';
+ echo L10n::t('Remote privacy information not available.') . '<br />';
killme();
}
$deny_users = expand_acl($item['deny_cid']);
$deny_groups = expand_acl($item['deny_gid']);
- $o = t('Visible to:') . '<br />';
+ $o = L10n::t('Visible to:') . '<br />';
$l = [];
if(count($allowed_groups)) {
<?php
-
/**
* @file mod/lostpass.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\User;
require_once 'include/datetime.php';
require_once 'include/enotify.php';
require_once 'include/text.php';
-require_once 'include/pgettext.php';
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());
}
];
$result = dba::update('user', $fields, ['uid' => $user['uid']]);
if ($result) {
- info(t('Password reset request issued. Check your email.') . EOL);
+ info(L10n::t('Password reset request issued. Check your email.') . EOL);
}
$sitename = $a->config['sitename'];
$resetlink = System::baseUrl() . '/lostpass/' . $pwdreset_token;
- $preamble = deindent(t('
+ $preamble = deindent(L10n::t('
Dear %1$s,
A request was recently received at "%2$s" to reset your account
password. In order to confirm this request, please select the verification link
Your password will not be changed unless we can verify that you
issued this request.', $user['username'], $sitename));
- $body = deindent(t('
+ $body = deindent(L10n::t('
Follow this link soon to verify your identity:
%1$s
notification([
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
- 'subject' => t('Password reset requested at %s', $sitename),
+ 'subject' => L10n::t('Password reset requested at %s', $sitename),
'preamble' => $preamble,
'body' => $body
]);
$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();
}
];
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();
}
{
$tpl = get_markup_template('lostpass.tpl');
$o = replace_macros($tpl, [
- '$title' => t('Forgot your Password?'),
- '$desc' => t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
- '$name' => t('Nickname or Email: '),
- '$submit' => t('Reset')
+ '$title' => L10n::t('Forgot your Password?'),
+ '$desc' => L10n::t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
+ '$name' => L10n::t('Nickname or Email: '),
+ '$submit' => L10n::t('Reset')
]);
return $o;
if (DBM::is_result($result)) {
$tpl = get_markup_template('pwdreset.tpl');
$o .= replace_macros($tpl, [
- '$lbl1' => t('Password Reset'),
- '$lbl2' => t('Your password has been reset as requested.'),
- '$lbl3' => t('Your new password is'),
- '$lbl4' => t('Save or copy your new password - and then'),
- '$lbl5' => '<a href="' . System::baseUrl() . '">' . t('click here to login') . '</a>.',
- '$lbl6' => t('Your password may be changed from the <em>Settings</em> page after successful login.'),
+ '$lbl1' => L10n::t('Password Reset'),
+ '$lbl2' => L10n::t('Your password has been reset as requested.'),
+ '$lbl3' => L10n::t('Your new password is'),
+ '$lbl4' => L10n::t('Save or copy your new password - and then'),
+ '$lbl5' => '<a href="' . System::baseUrl() . '">' . L10n::t('click here to login') . '</a>.',
+ '$lbl6' => L10n::t('Your password may be changed from the <em>Settings</em> page after successful login.'),
'$newpass' => $new_password,
'$baseurl' => System::baseUrl()
]);
info("Your password has been reset." . EOL);
$sitename = $a->config['sitename'];
- $preamble = deindent(t('
+ $preamble = deindent(L10n::t('
Dear %1$s,
Your password has been changed as requested. Please retain this
information for your records (or change your password immediately to
something that you will remember).
', $user['username']));
- $body = deindent(t('
+ $body = deindent(L10n::t('
Your login details are as follows:
Site Location: %1$s
notification([
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
- 'subject' => t('Your password has been changed at %s', $sitename),
+ 'subject' => L10n::t('Your password has been changed at %s', $sitename),
'preamble' => $preamble,
'body' => $body
]);
<?php
-
+/**
+ * @file mod/maintenance.php
+ */
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
-function maintenance_content(App $a) {
-
+function maintenance_content(App $a)
+{
$reason = Config::get('system', 'maintenance_reason');
if (substr(normalise_link($reason), 0, 7) == 'http://') {
header('Retry-After: 600');
return replace_macros(get_markup_template('maintenance.tpl'), [
- '$sysdown' => t('System down for maintenance'),
+ '$sysdown' => L10n::t('System down for maintenance'),
'$reason' => $reason
]);
}
<?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) {
function manage_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
}
$o = replace_macros(get_markup_template('manage.tpl'), [
- '$title' => t('Manage Identities and/or Pages'),
- '$desc' => t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
- '$choose' => t('Select an identity to manage: '),
+ '$title' => L10n::t('Manage Identities and/or Pages'),
+ '$desc' => L10n::t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
+ '$choose' => L10n::t('Select an identity to manage: '),
'$identities' => $identities,
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
]);
return $o;
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;
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;
}
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = System::baseUrl() . '/follow/?url=' . $jj->url;
$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]
];
$contact_details = Contact::getDetailsByURL($jj->url, local_user());
'about' => $contact_details['about'],
'account_type' => Contact::getAccountType($contact_details),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
- 'inttxt' => ' ' . t('is interested in:'),
- 'conntxt' => t('Connect'),
+ 'inttxt' => ' ' . L10n::t('is interested in:'),
+ 'conntxt' => L10n::t('Connect'),
'connlnk' => $connlnk,
'img_hover' => $jj->tags,
'photo_menu' => $photo_menu,
$o .= replace_macros(
$tpl,
[
- '$title' => t('Profile Match'),
+ '$title' => L10n::t('Profile Match'),
'$contacts' => $entries,
'$paginate' => paginate($a)]
);
} else {
- info(t('No matches') . EOL);
+ info(L10n::t('No matches') . EOL);
}
}
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;
}
$new = [
- 'label' => t('New Message'),
+ 'label' => L10n::t('New Message'),
'url' => 'message/new',
'sel' => $a->argc > 1 && $a->argv[1] == 'new',
'accesskey' => 'm',
function message_post(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
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);
+ info(L10n::t('Message sent.') . EOL);
}
// fake it to go back to the input form if no recipient listed
Nav::setSelected('messages');
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, [
- '$messages' => t('Messages'),
+ '$messages' => L10n::t('Messages'),
]);
if (($a->argc == 3) && ($a->argv[1] === 'drop' || $a->argv[1] === 'dropconv')) {
//$a->page['aside'] = '';
return replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
- '$message' => t('Do you really want to delete this message?'),
+ '$message' => L10n::t('Do you really want to delete this message?'),
'$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
intval(local_user())
);
if ($r) {
- info(t('Message deleted.') . EOL);
+ info(L10n::t('Message deleted.') . EOL);
}
//goaway(System::baseUrl(true) . '/message' );
goaway($_SESSION['return_url']);
//}
if ($r) {
- info(t('Conversation removed.') . EOL);
+ info(L10n::t('Conversation removed.') . EOL);
}
}
//goaway(System::baseUrl(true) . '/message' );
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('msg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$preselect = isset($a->argv[2]) ? [$a->argv[2]] : false;
$tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl, [
- '$header' => t('Send Private Message'),
- '$to' => t('To:'),
+ '$header' => L10n::t('Send Private Message'),
+ '$to' => L10n::t('To:'),
'$showinputs' => 'true',
'$prefill' => $prefill,
'$autocomp' => $autocomp,
'$preid' => $preid,
- '$subject' => t('Subject:'),
+ '$subject' => L10n::t('Subject:'),
'$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '',
'$text' => x($_REQUEST, 'body') ? escape_tags(htmlspecialchars($_REQUEST['body'])) : '',
'$readonly' => '',
- '$yourmessage' => t('Your message:'),
+ '$yourmessage' => L10n::t('Your message:'),
'$select' => $select,
'$parent' => '',
- '$upload' => t('Upload photo'),
- '$insert' => t('Insert web link'),
- '$wait' => t('Please wait'),
- '$submit' => t('Submit')
+ '$upload' => L10n::t('Upload photo'),
+ '$insert' => L10n::t('Insert web link'),
+ '$wait' => L10n::t('Please wait'),
+ '$submit' => L10n::t('Submit')
]);
return $o;
}
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
if (!DBM::is_result($r)) {
- info(t('No messages.') . EOL);
+ info(L10n::t('No messages.') . EOL);
return $o;
}
);
}
if (!count($messages)) {
- notice(t('Message not available.') . EOL);
+ notice(L10n::t('Message not available.') . EOL);
return $o;
}
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('msg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$mails = [];
'from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'subject' => $subject_e,
'body' => $body_e,
- 'delete' => t('Delete message'),
+ 'delete' => L10n::t('Delete message'),
'to_name' => $to_name_e,
'date' => datetime_convert('UTC', date_default_timezone_get(), $message['created'], 'D, d M Y - g:i A'),
'ago' => relative_date($message['created']),
'$thread_id' => $a->argv[1],
'$thread_subject' => $message['title'],
'$thread_seen' => $seen,
- '$delete' => t('Delete conversation'),
+ '$delete' => L10n::t('Delete conversation'),
'$canreply' => (($unknown) ? false : '1'),
- '$unknown_text' => t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
+ '$unknown_text' => L10n::t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
'$mails' => $mails,
// reply
- '$header' => t('Send Reply'),
- '$to' => t('To:'),
+ '$header' => L10n::t('Send Reply'),
+ '$to' => L10n::t('To:'),
'$showinputs' => '',
- '$subject' => t('Subject:'),
+ '$subject' => L10n::t('Subject:'),
'$subjtxt' => $message['title'],
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
- '$yourmessage' => t('Your message:'),
+ '$yourmessage' => L10n::t('Your message:'),
'$text' => '',
'$select' => $select,
'$parent' => $parent,
- '$upload' => t('Upload photo'),
- '$insert' => t('Insert web link'),
- '$submit' => t('Submit'),
- '$wait' => t('Please wait')
+ '$upload' => L10n::t('Upload photo'),
+ '$insert' => L10n::t('Insert web link'),
+ '$submit' => L10n::t('Submit'),
+ '$wait' => L10n::t('Please wait')
]);
return $o;
foreach ($msg as $rr) {
if ($rr['unknown']) {
- $participants = t("Unknown sender - %s", $rr['from-name']);
+ $participants = L10n::t("Unknown sender - %s", $rr['from-name']);
} elseif (link_compare($rr['from-url'], $myprofile)) {
- $participants = t("You and %s", $rr['name']);
+ $participants = L10n::t("You and %s", $rr['name']);
} else {
- $participants = t("%s and You", $rr['from-name']);
+ $participants = L10n::t("%s and You", $rr['from-name']);
}
$subject_e = (($rr['mailseen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>');
'$sparkle' => ' sparkle',
'$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'$subject' => $subject_e,
- '$delete' => t('Delete conversation'),
+ '$delete' => L10n::t('Delete conversation'),
'$body' => $body_e,
'$to_name' => $to_name_e,
- '$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['mailcreated'], t('D, d M Y - g:i A')),
+ '$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
'$ago' => relative_date($rr['mailcreated']),
'$seen' => $rr['mailseen'],
- '$count' => tt('%d message', '%d messages', $rr['count']),
+ '$count' => L10n::tt('%d message', '%d messages', $rr['count']),
]);
}
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;
function network_init(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
- 'delete' => t('Remove term'),
+ 'delete' => L10n::t('Remove term'),
'selected' => ($search == $rr['term']),
];
}
$tpl = get_markup_template('saved_searches_aside.tpl');
$o = replace_macros($tpl, [
- '$title' => t('Saved Searches'),
- '$add' => t('add'),
+ '$title' => L10n::t('Saved Searches'),
+ '$add' => L10n::t('add'),
'$searchbox' => search($search, 'netsearch-box', $srchurl, true),
'$saved' => $saved,
]);
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);
+ notice(L10n::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(L10n::t("Messages in this group won't be send to these receivers.").EOL);
}
}
if ($update) {
killme();
}
- notice(t('No such group') . EOL);
+ notice(L10n::t('No such group') . EOL);
goaway('network/0');
// NOTREACHED
}
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . protect_sprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
} else {
$sql_extra3 .= " AND false ";
- info(t('Group is empty'));
+ info(L10n::t('Group is empty'));
}
$o = replace_macros(get_markup_template('section_title.tpl'), [
- '$title' => t('Group: %s', $group['name'])
+ '$title' => L10n::t('Group: %s', $group['name'])
]) . $o;
} elseif ($cid) {
$fields = ['id', 'name', 'network', 'writable', 'nurl',
'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
}
// tabs
$tabs = [
[
- 'label' => t('Commented Order'),
+ 'label' => L10n::t('Commented Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $all_active,
- 'title' => t('Sort by Comment Date'),
+ 'title' => L10n::t('Sort by Comment Date'),
'id' => 'commented-order-tab',
'accesskey' => 'e',
],
[
- 'label' => t('Posted Order'),
+ 'label' => L10n::t('Posted Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $postord_active,
- 'title' => t('Sort by Post Date'),
+ 'title' => L10n::t('Sort by Post Date'),
'id' => 'posted-order-tab',
'accesskey' => 't',
],
if (Feature::isEnabled(local_user(), 'personal_tab')) {
$tabs[] = [
- 'label' => t('Personal'),
+ 'label' => L10n::t('Personal'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
'sel' => $conv_active,
- 'title' => t('Posts that mention or involve you'),
+ 'title' => L10n::t('Posts that mention or involve you'),
'id' => 'personal-tab',
'accesskey' => 'r',
];
if (Feature::isEnabled(local_user(), 'new_tab')) {
$tabs[] = [
- 'label' => t('New'),
+ 'label' => L10n::t('New'),
'url' => 'network/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
- 'title' => t('Activity Stream - by date'),
+ 'title' => L10n::t('Activity Stream - by date'),
'id' => 'activitiy-by-date-tab',
'accesskey' => 'w',
];
if (Feature::isEnabled(local_user(), 'link_tab')) {
$tabs[] = [
- 'label' => t('Shared Links'),
+ 'label' => L10n::t('Shared Links'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
'sel' => $bookmarked_active,
- 'title' => t('Interesting Links'),
+ 'title' => L10n::t('Interesting Links'),
'id' => 'shared-links-tab',
'accesskey' => 'b',
];
if (Feature::isEnabled(local_user(), 'star_posts')) {
$tabs[] = [
- 'label' => t('Starred'),
+ 'label' => L10n::t('Starred'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
'sel' => $starred_active,
- 'title' => t('Favourite Posts'),
+ 'title' => L10n::t('Favourite Posts'),
'id' => 'starred-posts-tab',
'accesskey' => 'm',
];
<?php
-
+/**
+ * @file mod/newmember.php
+ */
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
-function newmember_content(App $a) {
-
- $o = '<h1>' . t('Welcome to Friendica') . '</h1>';
- $o .= '<h3>' . t('New Member Checklist') . '</h3>';
+function newmember_content(App $a)
+{
+ $o = '<h1>' . L10n::t('Welcome to Friendica') . '</h1>';
+ $o .= '<h3>' . L10n::t('New Member Checklist') . '</h3>';
$o .= '<div style="font-size: 120%;">';
- $o .= t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
- $o .= '<h4>' . t('Getting Started') . '</h4>';
+ $o .= L10n::t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
+ $o .= '<h4>' . L10n::t('Getting Started') . '</h4>';
$o .= '<ul>';
- $o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
+ $o .= '<li> ' . '<a target="newmember" href="help/guide">' . L10n::t('Friendica Walk-Through') . '</a><br />' . L10n::t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
$o .= '</ul>';
- $o .= '<h4>' . t('Settings') . '</h4>';
+ $o .= '<h4>' . L10n::t('Settings') . '</h4>';
$o .= '<ul>';
- $o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
- $o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="settings">' . L10n::t('Go to Your Settings') . '</a><br />' . L10n::t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
+ $o .= '<li>' . L10n::t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
$o .= '</ul>';
- $o .= '<h4>' . t('Profile') . '</h4>';
+ $o .= '<h4>' . L10n::t('Profile') . '</h4>';
$o .= '<ul>';
- $o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
- $o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
- $o .= '<li>' . '<a target="newmember" href="profiles">' . t('Profile Keywords') . '</a><br />' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="profile_photo">' . L10n::t('Upload Profile Photo') . '</a><br />' . L10n::t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="profiles">' . L10n::t('Edit Your Profile') . '</a><br />' . L10n::t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="profiles">' . L10n::t('Profile Keywords') . '</a><br />' . L10n::t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
$o .= '</ul>';
- $o .= '<h4>' . t('Connecting') . '</h4>';
+ $o .= '<h4>' . L10n::t('Connecting') . '</h4>';
$o .= '<ul>';
$mail_disabled = ((function_exists('imap_open') && (!Config::get('system', 'imap_disabled'))) ? 0 : 1);
if (!$mail_disabled) {
- $o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="settings/connectors">' . L10n::t('Importing Emails') . '</a><br />' . L10n::t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
}
- $o .= '<li>' . '<a target="newmember" href="contacts">' . t('Go to Your Contacts Page') . '</a><br />' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
- $o .= '<li>' . '<a target="newmember" href="directory">' . t("Go to Your Site's Directory") . '</a><br />' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
- $o .= '<li>' . '<a target="newmember" href="contacts">' . t('Finding New People') . '</a><br />' . t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="contacts">' . L10n::t('Go to Your Contacts Page') . '</a><br />' . L10n::t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="directory">' . L10n::t("Go to Your Site's Directory") . '</a><br />' . L10n::t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="contacts">' . L10n::t('Finding New People') . '</a><br />' . L10n::t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
$o .= '</ul>';
- $o .= '<h4>' . t('Groups') . '</h4>';
+ $o .= '<h4>' . L10n::t('Groups') . '</h4>';
$o .= '<ul>';
- $o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="contacts">' . L10n::t('Group Your Contacts') . '</a><br />' . L10n::t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
if (Config::get('system', 'newuser_private')) {
- $o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . L10n::t("Why Aren't My Posts Public?") . '</a><br />' . L10n::t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
}
$o .= '</ul>';
- $o .= '<h4>' . t('Getting Help') . '</h4>';
+ $o .= '<h4>' . L10n::t('Getting Help') . '</h4>';
$o .= '<ul>';
- $o .= '<li>' . '<a target="newmember" href="help">' . t('Go to the Help Section') . '</a><br />' . t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
+ $o .= '<li>' . '<a target="newmember" href="help">' . L10n::t('Go to the Help Section') . '</a><br />' . L10n::t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
$o .= '</ul>';
$o .= '</div>';
*/
use Friendica\App;
use Friendica\Content\ContactSelector;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Group;
function nogroup_content(App $a)
{
if (! local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return '';
}
$contact_details = Contact::getDetailsByURL($rr['url'], local_user(), $rr);
$contacts[] = [
- 'img_hover' => t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
- 'edit_hover' => t('Edit contact'),
+ 'img_hover' => L10n::t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
+ 'edit_hover' => L10n::t('Edit contact'),
'photo_menu' => Contact::photoMenu($rr),
'id' => $rr['id'],
'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
$o = replace_macros(
$tpl,
[
- '$header' => t('Contacts who are not members of a group'),
+ '$header' => L10n::t('Contacts who are not members of a group'),
'$contacts' => $contacts,
'$paginate' => paginate($a)]
);
*/
use Friendica\App;
use Friendica\Content\Nav;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
-function notes_init(App $a) {
-
+function notes_init(App $a)
+{
if (! local_user()) {
return;
}
Nav::setSelected('home');
//Profile::load($a, $which, $profile);
-
}
-function notes_content(App $a, $update = false) {
-
+function notes_content(App $a, $update = false)
+{
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
- require_once("include/bbcode.php");
- require_once('include/security.php');
- require_once('include/conversation.php');
- require_once('include/acl_selectors.php');
+ require_once 'include/bbcode.php';
+ require_once 'include/security.php';
+ require_once 'include/conversation.php';
+ require_once 'include/acl_selectors.php';
$groups = [];
$o ="";
$o .= Profile::getTabs($a, true);
- if(! $update) {
- $o .= '<h3>' . t('Personal Notes') . '</h3>';
+ if (!$update) {
+ $o .= '<h3>' . L10n::t('Personal Notes') . '</h3>';
$commpage = false;
$commvisitor = false;
'bang' => '',
'visitor' => 'block',
'profile_uid' => local_user(),
- 'button' => t('Save'),
+ 'button' => L10n::t('Save'),
'acl_data' => '',
];
- $o .= status_editor($a,$x,$a->contact['id']);
-
+ $o .= status_editor($a, $x, $a->contact['id']);
}
// Construct permissions
WHERE %s AND `item`.`uid` = %d AND `item`.`type` = 'note'
AND `contact`.`self` AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall`
$sql_extra ",
- item_joins(), item_condition(),
+ item_joins(),
+ item_condition(),
intval(local_user())
-
);
if (DBM::is_result($r)) {
AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall`
$sql_extra
ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
- item_joins(), item_condition(),
+ item_joins(),
+ item_condition(),
intval(local_user()),
intval($a->pager['start']),
intval($a->pager['itemspage'])
$parents_str = '';
if (DBM::is_result($r)) {
- foreach($r as $rr)
+ foreach ($r as $rr) {
$parents_arr[] = $rr['item_id'];
+ }
$parents_str = implode(', ', $parents_arr);
$r = q("SELECT %s FROM `item` %s
WHERE %s AND `item`.`uid` = %d AND `item`.`parent` IN (%s)
$sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ",
- item_fieldlists(), item_joins(), item_condition(),
+ item_fieldlists(),
+ item_joins(),
+ item_condition(),
intval(local_user()),
dbesc($parents_str)
);
if (DBM::is_result($r)) {
- $items = conv_sort($r,"`commented`");
+ $items = conv_sort($r, "`commented`");
- $o .= conversation($a,$items,'notes',$update);
+ $o .= conversation($a, $items, 'notes', $update);
}
}
-
$o .= paginate($a);
return $o;
}
<?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)) {
goaway($url);
} else {
$a->error = 404;
- notice(t('Item not found.') . EOL);
+ notice(L10n::t('Item not found.') . EOL);
}
return;
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;
$contact_id = $r[0]['contact-id'];
}
else {
- notice( t('Invalid request identifier.') . EOL);
+ notice(L10n::t('Invalid request identifier.') . EOL);
return;
}
$fid = $r[0]['fid'];
- if($_POST['submit'] == t('Discard')) {
+ if($_POST['submit'] == L10n::t('Discard')) {
$r = q("DELETE FROM `intro` WHERE `id` = %d",
intval($intro_id)
);
}
goaway('notifications/intros');
}
- if($_POST['submit'] == t('Ignore')) {
+ if($_POST['submit'] == L10n::t('Ignore')) {
$r = q("UPDATE `intro` SET `ignore` = 1 WHERE `id` = %d",
intval($intro_id));
goaway('notifications/intros');
function notifications_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
// Get introductions
if ((($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) {
Nav::setSelected('introductions');
- $notif_header = t('Notifications');
+ $notif_header = L10n::t('Notifications');
$all = (($a->argc > 2) && ($a->argv[2] == 'all'));
// Get the network notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'network')) {
- $notif_header = t('Network Notifications');
+ $notif_header = L10n::t('Network Notifications');
$notifs = $nm->networkNotifs($show, $startrec, $perpage);
// Get the system notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'system')) {
- $notif_header = t('System Notifications');
+ $notif_header = L10n::t('System Notifications');
$notifs = $nm->systemNotifs($show, $startrec, $perpage);
// Get the personal notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'personal')) {
- $notif_header = t('Personal Notifications');
+ $notif_header = L10n::t('Personal Notifications');
$notifs = $nm->personalNotifs($show, $startrec, $perpage);
// Get the home notifications
} else if (($a->argc > 1) && ($a->argv[1] == 'home')) {
- $notif_header = t('Home Notifications');
+ $notif_header = L10n::t('Home Notifications');
$notifs = $nm->homeNotifs($show, $startrec, $perpage);
}
// The link to switch between ignored and normal connection requests
$notif_show_lnk = [
'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros' ),
- 'text' => (!$all ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
+ 'text' => (!$all ? L10n::t('Show Ignored Requests') : L10n::t('Hide Ignored Requests'))
];
// Loop through all introduction notifications.This creates an array with the output html for each
switch ($it['label']) {
case 'friend_suggestion':
$notif_content[] = replace_macros($sugg, [
- '$str_notifytype' => t('Notification type: '),
+ '$str_notifytype' => L10n::t('Notification type: '),
'$notify_type' => $it['notify_type'],
'$intro_id' => $it['intro_id'],
- '$madeby' => sprintf( t('suggested by %s'),$it['madeby']),
+ '$madeby' => L10n::t('suggested by %s', $it['madeby']),
'$contact_id' => $it['contact-id'],
'$photo' => $it['photo'],
'$fullname' => $it['name'],
'$url' => $it['url'],
- '$hidden' => ['hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''],
- '$activity' => ['activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')],
+ '$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
+ '$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
'$knowyou' => $it['knowyou'],
- '$approve' => t('Approve'),
+ '$approve' => L10n::t('Approve'),
'$note' => $it['note'],
'$request' => $it['request'],
- '$ignore' => t('Ignore'),
- '$discard' => t('Discard'),
+ '$ignore' => L10n::t('Ignore'),
+ '$discard' => L10n::t('Discard'),
]);
break;
if($it['network'] === NETWORK_DFRN || $it['network'] === NETWORK_DIASPORA) {
if($it['network'] === NETWORK_DFRN) {
- $lbl_knowyou = t('Claims to be known to you: ');
- $knowyou = (($it['knowyou']) ? t('yes') : t('no'));
- $helptext = t('Shall your connection be bidirectional or not?');
- $helptext2 = sprintf(t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
- $helptext3 = sprintf(t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
+ $lbl_knowyou = L10n::t('Claims to be known to you: ');
+ $knowyou = (($it['knowyou']) ? L10n::t('yes') : L10n::t('no'));
+ $helptext = L10n::t('Shall your connection be bidirectional or not?');
+ $helptext2 = L10n::t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $it['name'], $it['name']);
+ $helptext3 = L10n::t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $it['name']);
} else {
$knowyou = '';
- $helptext = t('Shall your connection be bidirectional or not?');
- $helptext2 = sprintf(t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.'), $it['name'], $it['name']);
- $helptext3 = sprintf(t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.'), $it['name']);
+ $helptext = L10n::t('Shall your connection be bidirectional or not?');
+ $helptext2 = L10n::t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $it['name'], $it['name']);
+ $helptext3 = L10n::t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $it['name']);
}
}
'$approve_as1' => $helptext,
'$approve_as2' => $helptext2,
'$approve_as3' => $helptext3,
- '$as_friend' => t('Friend'),
- '$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? t('Sharer') : t('Subscriber'))
+ '$as_friend' => L10n::t('Friend'),
+ '$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? L10n::t('Sharer') : L10n::t('Subscriber'))
]);
$header = $it["name"];
$header .= " (".ContactSelector::networkToName($it['network'], $it['url']).")";
if ($it['network'] != NETWORK_DIASPORA) {
- $discard = t('Discard');
+ $discard = L10n::t('Discard');
} else {
$discard = '';
}
$notif_content[] = replace_macros($tpl, [
'$header' => htmlentities($header),
- '$str_notifytype' => t('Notification type: '),
+ '$str_notifytype' => L10n::t('Notification type: '),
'$notify_type' => $it['notify_type'],
'$dfrn_text' => $dfrn_text,
'$dfrn_id' => $it['dfrn_id'],
'$photo' => $it['photo'],
'$fullname' => $it['name'],
'$location' => $it['location'],
- '$lbl_location' => t('Location:'),
+ '$lbl_location' => L10n::t('Location:'),
'$about' => $it['about'],
- '$lbl_about' => t('About:'),
+ '$lbl_about' => L10n::t('About:'),
'$keywords' => $it['keywords'],
- '$lbl_keywords' => t('Tags:'),
+ '$lbl_keywords' => L10n::t('Tags:'),
'$gender' => $it['gender'],
- '$lbl_gender' => t('Gender:'),
- '$hidden' => ['hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''],
- '$activity' => ['activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')],
+ '$lbl_gender' => L10n::t('Gender:'),
+ '$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
+ '$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
'$url' => $it['url'],
'$zrl' => $it['zrl'],
- '$lbl_url' => t('Profile URL'),
+ '$lbl_url' => L10n::t('Profile URL'),
'$addr' => $it['addr'],
'$lbl_knowyou' => $lbl_knowyou,
- '$lbl_network' => t('Network:'),
+ '$lbl_network' => L10n::t('Network:'),
'$network' => ContactSelector::networkToName($it['network'], $it['url']),
'$knowyou' => $knowyou,
- '$approve' => t('Approve'),
+ '$approve' => L10n::t('Approve'),
'$note' => $it['note'],
- '$ignore' => t('Ignore'),
+ '$ignore' => L10n::t('Ignore'),
'$discard' => $discard,
]);
}
if($notifs['total'] == 0)
- info( t('No introductions.') . EOL);
+ info(L10n::t('No introductions.') . EOL);
// Normal notifications (no introductions)
} else {
// It doesn't make sense to show the Show unread / Show all link visible if the user is on the
// "Show all" page and there are no notifications. So we will hide it.
- if($show == 0 || intval($show) && $notifs['total'] > 0) {
+ if ($show == 0 || intval($show) && $notifs['total'] > 0) {
$notif_show_lnk = [
'href' => ($show ? 'notifications/'.$notifs['ident'] : 'notifications/'.$notifs['ident'].'?show=all' ),
- 'text' => ($show ? t('Show unread') : t('Show all')),
+ 'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
];
}
// Output if there aren't any notifications available
- if($notifs['total'] == 0)
- $notif_nocontent = sprintf( t('No more %s notifications.'), $notifs['ident']);
+ if ($notifs['total'] == 0) {
+ $notif_nocontent = L10n::t('No more %s notifications.', $notifs['ident']);
+ }
}
$o .= replace_macros($notif_tpl, [
<?php
-
+/**
+ * @file mod/notify.php
+ */
use Friendica\App;
use Friendica\Core\NotificationsManager;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Module\Login;
-function notify_init(App $a) {
+function notify_init(App $a)
+{
if (! local_user()) {
return;
}
goaway(System::baseUrl(true));
}
- if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) {
+ if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all') {
$r = $nm->setAllSeen();
$j = json_encode(['result' => ($r) ? 'success' : 'fail']);
echo $j;
killme();
}
-
}
-function notify_content(App $a) {
+function notify_content(App $a)
+{
if (! local_user()) {
return Login::form();
}
$r = $nm->getAll(['seen'=>0]);
if (DBM::is_result($r) > 0) {
foreach ($r as $it) {
- $notif_content .= replace_macros($not_tpl,[
+ $notif_content .= replace_macros($not_tpl, [
'$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
'$item_image' => $it['photo'],
'$item_text' => strip_tags(bbcode($it['msg'])),
]);
}
} else {
- $notif_content .= t('No more system notifications.');
+ $notif_content .= L10n::t('No more system notifications.');
}
$o .= replace_macros($notif_tpl, [
- '$notif_header' => t('System Notifications'),
+ '$notif_header' => L10n::t('System Notifications'),
'$tabs' => false, // $tabs,
'$notif_content' => $notif_content,
]);
return $o;
-
-
}
<?php
-
+/**
+ * @file mod/oexchange.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Module\Login;
}
if (($a->argc > 1) && $a->argv[1] === 'done') {
- info( t('Post successful.') . EOL);
+ info(L10n::t('Post successful.') . EOL);
return;
}
<?php
-
+/**
+ * @file mod/openid.php
+ */
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
$authid = $_REQUEST['openid_identity'];
if(! strlen($authid)) {
- logger( t('OpenID protocol error. No ID returned.') . EOL);
+ logger(L10n::t('OpenID protocol error. No ID returned.') . EOL);
goaway(System::baseUrl());
}
// 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());
}
// NOTREACHED
}
}
- notice( t('Login failed.') . EOL);
+ notice(L10n::t('Login failed.') . EOL);
goaway(System::baseUrl());
// NOTREACHED
}
* @file mod/ostatus_subscribe.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Model\Contact;
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
}
- $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"]);
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.System::baseUrl().'/settings/connectors">';
PConfig::delete($uid, "ostatus", "legacy_friends");
PConfig::delete($uid, "ostatus", "legacy_contact");
- $o .= t("Done");
+ $o .= L10n::t("Done");
return $o;
}
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];
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;
$ret['albums'] = [];
foreach ($albums as $k => $album) {
//hide profile photos to others
- if (!$is_owner && !remote_user() && ($album['album'] == t('Profile Photos')))
+ if (!$is_owner && !remote_user() && ($album['album'] == L10n::t('Profile Photos')))
continue;
$entry = [
'text' => $album['album'],
if ($ret['success']) {
$photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'), [
'$nick' => $a->data['user']['nickname'],
- '$title' => t('Photo Albums'),
- '$recent' => t('Recent Photos'),
+ '$title' => L10n::t('Photo Albums'),
+ '$recent' => L10n::t('Recent Photos'),
'$albums' => $ret['albums'],
'$baseurl' => System::baseUrl(),
- '$upload' => [t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
+ '$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
'$can_post' => $can_post
]);
}
$tpl = get_markup_template("photos_head.tpl");
$a->page['htmlhead'] .= replace_macros($tpl,[
- '$ispublic' => t('everybody')
+ '$ispublic' => L10n::t('everybody')
]);
}
}
if (!$can_post) {
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
killme();
}
);
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();
}
if ($a->argc > 3 && $a->argv[2] === 'album') {
$album = hex2bin($a->argv[3]);
- if ($album === t('Profile Photos') || $album === 'Contact Photos' || $album === t('Contact Photos')) {
+ if ($album === L10n::t('Profile Photos') || $album === 'Contact Photos' || $album === L10n::t('Contact Photos')) {
goaway($_SESSION['photo_return']);
return; // NOTREACHED
}
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
}
* DELETE photo album and all its photos
*/
- if ($_POST['dropalbum'] == t('Delete Album')) {
+ if ($_POST['dropalbum'] == L10n::t('Delete Album')) {
// Check if we should do HTML-based delete confirmation
if (x($_REQUEST, 'confirm')) {
$drop_url = $a->query_string;
];
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
- '$message' => t('Do you really want to delete this photo album and all its photos?'),
+ '$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
'$extra_inputs' => $extra_inputs,
- '$confirm' => t('Delete Album'),
+ '$confirm' => L10n::t('Delete Album'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'dropalbum', // Needed so that confirmation will bring us back into this if statement
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
goaway($_SESSION['photo_return']);
}
- if ($a->argc > 2 && defaults($_POST, 'delete', '') === t('Delete Photo')) {
+ if ($a->argc > 2 && defaults($_POST, 'delete', '') === L10n::t('Delete Photo')) {
// same as above but remove single photo
$drop_url = $a->query_string;
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
- '$message' => t('Do you really want to delete this photo?'),
+ '$message' => L10n::t('Do you really want to delete this photo?'),
'$extra_inputs' => [],
- '$confirm' => t('Delete Photo'),
+ '$confirm' => L10n::t('Delete Photo'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'delete', // Needed so that confirmation will bring us back into this if statement
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
$arr['tag'] = $tagged[4];
$arr['inform'] = $tagged[2];
$arr['origin'] = 1;
- $arr['body'] = sprintf( t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
+ $arr['body'] = L10n::t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . L10n::t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
$arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
dbesc($album),
intval($page_owner_uid)
);
- if (!DBM::is_result($r) || ($album == t('Profile Photos'))) {
+ if (!DBM::is_result($r) || ($album == L10n::t('Profile Photos'))) {
$visible = 1;
} else {
$visible = 0;
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);
$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);
}
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);
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);
$r = Photo::store($Image, $page_owner_uid, $visitor, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if (!$r) {
- logger('mod/photos.php: photos_post(): image store failed' , LOGGER_DEBUG);
- notice(t('Image upload failed.') . EOL);
+ logger('mod/photos.php: photos_post(): image store failed', LOGGER_DEBUG);
+ notice(L10n::t('Image upload failed.') . EOL);
killme();
}
// 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;
}
require_once 'include/conversation.php';
if (!x($a->data,'user')) {
- notice( t('No photos selected') . EOL );
+ notice(L10n::t('No photos selected') . EOL );
return;
}
}
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;
}
// Display upload form
if ($datatype === 'upload') {
if (!$can_post) {
- notice(t('Permission denied.'));
+ notice(L10n::t('Permission denied.'));
return;
}
$albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '> </option>';
if (count($a->data['albums'])) {
foreach ($a->data['albums'] as $album) {
- if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === t('Contact Photos'))) {
+ if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === L10n::t('Contact Photos'))) {
continue;
}
$selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
$default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), []);
$default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
]);
$usage_message = '';
$aclselect_e = ($visitor ? '' : populate_acl($a->user));
$o .= replace_macros($tpl,[
- '$pagename' => t('Upload Photos'),
+ '$pagename' => L10n::t('Upload Photos'),
'$sessid' => session_id(),
'$usage' => $usage_message,
'$nickname' => $a->data['user']['nickname'],
- '$newalbum' => t('New album name: '),
- '$existalbumtext' => t('or existing album name: '),
- '$nosharetext' => t('Do not show a status post for this upload'),
+ '$newalbum' => L10n::t('New album name: '),
+ '$existalbumtext' => L10n::t('or existing album name: '),
+ '$nosharetext' => L10n::t('Do not show a status post for this upload'),
'$albumselect' => $albumselect,
- '$permissions' => t('Permissions'),
+ '$permissions' => L10n::t('Permissions'),
'$aclselect' => $aclselect_e,
'$alt_uploader' => $ret['addon_text'],
'$default_upload_box' => ($ret['default_upload'] ? $default_upload_box : ''),
'$uploadurl' => $ret['post_url'],
// ACL permissions box
- '$group_perms' => t('Show to Groups'),
- '$contact_perms' => t('Show to Contacts'),
+ '$group_perms' => L10n::t('Show to Groups'),
+ '$contact_perms' => L10n::t('Show to Contacts'),
'$return_path' => $a->query_string,
]);
// edit album name
if ($cmd === 'edit') {
- if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
+ if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos'))) {
if ($can_post) {
$edit_tpl = get_markup_template('album_edit.tpl');
$album_e = $album;
$o .= replace_macros($edit_tpl,[
- '$nametext' => t('New album name: '),
+ '$nametext' => L10n::t('New album name: '),
'$nickname' => $a->data['user']['nickname'],
'$album' => $album_e,
'$hexalbum' => bin2hex($album),
- '$submit' => t('Submit'),
- '$dropsubmit' => t('Delete Album')
+ '$submit' => L10n::t('Submit'),
+ '$dropsubmit' => L10n::t('Delete Album')
]);
}
}
} else {
- if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos')) && $can_post) {
- $edit = [t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
+ if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos')) && $can_post) {
+ $edit = [L10n::t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
}
}
if ($order_field === 'posted') {
- $order = [t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)];
+ $order = [L10n::t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)];
} else {
- $order = [t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'];
+ $order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'];
}
$photos = [];
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
. ($order_field === 'posted' ? '?f=&order=posted' : ''),
- 'title' => t('View Photo'),
+ 'title' => L10n::t('View Photo'),
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
'alt' => $imgalt_e,
'desc'=> $desc_e,
'$photos' => $photos,
'$album' => $album,
'$can_post' => $can_post,
- '$upload' => [t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
+ '$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
'$order' => $order,
'$edit' => $edit,
'$paginate' => paginate($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;
}
if ($can_post && ($ph[0]['uid'] == $owner_uid)) {
$tools = [
- 'edit' => ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))],
- 'profile'=>['profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')],
+ 'edit' => ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? L10n::t('View photo') : L10n::t('Edit photo'))],
+ 'profile'=>['profile_photo/use/'.$ph[0]['resource-id'], L10n::t('Use as profile photo')],
];
// lock
$lock = ( ( ($ph[0]['uid'] == local_user()) && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid'])
|| strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) )
- ? t('Private Message')
+ ? L10n::t('Private Message')
: Null);
$photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
- 'title'=> t('View Full Size'),
+ 'title'=> L10n::t('View Full Size'),
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'),
'height' => $hires['height'],
'width' => $hires['width'],
}
$tag_str .= bbcode($t);
}
- $tags = [t('Tags: '), $tag_str];
+ $tags = [L10n::t('Tags: '), $tag_str];
if ($cmd === 'edit') {
$tags[] = 'tagrm/' . $link_item['id'];
- $tags[] = t('[Remove any tag]');
+ $tags[] = L10n::t('[Remove any tag]');
}
}
$edit = replace_macros($edit_tpl, [
'$id' => $ph[0]['id'],
- '$album' => ['albname', t('New album name'), $album_e,''],
- '$caption' => ['desc', t('Caption'), $caption_e, ''],
- '$tags' => ['newtag', t('Add a Tag'), "", t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')],
- '$rotate_none' => ['rotate', t('Do not rotate'),0,'', true],
- '$rotate_cw' => ['rotate', t('Rotate CW (right)'),1,''],
- '$rotate_ccw' => ['rotate', t('Rotate CCW (left)'),2,''],
+ '$album' => ['albname', L10n::t('New album name'), $album_e,''],
+ '$caption' => ['desc', L10n::t('Caption'), $caption_e, ''],
+ '$tags' => ['newtag', L10n::t('Add a Tag'), "", L10n::t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')],
+ '$rotate_none' => ['rotate', L10n::t('Do not rotate'),0,'', true],
+ '$rotate_cw' => ['rotate', L10n::t('Rotate CW (right)'),1,''],
+ '$rotate_ccw' => ['rotate', L10n::t('Rotate CCW (left)'),2,''],
'$nickname' => $a->data['user']['nickname'],
'$resource_id' => $ph[0]['resource-id'],
- '$permissions' => t('Permissions'),
+ '$permissions' => L10n::t('Permissions'),
'$aclselect' => $aclselect_e,
'$item_id' => defaults($link_item, 'id', 0),
- '$submit' => t('Submit'),
- '$delete' => t('Delete Photo'),
+ '$submit' => L10n::t('Submit'),
+ '$delete' => L10n::t('Delete Photo'),
// ACL permissions box
- '$group_perms' => t('Show to Groups'),
- '$contact_perms' => t('Show to Contacts'),
+ '$group_perms' => L10n::t('Show to Groups'),
+ '$contact_perms' => L10n::t('Show to Contacts'),
'$return_path' => $a->query_string,
]);
}
$like_tpl = get_markup_template('like_noshare.tpl');
$likebuttons = replace_macros($like_tpl, [
'$id' => $link_item['id'],
- '$likethis' => t("I like this \x28toggle\x29"),
- '$nolike' => (Feature::isEnabled(local_user(), 'dislike') ? t("I don't like this \x28toggle\x29") : ''),
- '$wait' => t('Please wait'),
+ '$likethis' => L10n::t("I like this \x28toggle\x29"),
+ '$nolike' => (Feature::isEnabled(local_user(), 'dislike') ? L10n::t("I don't like this \x28toggle\x29") : ''),
+ '$wait' => L10n::t('Please wait'),
'$return_path' => $a->query_string,
]);
}
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
'$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
+ '$mytitle' => L10n::t('This is you'),
'$myphoto' => $contact['thumb'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$preview' => t('Preview'),
- '$sourceapp' => t($a->sourcename),
+ '$comment' => L10n::t('Comment'),
+ '$submit' => L10n::t('Submit'),
+ '$preview' => L10n::t('Preview'),
+ '$sourceapp' => L10n::t($a->sourcename),
'$ww' => '',
'$rand_num' => random_digits(12)
]);
}
$conv_responses = [
- 'like' => ['title' => t('Likes','title')],'dislike' => ['title' => t('Dislikes','title')],
- 'attendyes' => ['title' => t('Attending','title')], 'attendno' => ['title' => t('Not attending','title')], 'attendmaybe' => ['title' => t('Might attend','title')]
+ 'like' => ['title' => L10n::t('Likes','title')],'dislike' => ['title' => L10n::t('Dislikes','title')],
+ 'attendyes' => ['title' => L10n::t('Attending','title')], 'attendno' => ['title' => L10n::t('Not attending','title')], 'attendmaybe' => ['title' => L10n::t('Might attend','title')]
];
// display comments
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
'$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
+ '$mytitle' => L10n::t('This is you'),
'$myphoto' => $contact['thumb'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$preview' => t('Preview'),
- '$sourceapp' => t($a->sourcename),
+ '$comment' => L10n::t('Comment'),
+ '$submit' => L10n::t('Submit'),
+ '$preview' => L10n::t('Preview'),
+ '$sourceapp' => L10n::t($a->sourcename),
'$ww' => '',
'$rand_num' => random_digits(12)
]);
$drop = [
'dropping' => $dropping,
'pagedrop' => false,
- 'select' => t('Select'),
- 'delete' => t('Delete'),
+ 'select' => L10n::t('Select'),
+ 'delete' => L10n::t('Delete'),
];
$name_e = $profile_name;
'$parent' => $item['parent'],
'$profile_uid' => $owner_uid,
'$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
+ '$mytitle' => L10n::t('This is you'),
'$myphoto' => $contact['thumb'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$preview' => t('Preview'),
- '$sourceapp' => t($a->sourcename),
+ '$comment' => L10n::t('Comment'),
+ '$submit' => L10n::t('Submit'),
+ '$preview' => L10n::t('Preview'),
+ '$sourceapp' => L10n::t($a->sourcename),
'$ww' => '',
'$rand_num' => random_digits(12)
]);
'$tags' => $tags,
'$edit' => $edit,
'$map' => $map,
- '$map_text' => t('Map'),
+ '$map_text' => L10n::t('Map'),
'$likebuttons' => $likebuttons,
'$like' => $like,
'$dislike' => $dislike,
$sql_extra GROUP BY `resource-id`",
intval($a->data['user']['uid']),
dbesc('Contact Photos'),
- dbesc( t('Contact Photos'))
+ dbesc(L10n::t('Contact Photos'))
);
if (DBM::is_result($r)) {
$a->set_pager_total(count($r));
$sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
intval($a->data['user']['uid']),
dbesc('Contact Photos'),
- dbesc( t('Contact Photos')),
+ dbesc(L10n::t('Contact Photos')),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
$twist = false;
foreach ($r as $rr) {
//hide profile photos to others
- if (!$is_owner && !remote_user() && ($rr['album'] == t('Profile Photos')))
+ if (!$is_owner && !remote_user() && ($rr['album'] == L10n::t('Profile Photos')))
continue;
$twist = !$twist;
'id' => $rr['id'],
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
- 'title' => t('View Photo'),
+ 'title' => L10n::t('View Photo'),
'src' => 'photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
'alt' => $alt_e,
'album' => [
'link' => 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
- 'alt' => t('View Album'),
+ 'alt' => L10n::t('View Album'),
],
];
$tpl = get_markup_template('photos_recent.tpl');
$o .= replace_macros($tpl, [
- '$title' => t('Recent Photos'),
+ '$title' => L10n::t('Recent Photos'),
'$can_post' => $can_post,
- '$upload' => [t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'],
+ '$upload' => [L10n::t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'],
'$photos' => $photos,
'$paginate' => paginate($a),
]);
use Friendica\Content\ForumManager;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
'photo' => $intro['photo'],
'date' => $intro['datetime'],
'seen' => false,
- 'message' => t('{0} wants to be your friend'),
+ 'message' => L10n::t('{0} wants to be your friend'),
];
$notifs[] = $notif;
}
'photo' => $mail['from-photo'],
'date' => $mail['created'],
'seen' => false,
- 'message' => t('{0} sent you a message'),
+ 'message' => L10n::t('{0} sent you a message'),
];
$notifs[] = $notif;
}
'photo' => $reg['micro'],
'date' => $reg['created'],
'seen' => false,
- 'message' => t('{0} requested registration'),
+ 'message' => L10n::t('{0} requested registration'),
];
$notifs[] = $notif;
}
<?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
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) {
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
$arr['origin'] = 1;
- $arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
+ $arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . L10n::t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $target['name'] . '</title><id>' . System::baseUrl() . '/contact/' . $target['id'] . '</id>';
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
function poke_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$tpl = get_markup_template('poke_content.tpl');
$o = replace_macros($tpl,[
- '$title' => t('Poke/Prod'),
- '$desc' => t('poke, prod or do other things to somebody'),
- '$clabel' => t('Recipient'),
- '$choice' => t('Choose what you wish to do to recipient'),
+ '$title' => L10n::t('Poke/Prod'),
+ '$desc' => L10n::t('poke, prod or do other things to somebody'),
+ '$clabel' => L10n::t('Recipient'),
+ '$choice' => L10n::t('Choose what you wish to do to recipient'),
'$verbs' => $shortlist,
'$parent' => $parent,
- '$prv_desc' => t('Make this post private'),
- '$submit' => t('Submit'),
+ '$prv_desc' => L10n::t('Make this post private'),
+ '$submit' => L10n::t('Submit'),
'$name' => $name,
'$id' => $id
]);
<?php
-
+/**
+ * @file mod/probe.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Network\Probe;
-function probe_content(App $a) {
-
+function probe_content(App $a)
+{
if (!local_user()) {
- http_status_exit(403, ["title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a probing.")]);
+ http_status_exit(403, ["title" => L10n::t("Public access denied."),
+ "description" => L10n::t("Only logged in users are permitted to perform a probing.")]);
killme();
}
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;
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;
}
}
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . ($a->profile['net-publish'] ? 'true' : 'false') . '" />' . "\r\n";
- $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/" title="' . t('%s\'s posts', $a->profile['username']) . '"/>' . "\r\n";
- $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/comments" title="' . t('%s\'s comments', $a->profile['username']) . '"/>' . "\r\n";
- $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/activity" title="' . t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
+ $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\r\n";
+ $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\r\n";
+ $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . ($a->path ? '/' . $a->path : ''));
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . System::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
$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;
}
$o .= Widget::commonFriendsVisitor($a->profile['profile_uid']);
if (x($_SESSION, 'new_member') && $is_owner) {
- $o .= '<a href="newmember" id="newmember-tips" style="font-size: 1.2em;"><b>' . t('Tips for New Members') . '</b></a>' . EOL;
+ $o .= '<a href="newmember" id="newmember-tips" style="font-size: 1.2em;"><b>' . L10n::t('Tips for New Members') . '</b></a>' . EOL;
}
$commpage = $a->profile['page-flags'] == PAGE_COMMUNITY;
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
function profile_photo_post(App $a) {
if (! local_user()) {
- notice ( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
return;
}
// 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;
}
if ($Image->isValid()) {
$Image->crop(175,$srcX,$srcY,$srcW,$srcH);
- $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 4, $is_default_profile);
+ $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'],$base_image['filename'], L10n::t('Profile Photos'), 4, $is_default_profile);
if ($r === false) {
- notice ( sprintf(t('Image size reduction [%s] failed.'),"175") . EOL );
+ notice(L10n::t('Image size reduction [%s] failed.', "175") . EOL);
}
$Image->scaleDown(80);
- $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 5, $is_default_profile);
+ $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'],$base_image['filename'], L10n::t('Profile Photos'), 5, $is_default_profile);
if ($r === false) {
- notice( sprintf(t('Image size reduction [%s] failed.'),"80") . EOL );
+ notice(L10n::t('Image size reduction [%s] failed.', "80") . EOL);
}
$Image->scaleDown(48);
- $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'],$base_image['filename'], t('Profile Photos'), 6, $is_default_profile);
+ $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'],$base_image['filename'], L10n::t('Profile Photos'), 6, $is_default_profile);
if ($r === false) {
- notice( sprintf(t('Image size reduction [%s] failed.'),"48") . EOL );
+ notice(L10n::t('Image size reduction [%s] failed.', "48") . EOL);
}
// If setting for the default profile, unset the profile photo flag from any other photos I own
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'))) {
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
} else {
- notice( t('Unable to process image') . EOL);
+ notice(L10n::t('Unable to process image') . EOL);
}
}
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) {
- notice(sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize)) . EOL);
+ notice(L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
@unlink($src);
return;
}
$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;
}
function profile_photo_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
return;
}
if( $a->argv[1]=='use'){
if ($a->argc<3){
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
return;
};
dbesc($resource_id)
);
if (!DBM::is_result($r)){
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
return;
}
$havescale = false;
// set an already uloaded photo as profile photo
// if photo is in 'Profile Photos', change it in db
- if (($r[0]['album']== t('Profile Photos')) && ($havescale)){
+ if (($r[0]['album']== L10n::t('Profile Photos')) && ($havescale)){
$r=q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d",
intval(local_user()));
$o .= replace_macros($tpl,[
'$user' => $a->user['nickname'],
- '$lbl_upfile' => t('Upload File:'),
- '$lbl_profiles' => t('Select a profile:'),
- '$title' => t('Upload Profile Photo'),
- '$submit' => t('Upload'),
+ '$lbl_upfile' => L10n::t('Upload File:'),
+ '$lbl_profiles' => L10n::t('Select a profile:'),
+ '$title' => L10n::t('Upload Profile Photo'),
+ '$submit' => L10n::t('Upload'),
'$profiles' => $profiles,
'$form_security_token' => get_form_security_token("profile_photo"),
- '$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . System::baseUrl() . '">' . t('skip this step') . '</a>' : '<a href="'. System::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . t('select a photo from your photo albums') . '</a>')
+ '$select' => sprintf('%s %s', L10n::t('or'), ($newuser) ? '<a href="' . System::baseUrl() . '">' . L10n::t('skip this step') . '</a>' : '<a href="'. System::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . L10n::t('select a photo from your photo albums') . '</a>')
]);
return $o;
'$profile' => intval($_REQUEST['profile']),
'$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
'$image_url' => System::baseUrl() . '/photo/' . $filename,
- '$title' => t('Crop Image'),
- '$desc' => t('Please adjust the image cropping for optimum viewing.'),
+ '$title' => L10n::t('Crop Image'),
+ '$desc' => L10n::t('Please adjust the image cropping for optimum viewing.'),
'$form_security_token' => get_form_security_token("profile_photo"),
- '$done' => t('Done Editing')
+ '$done' => L10n::t('Done Editing')
]);
return $o;
}
$smallest = 0;
- $r = Photo::store($Image, local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 );
+ $r = Photo::store($Image, local_user(), 0, $hash, $filename, L10n::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) {
$Image->scaleDown(640);
- $r = Photo::store($Image, local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 );
+ $r = Photo::store($Image, local_user(), 0, $hash, $filename, L10n::t('Profile Photos'), 1);
if ($r === false) {
- notice( sprintf(t('Image size reduction [%s] failed.'),"640") . EOL );
+ notice(L10n::t('Image size reduction [%s] failed.', "640") . EOL);
} else {
$smallest = 1;
}
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;
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
}
intval(local_user())
);
if (DBM::is_result($r)) {
- info(t('Profile deleted.').EOL);
+ info(L10n::t('Profile deleted.').EOL);
}
goaway('profiles');
$num_profiles = (DBM::is_result($r0) ? count($r0) : 0);
- $name = t('Profile-') . ($num_profiles + 1);
+ $name = L10n::t('Profile-') . ($num_profiles + 1);
$r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
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']);
}
$num_profiles = (DBM::is_result($r0) ? count($r0) : 0);
- $name = t('Profile-') . ($num_profiles + 1);
+ $name = L10n::t('Profile-') . ($num_profiles + 1);
$r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
intval(local_user()),
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;
}
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']);
}
intval(local_user())
);
if (! DBM::is_result($r)) {
- notice( t('Profile not found.') . EOL);
+ notice(L10n::t('Profile not found.') . EOL);
killme();
return;
}
function profiles_post(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
intval(local_user())
);
if (! DBM::is_result($orig)) {
- notice( t('Profile not found.') . EOL);
+ notice(L10n::t('Profile not found.') . EOL);
return;
}
$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;
}
$value = '';
if ($is_default) {
if ($marital != $orig[0]['marital']) {
- $changes[] = '[color=#ff0000]♥[/color] ' . t('Marital Status');
+ $changes[] = '[color=#ff0000]♥[/color] ' . L10n::t('Marital Status');
$value = $marital;
}
if ($withchanged) {
- $changes[] = '[color=#ff0000]♥[/color] ' . t('Romantic Partner');
+ $changes[] = '[color=#ff0000]♥[/color] ' . L10n::t('Romantic Partner');
$value = strip_tags($with);
}
if ($likes != $orig[0]['likes']) {
- $changes[] = t('Likes');
+ $changes[] = L10n::t('Likes');
$value = $likes;
}
if ($dislikes != $orig[0]['dislikes']) {
- $changes[] = t('Dislikes');
+ $changes[] = L10n::t('Dislikes');
$value = $dislikes;
}
if ($work != $orig[0]['work']) {
- $changes[] = t('Work/Employment');
+ $changes[] = L10n::t('Work/Employment');
}
if ($religion != $orig[0]['religion']) {
- $changes[] = t('Religion');
+ $changes[] = L10n::t('Religion');
$value = $religion;
}
if ($politic != $orig[0]['politic']) {
- $changes[] = t('Political Views');
+ $changes[] = L10n::t('Political Views');
$value = $politic;
}
if ($gender != $orig[0]['gender']) {
- $changes[] = t('Gender');
+ $changes[] = L10n::t('Gender');
$value = $gender;
}
if ($sexual != $orig[0]['sexual']) {
- $changes[] = t('Sexual Preference');
+ $changes[] = L10n::t('Sexual Preference');
$value = $sexual;
}
if ($xmpp != $orig[0]['xmpp']) {
- $changes[] = t('XMPP');
+ $changes[] = L10n::t('XMPP');
$value = $xmpp;
}
if ($homepage != $orig[0]['homepage']) {
- $changes[] = t('Homepage');
+ $changes[] = L10n::t('Homepage');
$value = $homepage;
}
if ($interest != $orig[0]['interest']) {
- $changes[] = t('Interests');
+ $changes[] = L10n::t('Interests');
$value = $interest;
}
if ($address != $orig[0]['address']) {
- $changes[] = t('Address');
+ $changes[] = L10n::t('Address');
// New address not sent in notifications, potential privacy issues
// in case this leaks to unintended recipients. Yes, it's in the public
// profile but that doesn't mean we have to broadcast it to everybody.
}
if ($locality != $orig[0]['locality'] || $region != $orig[0]['region']
|| $country_name != $orig[0]['country-name']) {
- $changes[] = t('Location');
+ $changes[] = L10n::t('Location');
$comma1 = ((($locality) && ($region || $country_name)) ? ', ' : ' ');
$comma2 = (($region && $country_name) ? ', ' : '');
$value = $locality . $comma1 . $region . $comma2 . $country_name;
);
if ($r) {
- info(t('Profile updated.') . EOL);
+ info(L10n::t('Profile updated.') . EOL);
}
foreach ($changed as $ch) {
if (strlen($changes)) {
if ($z == ($t - 1)) {
- $changes .= t(' and ');
+ $changes .= L10n::t(' and ');
} else {
$changes .= ', ';
}
$changes .= $ch;
}
- $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . t('public profile') . '[/url]';
+ $prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . L10n::t('public profile') . '[/url]';
if ($t == 1 && strlen($value)) {
- $message = sprintf( t('%1$s changed %2$s to “%3$s”'), $A, $changes, $value);
- $message .= "\n\n" . sprintf( t(' - Visit %1$s\'s %2$s'), $A, $prof);
+ $message = L10n::t('%1$s changed %2$s to “%3$s”', $A, $changes, $value);
+ $message .= "\n\n" . L10n::t(' - Visit %1$s\'s %2$s', $A, $prof);
} else {
- $message = sprintf( t('%1$s has an updated %2$s, changing %3$s.'), $A, $prof, $changes);
+ $message = L10n::t('%1$s has an updated %2$s, changing %3$s.', $A, $prof, $changes);
}
function profiles_content(App $a) {
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
intval(local_user())
);
if (! DBM::is_result($r)) {
- notice( t('Profile not found.') . EOL);
+ notice(L10n::t('Profile not found.') . EOL);
return;
}
$hide_friends = replace_macros($opt_tpl,[
'$yesno' => [
'hide-friends', //Name
- t('Hide contacts and friends:'), //Label
+ L10n::t('Hide contacts and friends:'), //Label
!!$r[0]['hide-friends'], //Value
'', //Help string
- [t('No'), t('Yes')] //Off - On strings
+ [L10n::t('No'), L10n::t('Yes')] //Off - On strings
],
- '$desc' => t('Hide your contact/friend list from viewers of this profile?'),
- '$yes_str' => t('Yes'),
- '$no_str' => t('No'),
+ '$desc' => L10n::t('Hide your contact/friend list from viewers of this profile?'),
+ '$yes_str' => L10n::t('Yes'),
+ '$no_str' => L10n::t('No'),
'$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
]);
'$details' => [
'detailled_profile', //Name
- t('Show more profile fields:'), //Label
+ L10n::t('Show more profile fields:'), //Label
$detailled_profile, //Value
'', //Help string
- [t('No'), t('Yes')] //Off - On strings
+ [L10n::t('No'), L10n::t('Yes')] //Off - On strings
],
'$multi_profiles' => Feature::isEnabled(local_user(), 'multi_profiles'),
'$profile_clone_link' => ((Feature::isEnabled(local_user(), 'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ""),
'$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
- '$profile_action' => t('Profile Actions'),
- '$banner' => t('Edit Profile Details'),
- '$submit' => t('Submit'),
- '$profpic' => t('Change Profile Photo'),
- '$viewprof' => t('View this profile'),
- '$editvis' => t('Edit visibility'),
- '$cr_prof' => t('Create a new profile using these settings'),
- '$cl_prof' => t('Clone this profile'),
- '$del_prof' => t('Delete this profile'),
-
- '$lbl_basic_section' => t('Basic information'),
- '$lbl_picture_section' => t('Profile picture'),
- '$lbl_location_section' => t('Location'),
- '$lbl_preferences_section' => t('Preferences'),
- '$lbl_status_section' => t('Status information'),
- '$lbl_about_section' => t('Additional information'),
- '$lbl_interests_section' => t('Interests'),
- '$lbl_personal_section' => t('Personal'),
- '$lbl_relation_section' => t('Relation'),
- '$lbl_miscellaneous_section' => t('Miscellaneous'),
-
- '$lbl_profile_photo' => t('Upload Profile Photo'),
- '$lbl_gender' => t('Your Gender:'),
- '$lbl_marital' => t('<span class="heart">♥</span> Marital Status:'),
- '$lbl_sexual' => t('Sexual Preference:'),
- '$lbl_ex2' => t('Example: fishing photography software'),
+ '$profile_action' => L10n::t('Profile Actions'),
+ '$banner' => L10n::t('Edit Profile Details'),
+ '$submit' => L10n::t('Submit'),
+ '$profpic' => L10n::t('Change Profile Photo'),
+ '$viewprof' => L10n::t('View this profile'),
+ '$editvis' => L10n::t('Edit visibility'),
+ '$cr_prof' => L10n::t('Create a new profile using these settings'),
+ '$cl_prof' => L10n::t('Clone this profile'),
+ '$del_prof' => L10n::t('Delete this profile'),
+
+ '$lbl_basic_section' => L10n::t('Basic information'),
+ '$lbl_picture_section' => L10n::t('Profile picture'),
+ '$lbl_location_section' => L10n::t('Location'),
+ '$lbl_preferences_section' => L10n::t('Preferences'),
+ '$lbl_status_section' => L10n::t('Status information'),
+ '$lbl_about_section' => L10n::t('Additional information'),
+ '$lbl_interests_section' => L10n::t('Interests'),
+ '$lbl_personal_section' => L10n::t('Personal'),
+ '$lbl_relation_section' => L10n::t('Relation'),
+ '$lbl_miscellaneous_section' => L10n::t('Miscellaneous'),
+
+ '$lbl_profile_photo' => L10n::t('Upload Profile Photo'),
+ '$lbl_gender' => L10n::t('Your Gender:'),
+ '$lbl_marital' => L10n::t('<span class="heart">♥</span> Marital Status:'),
+ '$lbl_sexual' => L10n::t('Sexual Preference:'),
+ '$lbl_ex2' => L10n::t('Example: fishing photography software'),
'$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
'$baseurl' => System::baseUrl(true),
'$profile_id' => $r[0]['id'],
- '$profile_name' => ['profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'],
+ '$profile_name' => ['profile_name', L10n::t('Profile Name:'), $r[0]['profile-name'], L10n::t('Required'), '*'],
'$is_default' => $is_default,
- '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
- '$name' => ['name', t('Your Full Name:'), $r[0]['name']],
- '$pdesc' => ['pdesc', t('Title/Description:'), $r[0]['pdesc']],
+ '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . L10n::t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
+ '$name' => ['name', L10n::t('Your Full Name:'), $r[0]['name']],
+ '$pdesc' => ['pdesc', L10n::t('Title/Description:'), $r[0]['pdesc']],
'$dob' => dob($r[0]['dob']),
'$hide_friends' => $hide_friends,
- '$address' => ['address', t('Street Address:'), $r[0]['address']],
- '$locality' => ['locality', t('Locality/City:'), $r[0]['locality']],
- '$region' => ['region', t('Region/State:'), $r[0]['region']],
- '$postal_code' => ['postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']],
- '$country_name' => ['country_name', t('Country:'), $r[0]['country-name']],
- '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
+ '$address' => ['address', L10n::t('Street Address:'), $r[0]['address']],
+ '$locality' => ['locality', L10n::t('Locality/City:'), $r[0]['locality']],
+ '$region' => ['region', L10n::t('Region/State:'), $r[0]['region']],
+ '$postal_code' => ['postal_code', L10n::t('Postal/Zip Code:'), $r[0]['postal-code']],
+ '$country_name' => ['country_name', L10n::t('Country:'), $r[0]['country-name']],
+ '$age' => ((intval($r[0]['dob'])) ? '(' . L10n::t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
'$gender' => ContactSelector::gender($r[0]['gender']),
'$marital' => ContactSelector::maritalStatus($r[0]['marital']),
- '$with' => ['with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')],
- '$howlong' => ['howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))],
+ '$with' => ['with', L10n::t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), L10n::t('Examples: cathy123, Cathy Williams, cathy@example.com')],
+ '$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))],
'$sexual' => ContactSelector::sexualPreference($r[0]['sexual']),
- '$about' => ['about', t('Tell us about yourself...'), $r[0]['about']],
- '$xmpp' => ['xmpp', t('XMPP (Jabber) address:'), $r[0]['xmpp'], t("The XMPP address will be propagated to your contacts so that they can follow you.")],
- '$homepage' => ['homepage', t('Homepage URL:'), $r[0]['homepage']],
- '$hometown' => ['hometown', t('Hometown:'), $r[0]['hometown']],
- '$politic' => ['politic', t('Political Views:'), $r[0]['politic']],
- '$religion' => ['religion', t('Religious Views:'), $r[0]['religion']],
- '$pub_keywords' => ['pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")],
- '$prv_keywords' => ['prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")],
- '$likes' => ['likes', t('Likes:'), $r[0]['likes']],
- '$dislikes' => ['dislikes', t('Dislikes:'), $r[0]['dislikes']],
- '$music' => ['music', t('Musical interests'), $r[0]['music']],
- '$book' => ['book', t('Books, literature'), $r[0]['book']],
- '$tv' => ['tv', t('Television'), $r[0]['tv']],
- '$film' => ['film', t('Film/dance/culture/entertainment'), $r[0]['film']],
- '$interest' => ['interest', t('Hobbies/Interests'), $r[0]['interest']],
- '$romance' => ['romance', t('Love/romance'), $r[0]['romance']],
- '$work' => ['work', t('Work/employment'), $r[0]['work']],
- '$education' => ['education', t('School/education'), $r[0]['education']],
- '$contact' => ['contact', t('Contact information and Social Networks'), $r[0]['contact']],
+ '$about' => ['about', L10n::t('Tell us about yourself...'), $r[0]['about']],
+ '$xmpp' => ['xmpp', L10n::t('XMPP (Jabber) address:'), $r[0]['xmpp'], L10n::t("The XMPP address will be propagated to your contacts so that they can follow you.")],
+ '$homepage' => ['homepage', L10n::t('Homepage URL:'), $r[0]['homepage']],
+ '$hometown' => ['hometown', L10n::t('Hometown:'), $r[0]['hometown']],
+ '$politic' => ['politic', L10n::t('Political Views:'), $r[0]['politic']],
+ '$religion' => ['religion', L10n::t('Religious Views:'), $r[0]['religion']],
+ '$pub_keywords' => ['pub_keywords', L10n::t('Public Keywords:'), $r[0]['pub_keywords'], L10n::t("\x28Used for suggesting potential friends, can be seen by others\x29")],
+ '$prv_keywords' => ['prv_keywords', L10n::t('Private Keywords:'), $r[0]['prv_keywords'], L10n::t("\x28Used for searching profiles, never shown to others\x29")],
+ '$likes' => ['likes', L10n::t('Likes:'), $r[0]['likes']],
+ '$dislikes' => ['dislikes', L10n::t('Dislikes:'), $r[0]['dislikes']],
+ '$music' => ['music', L10n::t('Musical interests'), $r[0]['music']],
+ '$book' => ['book', L10n::t('Books, literature'), $r[0]['book']],
+ '$tv' => ['tv', L10n::t('Television'), $r[0]['tv']],
+ '$film' => ['film', L10n::t('Film/dance/culture/entertainment'), $r[0]['film']],
+ '$interest' => ['interest', L10n::t('Hobbies/Interests'), $r[0]['interest']],
+ '$romance' => ['romance', L10n::t('Love/romance'), $r[0]['romance']],
+ '$work' => ['work', L10n::t('Work/employment'), $r[0]['work']],
+ '$education' => ['education', L10n::t('School/education'), $r[0]['education']],
+ '$contact' => ['contact', L10n::t('Contact information and Social Networks'), $r[0]['contact']],
]);
$arr = ['profile' => $r[0], 'entry' => $o];
$profiles .= replace_macros($tpl, [
'$photo' => $a->remove_baseurl($rr['thumb']),
'$id' => $rr['id'],
- '$alt' => t('Profile Image'),
+ '$alt' => L10n::t('Profile Image'),
'$profile_name' => $rr['profile-name'],
- '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
- : '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')
+ '$visible' => (($rr['is-default']) ? '<strong>' . L10n::t('visible to everybody') . '</strong>'
+ : '<a href="'.'profperm/'.$rr['id'].'" />' . L10n::t('Edit visibility') . '</a>')
]);
}
$tpl_header = get_markup_template('profile_listing_header.tpl');
$o .= replace_macros($tpl_header,[
- '$header' => t('Edit/Manage Profiles'),
- '$chg_photo' => t('Change profile photo'),
- '$cr_new' => t('Create New Profile'),
+ '$header' => L10n::t('Edit/Manage Profiles'),
+ '$chg_photo' => L10n::t('Change profile photo'),
+ '$cr_new' => L10n::t('Create New Profile'),
'$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"),
'$profiles' => $profiles
]);
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
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;
}
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];
$ingroup[] = $member['id'];
}
- $o .= '<h2>' . t('Profile Visibility Editor') . '</h2>';
+ $o .= '<h2>' . L10n::t('Profile Visibility Editor') . '</h2>';
- $o .= '<h3>' . t('Profile') . ' \'' . $profile['profile-name'] . '\'</h3>';
+ $o .= '<h3>' . L10n::t('Profile') . ' \'' . $profile['profile-name'] . '\'</h3>';
- $o .= '<div id="prof-edit-desc">' . t('Click on a contact to add or remove.') . '</div>';
+ $o .= '<div id="prof-edit-desc">' . L10n::t('Click on a contact to add or remove.') . '</div>';
}
$o = '';
$o .= '<div id="prof-members-title">';
- $o .= '<h3>' . t('Visible To') . '</h3>';
+ $o .= '<h3>' . L10n::t('Visible To') . '</h3>';
$o .= '</div>';
$o .= '<div id="prof-members">';
$o .= '<hr id="prof-separator" />';
$o .= '<div id="prof-all-contcts-title">';
- $o .= '<h3>' . t("All Contacts \x28with secure profile access\x29") . '</h3>';
+ $o .= '<h3>' . L10n::t("All Contacts \x28with secure profile access\x29") . '</h3>';
$o .= '</div>';
$o .= '<div id="prof-all-contacts">';
<?php
-
+/**
+ * @file mod/register.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\Core\Worker;
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;
$arr['blocked'] = $blocked;
$arr['verified'] = $verified;
- $arr['language'] = get_browser_language();
+ $arr['language'] = L10n::getBrowserLanguage();
try {
$result = User::create($arr);
$user['email'], $a->config['sitename'], System::baseUrl(), $user['username'], $result['password']);
if ($res) {
- info(t('Registration successful. Please check your email for further instructions.') . EOL);
+ info(L10n::t('Registration successful. Please check your email for further instructions.') . EOL);
goaway(System::baseUrl());
} else {
notice(
- t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
+ L10n::t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
$user['email'],
$result['password'])
. EOL
);
}
} else {
- info(t('Registration successful.') . EOL);
+ info(L10n::t('Registration successful.') . EOL);
goaway(System::baseUrl());
}
} 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());
}
User::sendRegisterPendingEmail(
$user['email'], $a->config['sitename'], $user['username']);
- info(t('Your registration is pending approval by the site owner.') . EOL);
+ info(L10n::t('Your registration is pending approval by the site owner.') . EOL);
goaway(System::baseUrl());
}
$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;
}
}
$oidlabel = '';
} else {
$oidhtml = '<label for="register-openid" id="label-register-openid" >$oidlabel</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="$openid" >';
- $fillwith = t("You may \x28optionally\x29 fill in this form via OpenID by supplying your OpenID and clicking 'Register'.");
- $fillext = t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
- $oidlabel = t("Your OpenID \x28optional\x29: ");
+ $fillwith = L10n::t("You may \x28optionally\x29 fill in this form via OpenID by supplying your OpenID and clicking 'Register'.");
+ $fillext = L10n::t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
+ $oidlabel = L10n::t("Your OpenID \x28optional\x29: ");
}
// I set this and got even more fake names than before...
- $realpeople = ''; // t('Members of this network prefer to communicate with real people who use their real names.');
+ $realpeople = ''; // L10n::t('Members of this network prefer to communicate with real people who use their real names.');
if (Config::get('system', 'publish_all')) {
$profile_publish = '<input type="hidden" name="profile_publish_reg" value="1" />';
$publish_tpl = get_markup_template("profile_publish.tpl");
$profile_publish = replace_macros($publish_tpl, [
'$instance' => 'reg',
- '$pubdesc' => t('Include your profile in member directory?'),
+ '$pubdesc' => L10n::t('Include your profile in member directory?'),
'$yes_selected' => ' checked="checked" ',
'$no_selected' => '',
- '$str_yes' => t('Yes'),
- '$str_no' => t('No'),
+ '$str_yes' => L10n::t('Yes'),
+ '$str_no' => L10n::t('No'),
]);
}
'$oidhtml' => $oidhtml,
'$invitations' => Config::get('system', 'invitation_only'),
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
- '$permonlybox' => ['permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')],
- '$invite_desc' => t('Membership on this site is by invitation only.'),
- '$invite_label' => t('Your invitation ID: '),
+ '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node')],
+ '$invite_desc' => L10n::t('Membership on this site is by invitation only.'),
+ '$invite_label' => L10n::t('Your invitation ID: '),
'$invite_id' => $invite_id,
'$realpeople' => $realpeople,
- '$regtitle' => t('Registration'),
+ '$regtitle' => L10n::t('Registration'),
'$registertext' => x($a->config, 'register_text') ? bbcode($a->config['register_text']) : "",
'$fillwith' => $fillwith,
'$fillext' => $fillext,
'$oidlabel' => $oidlabel,
'$openid' => $openid_url,
- '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
- '$addrlabel' => t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
+ '$namelabel' => L10n::t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
+ '$addrlabel' => L10n::t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
'$passwords' => $passwords,
- '$password1' => ['password1', t('New Password:'), '', t('Leave empty for an auto generated password.')],
- '$password2' => ['confirm', t('Confirm:'), '', ''],
- '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@%s</strong>\'.', $a->get_hostname()),
- '$nicklabel' => t('Choose a nickname: '),
+ '$password1' => ['password1', L10n::t('New Password:'), '', L10n::t('Leave empty for an auto generated password.')],
+ '$password2' => ['confirm', L10n::t('Confirm:'), '', ''],
+ '$nickdesc' => L10n::t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@%s</strong>\'.', $a->get_hostname()),
+ '$nicklabel' => L10n::t('Choose a nickname: '),
'$photo' => $photo,
'$publish' => $profile_publish,
- '$regbutt' => t('Register'),
+ '$regbutt' => L10n::t('Register'),
'$username' => $username,
'$email' => $email,
'$nickname' => $nickname,
'$license' => $license,
'$sitename' => $a->get_hostname(),
- '$importh' => t('Import'),
- '$importt' => t('Import your profile to this friendica instance'),
+ '$importh' => L10n::t('Import'),
+ '$importt' => L10n::t('Import your profile to this friendica instance'),
'$form_security_token' => get_form_security_token("register")
]);
return $o;
<?php
-
+/**
+ * @file mod/regmod.php
+ */
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
}
}
- push_lang($register[0]['language']);
+ L10n::pushLang($register[0]['language']);
User::sendRegisterOpenEmail(
$user[0]['email'],
$user[0]['username'],
$register[0]['password']);
- pop_lang();
+ 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(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;
}
if ((!is_site_admin()) || (x($_SESSION, 'submanage') && intval($_SESSION['submanage']))) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return '';
}
<?php
-
+/**
+ * @file mod/removeme.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\User;
$o .= replace_macros($tpl, [
'$basedir' => System::baseUrl(),
'$hash' => $hash,
- '$title' => t('Remove My Account'),
- '$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'),
- '$passwd' => t('Please enter your password for verification:'),
- '$submit' => t('Remove My Account')
+ '$title' => L10n::t('Remove My Account'),
+ '$desc' => L10n::t('This will completely remove your account. Once this has been done it is not recoverable.'),
+ '$passwd' => L10n::t('Please enter your password for verification:'),
+ '$submit' => L10n::t('Remove My Account')
]);
return $o;
* @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
}
- $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"];
intval(CONTACT_IS_SHARING), $counter++);
if (!$r) {
- $o .= t("Done");
+ $o .= L10n::t("Done");
return $o;
}
$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);
+ $result = Contact::createFromProbe($uid, $r[0]["url"], true);
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';
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";
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
- 'delete' => t('Remove term'),
+ 'delete' => L10n::t('Remove term'),
'selected' => ($search==$rr['term']),
];
}
$tpl = get_markup_template("saved_searches_aside.tpl");
$o .= replace_macros($tpl, [
- '$title' => t('Saved Searches'),
+ '$title' => L10n::t('Saved Searches'),
'$add' => '',
'$searchbox' => '',
'$saved' => $saved,
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;
}
if (Config::get('system','local_search') && !local_user() && !remote_user()) {
http_status_exit(403,
- ["title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a search.")]);
+ ["title" => L10n::t("Public access denied."),
+ "description" => L10n::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;
}
$resultdata = json_decode($result);
if (($resultdata->time > (time() - $crawl_permit_period)) && ($resultdata->accesses > $free_crawls)) {
http_status_exit(429,
- ["title" => t("Too Many Requests"),
- "description" => t("Only one search per minute is permitted for not logged in users.")]);
+ ["title" => L10n::t("Too Many Requests"),
+ "description" => L10n::t("Only one search per minute is permitted for not logged in users.")]);
killme();
}
Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => $resultdata->accesses + 1]), CACHE_HOUR);
// contruct a wrapper for the search header
$o .= replace_macros(get_markup_template("content_wrapper.tpl"),[
'name' => "search-header",
- '$title' => t("Search"),
+ '$title' => L10n::t("Search"),
'$title_size' => 3,
'$content' => search($search,'search-box','search',((local_user()) ? true : false), false)
]);
}
if (! DBM::is_result($r)) {
- info( t('No results.') . EOL);
+ info(L10n::t('No results.') . EOL);
return $o;
}
- if ($tag)
- $title = sprintf( t('Items tagged with: %s'), $search);
- else
- $title = sprintf( t('Results for: %s'), $search);
+ if ($tag) {
+ $title = L10n::t('Items tagged with: %s', $search);
+ } else {
+ $title = L10n::t('Results for: %s', $search);
+ }
$o .= replace_macros(get_markup_template("section_title.tpl"),[
'$title' => $title
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;
function settings_init(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
// These lines provide the javascript needed by the acl selector
$tpl = get_markup_template('settings/head.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl,[
- '$ispublic' => t('everybody')
+ $a->page['htmlhead'] .= replace_macros($tpl, [
+ '$ispublic' => L10n::t('everybody')
]);
$tabs = [
[
- 'label' => t('Account'),
+ 'label' => L10n::t('Account'),
'url' => 'settings',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''),
'accesskey' => 'o',
if (Feature::get()) {
$tabs[] = [
- 'label' => t('Additional features'),
+ 'label' => L10n::t('Additional features'),
'url' => 'settings/features',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
'accesskey' => 't',
}
$tabs[] = [
- 'label' => t('Display'),
+ 'label' => L10n::t('Display'),
'url' => 'settings/display',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
'accesskey' => 'i',
];
$tabs[] = [
- 'label' => t('Social Networks'),
+ 'label' => L10n::t('Social Networks'),
'url' => 'settings/connectors',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
'accesskey' => 'w',
];
$tabs[] = [
- 'label' => t('Addons'),
+ 'label' => L10n::t('Addons'),
'url' => 'settings/addon',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
'accesskey' => 'l',
];
$tabs[] = [
- 'label' => t('Delegations'),
+ 'label' => L10n::t('Delegations'),
'url' => 'delegate',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''),
'accesskey' => 'd',
];
$tabs[] = [
- 'label' => t('Connected apps'),
+ 'label' => L10n::t('Connected apps'),
'url' => 'settings/oauth',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
'accesskey' => 'b',
];
$tabs[] = [
- 'label' => t('Export personal data'),
+ 'label' => L10n::t('Export personal data'),
'url' => 'uexport',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''),
'accesskey' => 'e',
];
$tabs[] = [
- 'label' => t('Remove account'),
+ 'label' => L10n::t('Remove account'),
'url' => 'removeme',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''),
'accesskey' => 'r',
$tabtpl = get_markup_template("generic_links_widget.tpl");
$a->page['aside'] = replace_macros($tabtpl, [
- '$title' => t('Settings'),
+ '$title' => L10n::t('Settings'),
'$class' => 'settings-widget',
'$items' => $tabs,
]);
}
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;
}
$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")) {
+ if ($_POST['submit'] == L10n::t("Update")) {
q("UPDATE clients SET
client_id='%s',
pw='%s',
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);
}
}
}
if (!$failed) {
- info(t('Email settings updated.') . EOL);
+ info(L10n::t('Email settings updated.') . EOL);
}
}
}
PConfig::set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
}
}
- info(t('Features updated') . EOL);
+ info(L10n::t('Features updated') . EOL);
return;
}
if (x($_POST,'resend_relocate')) {
Worker::add(PRIORITY_HIGH, 'Notifier', 'relocate', local_user());
- info(t("Relocate message has been send to your contacts"));
+ info(L10n::t("Relocate message has been send to your contacts"));
goaway('settings');
}
$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;
}
if (!$err) {
$result = User::updatePassword(local_user(), $newpass);
if (DBM::is_result($result)) {
- info(t('Password changed.') . EOL);
+ info(L10n::t('Password changed.') . EOL);
} else {
- notice(t('Password update failed. Please try again.') . EOL);
+ notice(L10n::t('Password update failed. Please try again.') . EOL);
}
}
}
if ($username != $a->user['username']) {
$name_change = true;
if (strlen($username) > 40) {
- $err .= t(' Please use a shorter name.');
+ $err .= L10n::t(' Please use a shorter name.');
}
if (strlen($username) < 3) {
- $err .= t(' Name too short.');
+ $err .= L10n::t(' Name too short.');
}
}
$email_changed = true;
// check for the correct password
if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
- $err .= t('Wrong Password') . EOL;
+ $err .= L10n::t('Wrong Password') . EOL;
$email = $a->user['email'];
}
// check the email is valid
if (!valid_email($email)) {
- $err .= t('Invalid email.');
+ $err .= L10n::t('Invalid email.');
}
// ensure new email is not the admin mail
//if ((x($a->config, 'admin_email')) && (strcasecmp($email, $a->config['admin_email']) == 0)) {
if (x($a->config, 'admin_email')) {
$adminlist = explode(",", str_replace(" ", "", strtolower($a->config['admin_email'])));
if (in_array(strtolower($email), $adminlist)) {
- $err .= t('Cannot change to that email.');
+ $err .= L10n::t('Cannot change to that email.');
$email = $a->user['email'];
}
}
$hidewall = 1;
if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) {
if ($def_gid) {
- info(t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
+ info(L10n::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);
}
}
}
intval(local_user())
);
if (DBM::is_result($r)) {
- info(t('Settings updated.') . EOL);
+ info(L10n::t('Settings updated.') . EOL);
}
// clear session language
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;
}
$tpl = get_markup_template('settings/oauth_edit.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$title' => t('Add application'),
- '$submit' => t('Save Settings'),
- '$cancel' => t('Cancel'),
- '$name' => ['name', t('Name'), '', ''],
- '$key' => ['key', t('Consumer Key'), '', ''],
- '$secret' => ['secret', t('Consumer Secret'), '', ''],
- '$redirect' => ['redirect', t('Redirect'), '', ''],
- '$icon' => ['icon', t('Icon url'), '', ''],
+ '$title' => L10n::t('Add application'),
+ '$submit' => L10n::t('Save Settings'),
+ '$cancel' => L10n::t('Cancel'),
+ '$name' => ['name', L10n::t('Name'), '', ''],
+ '$key' => ['key', L10n::t('Consumer Key'), '', ''],
+ '$secret' => ['secret', L10n::t('Consumer Secret'), '', ''],
+ '$redirect' => ['redirect', L10n::t('Redirect'), '', ''],
+ '$icon' => ['icon', L10n::t('Icon url'), '', ''],
]);
return $o;
}
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];
$tpl = get_markup_template('settings/oauth_edit.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$title' => t('Add application'),
- '$submit' => t('Update'),
- '$cancel' => t('Cancel'),
- '$name' => ['name', t('Name'), $app['name'] , ''],
- '$key' => ['key', t('Consumer Key'), $app['client_id'], ''],
- '$secret' => ['secret', t('Consumer Secret'), $app['pw'], ''],
- '$redirect' => ['redirect', t('Redirect'), $app['redirect_uri'], ''],
- '$icon' => ['icon', t('Icon url'), $app['icon'], ''],
+ '$title' => L10n::t('Add application'),
+ '$submit' => L10n::t('Update'),
+ '$cancel' => L10n::t('Cancel'),
+ '$name' => ['name', L10n::t('Name'), $app['name'] , ''],
+ '$key' => ['key', L10n::t('Consumer Key'), $app['client_id'], ''],
+ '$secret' => ['secret', L10n::t('Consumer Secret'), $app['pw'], ''],
+ '$redirect' => ['redirect', L10n::t('Redirect'), $app['redirect_uri'], ''],
+ '$icon' => ['icon', L10n::t('Icon url'), $app['icon'], ''],
]);
return $o;
}
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
'$baseurl' => System::baseUrl(true),
- '$title' => t('Connected Apps'),
- '$add' => t('Add application'),
- '$edit' => t('Edit'),
- '$delete' => t('Delete'),
- '$consumerkey' => t('Client key starts with'),
- '$noname' => t('No name'),
- '$remove' => t('Remove authorization'),
+ '$title' => L10n::t('Connected Apps'),
+ '$add' => L10n::t('Add application'),
+ '$edit' => L10n::t('Edit'),
+ '$delete' => L10n::t('Delete'),
+ '$consumerkey' => L10n::t('Client key starts with'),
+ '$noname' => L10n::t('No name'),
+ '$remove' => L10n::t('Remove authorization'),
'$apps' => $r,
]);
return $o;
$r = q("SELECT * FROM `hook` WHERE `hook` = 'addon_settings' ");
if (!DBM::is_result($r)) {
- $settings_addons = t('No Addon settings configured');
+ $settings_addons = L10n::t('No Addon settings configured');
}
Addon::callHooks('addon_settings', $settings_addons);
$tpl = get_markup_template('settings/addons.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_addon"),
- '$title' => t('Addon Settings'),
+ '$title' => L10n::t('Addon Settings'),
'$settings_addons' => $settings_addons
]);
return $o;
$arr[$fname] = [];
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata,1) as $f) {
- $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[t('Off'), t('On')]];
+ $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[L10n::t('Off'), L10n::t('On')]];
}
}
$tpl = get_markup_template('settings/features.tpl');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_features"),
- '$title' => t('Additional Features'),
+ '$title' => L10n::t('Additional Features'),
'$features' => $arr,
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
]);
return $o;
}
Addon::callHooks('connector_settings', $settings_connectors);
if (is_site_admin()) {
- $diasp_enabled = t('Built-in support for %s connectivity is %s', t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? t('enabled') : t('disabled')));
- $ostat_enabled = t('Built-in support for %s connectivity is %s', t('GNU Social (OStatus)'), ((Config::get('system', 'ostatus_disabled')) ? t('disabled') : t('enabled')));
+ $diasp_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? L10n::t('enabled') : L10n::t('disabled')));
+ $ostat_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('GNU Social (OStatus)'), ((Config::get('system', 'ostatus_disabled')) ? L10n::t('disabled') : L10n::t('enabled')));
} else {
$diasp_enabled = "";
$ostat_enabled = "";
$tpl = get_markup_template('settings/connectors.tpl');
- $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
+ $mail_disabled_message = (($mail_disabled) ? L10n::t('Email access is disabled on this site.') : '');
$o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_connectors"),
- '$title' => t('Social Networks'),
+ '$title' => L10n::t('Social Networks'),
'$diasp_enabled' => $diasp_enabled,
'$ostat_enabled' => $ostat_enabled,
- '$general_settings' => t('General Social Media Settings'),
- '$no_intelligent_shortening' => ['no_intelligent_shortening', t('Disable intelligent shortening'), $no_intelligent_shortening, t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
- '$ostatus_autofriend' => ['snautofollow', t('Automatically follow any GNU Social (OStatus) followers/mentioners'), $ostatus_autofriend, t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
- '$default_group' => Group::displayGroupSelection(local_user(), $default_group, t("Default group for OStatus contacts")),
- '$legacy_contact' => ['legacy_contact', t('Your legacy GNU Social account'), $legacy_contact, t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.')],
+ '$general_settings' => L10n::t('General Social Media Settings'),
+ '$no_intelligent_shortening' => ['no_intelligent_shortening', L10n::t('Disable intelligent shortening'), $no_intelligent_shortening, L10n::t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
+ '$ostatus_autofriend' => ['snautofollow', L10n::t('Automatically follow any GNU Social (OStatus) followers/mentioners'), $ostatus_autofriend, L10n::t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
+ '$default_group' => Group::displayGroupSelection(local_user(), $default_group, L10n::t("Default group for OStatus contacts")),
+ '$legacy_contact' => ['legacy_contact', L10n::t('Your legacy GNU Social account'), $legacy_contact, L10n::t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.')],
'$repair_ostatus_url' => System::baseUrl() . '/repair_ostatus',
- '$repair_ostatus_text' => t('Repair OStatus subscriptions'),
+ '$repair_ostatus_text' => L10n::t('Repair OStatus subscriptions'),
'$settings_connectors' => $settings_connectors,
- '$h_imap' => t('Email/Mailbox Setup'),
- '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
- '$imap_lastcheck' => ['imap_lastcheck', t('Last successful email check:'), $mail_chk, ''],
+ '$h_imap' => L10n::t('Email/Mailbox Setup'),
+ '$imap_desc' => L10n::t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
+ '$imap_lastcheck' => ['imap_lastcheck', L10n::t('Last successful email check:'), $mail_chk, ''],
'$mail_disabled' => $mail_disabled_message,
- '$mail_server' => ['mail_server', t('IMAP server name:'), $mail_server, ''],
- '$mail_port' => ['mail_port', t('IMAP port:'), $mail_port, ''],
- '$mail_ssl' => ['mail_ssl', t('Security:'), strtoupper($mail_ssl), '', ['notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL']],
- '$mail_user' => ['mail_user', t('Email login name:'), $mail_user, ''],
- '$mail_pass' => ['mail_pass', t('Email password:'), '', ''],
- '$mail_replyto' => ['mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'],
- '$mail_pubmail' => ['mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''],
- '$mail_action' => ['mail_action', t('Action after import:'), $mail_action, '', [0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder')]],
- '$mail_movetofolder' => ['mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''],
- '$submit' => t('Save Settings'),
+ '$mail_server' => ['mail_server', L10n::t('IMAP server name:'), $mail_server, ''],
+ '$mail_port' => ['mail_port', L10n::t('IMAP port:'), $mail_port, ''],
+ '$mail_ssl' => ['mail_ssl', L10n::t('Security:'), strtoupper($mail_ssl), '', ['notls'=>L10n::t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL']],
+ '$mail_user' => ['mail_user', L10n::t('Email login name:'), $mail_user, ''],
+ '$mail_pass' => ['mail_pass', L10n::t('Email password:'), '', ''],
+ '$mail_replyto' => ['mail_replyto', L10n::t('Reply-to address:'), $mail_replyto, 'Optional'],
+ '$mail_pubmail' => ['mail_pubmail', L10n::t('Send public posts to all email contacts:'), $mail_pubmail, ''],
+ '$mail_action' => ['mail_action', L10n::t('Action after import:'), $mail_action, '', [0=>L10n::t('None'), /*1=>L10n::t('Delete'),*/ 2=>L10n::t('Mark as seen'), 3=>L10n::t('Move to folder')]],
+ '$mail_movetofolder' => ['mail_movetofolder', L10n::t('Move to folder:'), $mail_movetofolder, ''],
+ '$submit' => L10n::t('Save Settings'),
]);
Addon::callHooks('display_settings', $o);
$themes = [];
- $mobile_themes = ["---" => t('No special theme for mobile devices')];
+ $mobile_themes = ["---" => L10n::t('No special theme for mobile devices')];
if ($allowed_themes) {
foreach ($allowed_themes as $theme) {
$is_experimental = file_exists('view/theme/' . $theme . '/experimental');
if (!$is_experimental || ($is_experimental && (Config::get('experimentals', 'exp_themes')==1 || is_null(Config::get('experimentals', 'exp_themes'))))) {
$theme_name = ucfirst($theme);
if ($is_unsupported) {
- $theme_name = t("%s - (Unsupported)", $theme_name);
+ $theme_name = L10n::t("%s - (Unsupported)", $theme_name);
} elseif ($is_experimental) {
- $theme_name = t("%s - (Experimental)", $theme_name);
+ $theme_name = L10n::t("%s - (Experimental)", $theme_name);
}
if ($is_mobile) {
$mobile_themes[$theme] = $theme_name;
$nosmile = PConfig::get(local_user(), 'system', 'no_smilies', 0);
$first_day_of_week = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
- $weekdays = [0 => t("Sunday"), 1 => t("Monday")];
+ $weekdays = [0 => L10n::t("Sunday"), 1 => L10n::t("Monday")];
$noinfo = PConfig::get(local_user(), 'system', 'ignore_info', 0);
$infinite_scroll = PConfig::get(local_user(), 'system', 'infinite_scroll', 0);
$tpl = get_markup_template('settings/display.tpl');
$o = replace_macros($tpl, [
- '$ptitle' => t('Display Settings'),
+ '$ptitle' => L10n::t('Display Settings'),
'$form_security_token' => get_form_security_token("settings_display"),
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
'$baseurl' => System::baseUrl(true),
'$uid' => local_user(),
- '$theme' => ['theme', t('Display Theme:'), $theme_selected, '', $themes, true],
- '$mobile_theme' => ['mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
- '$nowarn_insecure' => ['nowarn_insecure', t('Suppress warning of insecure networks'), $nowarn_insecure, t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
- '$ajaxint' => ['browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')],
- '$itemspage_network' => ['itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')],
- '$itemspage_mobile_network' => ['itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')],
- '$nosmile' => ['nosmile', t("Don't show emoticons"), $nosmile, ''],
- '$calendar_title' => t('Calendar'),
- '$first_day_of_week' => ['first_day_of_week', t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
- '$noinfo' => ['noinfo', t("Don't show notices"), $noinfo, ''],
- '$infinite_scroll' => ['infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''],
- '$no_auto_update' => ['no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
- '$bandwidth_saver' => ['bandwidth_saver', t('Bandwith Saver Mode'), $bandwidth_saver, t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
- '$smart_threading' => ['smart_threading', t('Smart Threading'), $smart_threading, t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
-
- '$d_tset' => t('General Theme Settings'),
- '$d_ctset' => t('Custom Theme Settings'),
- '$d_cset' => t('Content Settings'),
- 'stitle' => t('Theme settings'),
+ '$theme' => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes, true],
+ '$mobile_theme' => ['mobile_theme', L10n::t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
+ '$nowarn_insecure' => ['nowarn_insecure', L10n::t('Suppress warning of insecure networks'), $nowarn_insecure, L10n::t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
+ '$ajaxint' => ['browser_update', L10n::t("Update browser every xx seconds"), $browser_update, L10n::t('Minimum of 10 seconds. Enter -1 to disable it.')],
+ '$itemspage_network' => ['itemspage_network', L10n::t("Number of items to display per page:"), $itemspage_network, L10n::t('Maximum of 100 items')],
+ '$itemspage_mobile_network' => ['itemspage_mobile_network', L10n::t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, L10n::t('Maximum of 100 items')],
+ '$nosmile' => ['nosmile', L10n::t("Don't show emoticons"), $nosmile, ''],
+ '$calendar_title' => L10n::t('Calendar'),
+ '$first_day_of_week' => ['first_day_of_week', L10n::t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
+ '$noinfo' => ['noinfo', L10n::t("Don't show notices"), $noinfo, ''],
+ '$infinite_scroll' => ['infinite_scroll', L10n::t("Infinite scroll"), $infinite_scroll, ''],
+ '$no_auto_update' => ['no_auto_update', L10n::t("Automatic updates only at the top of the network page"), $no_auto_update, L10n::t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
+ '$bandwidth_saver' => ['bandwidth_saver', L10n::t('Bandwith Saver Mode'), $bandwidth_saver, L10n::t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
+ '$smart_threading' => ['smart_threading', L10n::t('Smart Threading'), $smart_threading, L10n::t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
+
+ '$d_tset' => L10n::t('General Theme Settings'),
+ '$d_ctset' => L10n::t('Custom Theme Settings'),
+ '$d_cset' => L10n::t('Content Settings'),
+ 'stitle' => L10n::t('Theme settings'),
'$theme_config' => $theme_config,
]);
$tpl = get_markup_template('settings/display_end.tpl');
$a->page['end'] .= replace_macros($tpl, [
- '$theme' => ['theme', t('Display Theme:'), $theme_selected, '', $themes]
+ '$theme' => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes]
]);
return $o;
$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;
}
$pageset_tpl = get_markup_template('settings/pagetypes.tpl');
$pagetype = replace_macros($pageset_tpl, [
- '$account_types' => t("Account Types"),
- '$user' => t("Personal Page Subtypes"),
- '$community' => t("Community Forum Subtypes"),
+ '$account_types' => L10n::t("Account Types"),
+ '$user' => L10n::t("Personal Page Subtypes"),
+ '$community' => L10n::t("Community Forum Subtypes"),
'$account_type' => $a->user['account-type'],
'$type_person' => ACCOUNT_TYPE_PERSON,
'$type_organisation' => ACCOUNT_TYPE_ORGANISATION,
'$type_news' => ACCOUNT_TYPE_NEWS,
'$type_community' => ACCOUNT_TYPE_COMMUNITY,
- '$account_person' => ['account-type', t('Personal Page'), ACCOUNT_TYPE_PERSON,
- t('Account for a personal profile.'),
+ '$account_person' => ['account-type', L10n::t('Personal Page'), ACCOUNT_TYPE_PERSON,
+ L10n::t('Account for a personal profile.'),
($a->user['account-type'] == ACCOUNT_TYPE_PERSON)],
- '$account_organisation' => ['account-type', t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
- t('Account for an organisation that automatically approves contact requests as "Followers".'),
+ '$account_organisation' => ['account-type', L10n::t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
+ L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
($a->user['account-type'] == ACCOUNT_TYPE_ORGANISATION)],
- '$account_news' => ['account-type', t('News Page'), ACCOUNT_TYPE_NEWS,
- t('Account for a news reflector that automatically approves contact requests as "Followers".'),
+ '$account_news' => ['account-type', L10n::t('News Page'), ACCOUNT_TYPE_NEWS,
+ L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
($a->user['account-type'] == ACCOUNT_TYPE_NEWS)],
- '$account_community' => ['account-type', t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
- t('Account for community discussions.'),
+ '$account_community' => ['account-type', L10n::t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
+ L10n::t('Account for community discussions.'),
($a->user['account-type'] == ACCOUNT_TYPE_COMMUNITY)],
- '$page_normal' => ['page-flags', t('Normal Account Page'), PAGE_NORMAL,
- t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
+ '$page_normal' => ['page-flags', L10n::t('Normal Account Page'), PAGE_NORMAL,
+ L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
($a->user['page-flags'] == PAGE_NORMAL)],
- '$page_soapbox' => ['page-flags', t('Soapbox Page'), PAGE_SOAPBOX,
- t('Account for a public profile that automatically approves contact requests as "Followers".'),
+ '$page_soapbox' => ['page-flags', L10n::t('Soapbox Page'), PAGE_SOAPBOX,
+ L10n::t('Account for a public profile that automatically approves contact requests as "Followers".'),
($a->user['page-flags'] == PAGE_SOAPBOX)],
- '$page_community' => ['page-flags', t('Public Forum'), PAGE_COMMUNITY,
- t('Automatically approves all contact requests.'),
+ '$page_community' => ['page-flags', L10n::t('Public Forum'), PAGE_COMMUNITY,
+ L10n::t('Automatically approves all contact requests.'),
($a->user['page-flags'] == PAGE_COMMUNITY)],
- '$page_freelove' => ['page-flags', t('Automatic Friend Page'), PAGE_FREELOVE,
- t('Account for a popular profile that automatically approves contact requests as "Friends".'),
+ '$page_freelove' => ['page-flags', L10n::t('Automatic Friend Page'), PAGE_FREELOVE,
+ L10n::t('Account for a popular profile that automatically approves contact requests as "Friends".'),
($a->user['page-flags'] == PAGE_FREELOVE)],
- '$page_prvgroup' => ['page-flags', t('Private Forum [Experimental]'), PAGE_PRVGROUP,
- t('Requires manual approval of contact requests.'),
+ '$page_prvgroup' => ['page-flags', L10n::t('Private Forum [Experimental]'), PAGE_PRVGROUP,
+ L10n::t('Requires manual approval of contact requests.'),
($a->user['page-flags'] == PAGE_PRVGROUP)],
if ($noid) {
$openid_field = false;
} else {
- $openid_field = ['openid_url', t('OpenID:'), $openid, t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url"];
+ $openid_field = ['openid_url', L10n::t('OpenID:'), $openid, L10n::t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url"];
}
$opt_tpl = get_markup_template("field_yesno.tpl");
$profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
} else {
$profile_in_dir = replace_macros($opt_tpl, [
- '$field' => ['profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], t("Your profile may be visible in public."), [t('No'), t('Yes')]]
+ '$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t("Your profile may be visible in public."), [L10n::t('No'), L10n::t('Yes')]]
]);
}
if (strlen(Config::get('system', 'directory'))) {
$profile_in_net_dir = replace_macros($opt_tpl, [
- '$field' => ['profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', [t('No'), t('Yes')]]
+ '$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', [L10n::t('No'), L10n::t('Yes')]]
]);
} else {
$profile_in_net_dir = '';
}
$hide_friends = replace_macros($opt_tpl, [
- '$field' => ['hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', [t('No'), t('Yes')]],
+ '$field' => ['hide-friends', L10n::t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', [L10n::t('No'), L10n::t('Yes')]],
]);
$hide_wall = replace_macros($opt_tpl, [
- '$field' => ['hidewall', t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], t("If enabled, posting public messages to Diaspora and other networks isn't possible."), [t('No'), t('Yes')]],
+ '$field' => ['hidewall', L10n::t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], L10n::t("If enabled, posting public messages to Diaspora and other networks isn't possible."), [L10n::t('No'), L10n::t('Yes')]],
]);
$blockwall = replace_macros($opt_tpl, [
- '$field' => ['blockwall', t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', [t('No'), t('Yes')]],
+ '$field' => ['blockwall', L10n::t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', [L10n::t('No'), L10n::t('Yes')]],
]);
$blocktags = replace_macros($opt_tpl, [
- '$field' => ['blocktags', t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', [t('No'), t('Yes')]],
+ '$field' => ['blocktags', L10n::t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', [L10n::t('No'), L10n::t('Yes')]],
]);
$suggestme = replace_macros($opt_tpl, [
- '$field' => ['suggestme', t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', [t('No'), t('Yes')]],
+ '$field' => ['suggestme', L10n::t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', [L10n::t('No'), L10n::t('Yes')]],
]);
$unkmail = replace_macros($opt_tpl, [
- '$field' => ['unkmail', t('Permit unknown people to send you private mail?'), $unkmail, '', [t('No'), t('Yes')]],
+ '$field' => ['unkmail', L10n::t('Permit unknown people to send you private mail?'), $unkmail, '', [L10n::t('No'), L10n::t('Yes')]],
]);
if (!$profile['publish'] && !$profile['net-publish']) {
- info(t('Profile is <strong>not published</strong>.') . EOL);
+ info(L10n::t('Profile is <strong>not published</strong>.') . EOL);
}
$tpl_addr = get_markup_template('settings/nick_set.tpl');
$prof_addr = replace_macros($tpl_addr,[
- '$desc' => t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->get_hostname() . $a->get_path(), System::baseUrl() . '/profile/' . $nickname),
+ '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->get_hostname() . $a->get_path(), System::baseUrl() . '/profile/' . $nickname),
'$basepath' => $a->get_hostname()
]);
$stpl = get_markup_template('settings/settings.tpl');
$expire_arr = [
- 'days' => ['expire', t("Automatically expire posts after this many days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')],
- 'advanced' => t('Advanced expiration settings'),
- 'label' => t('Advanced Expiration'),
- 'items' => ['expire_items', t("Expire posts:"), $expire_items, '', [t('No'), t('Yes')]],
- 'notes' => ['expire_notes', t("Expire personal notes:"), $expire_notes, '', [t('No'), t('Yes')]],
- 'starred' => ['expire_starred', t("Expire starred posts:"), $expire_starred, '', [t('No'), t('Yes')]],
- 'photos' => ['expire_photos', t("Expire photos:"), $expire_photos, '', [t('No'), t('Yes')]],
- 'network_only' => ['expire_network_only', t("Only expire posts by others:"), $expire_network_only, '', [t('No'), t('Yes')]],
+ 'days' => ['expire', L10n::t("Automatically expire posts after this many days:"), $expire, L10n::t('If empty, posts will not expire. Expired posts will be deleted')],
+ 'advanced' => L10n::t('Advanced expiration settings'),
+ 'label' => L10n::t('Advanced Expiration'),
+ 'items' => ['expire_items', L10n::t("Expire posts:"), $expire_items, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'notes' => ['expire_notes', L10n::t("Expire personal notes:"), $expire_notes, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'starred' => ['expire_starred', L10n::t("Expire starred posts:"), $expire_starred, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'photos' => ['expire_photos', L10n::t("Expire photos:"), $expire_photos, '', [L10n::t('No'), L10n::t('Yes')]],
+ 'network_only' => ['expire_network_only', L10n::t("Only expire posts by others:"), $expire_network_only, '', [L10n::t('No'), L10n::t('Yes')]],
];
$group_select = Group::displayGroupSelection(local_user(), $a->user['def_gid']);
}
/* Installed langs */
- $lang_choices = get_available_languages();
+ $lang_choices = L10n::getAvailableLanguages();
/// @TODO Fix indending (or so)
$o .= replace_macros($stpl, [
- '$ptitle' => t('Account Settings'),
+ '$ptitle' => L10n::t('Account Settings'),
- '$submit' => t('Save Settings'),
+ '$submit' => L10n::t('Save Settings'),
'$baseurl' => System::baseUrl(true),
'$uid' => local_user(),
'$form_security_token' => get_form_security_token("settings"),
'$nickname_block' => $prof_addr,
- '$h_pass' => t('Password Settings'),
- '$password1'=> ['password', t('New Password:'), '', ''],
- '$password2'=> ['confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')],
- '$password3'=> ['opassword', t('Current Password:'), '', t('Your current password to confirm the changes')],
- '$password4'=> ['mpassword', t('Password:'), '', t('Your current password to confirm the changes')],
+ '$h_pass' => L10n::t('Password Settings'),
+ '$password1'=> ['password', L10n::t('New Password:'), '', ''],
+ '$password2'=> ['confirm', L10n::t('Confirm:'), '', L10n::t('Leave password fields blank unless changing')],
+ '$password3'=> ['opassword', L10n::t('Current Password:'), '', L10n::t('Your current password to confirm the changes')],
+ '$password4'=> ['mpassword', L10n::t('Password:'), '', L10n::t('Your current password to confirm the changes')],
'$oid_enable' => (!Config::get('system', 'no_openid')),
'$openid' => $openid_field,
- '$h_basic' => t('Basic Settings'),
- '$username' => ['username', t('Full Name:'), $username, ''],
- '$email' => ['email', t('Email Address:'), $email, '', '', '', 'email'],
- '$timezone' => ['timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''],
- '$language' => ['language', t('Your Language:'), $language, t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
- '$defloc' => ['defloc', t('Default Post Location:'), $defloc, ''],
- '$allowloc' => ['allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
+ '$h_basic' => L10n::t('Basic Settings'),
+ '$username' => ['username', L10n::t('Full Name:'), $username, ''],
+ '$email' => ['email', L10n::t('Email Address:'), $email, '', '', '', 'email'],
+ '$timezone' => ['timezone_select' , L10n::t('Your Timezone:'), select_timezone($timezone), ''],
+ '$language' => ['language', L10n::t('Your Language:'), $language, L10n::t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
+ '$defloc' => ['defloc', L10n::t('Default Post Location:'), $defloc, ''],
+ '$allowloc' => ['allow_location', L10n::t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
- '$h_prv' => t('Security and Privacy Settings'),
+ '$h_prv' => L10n::t('Security and Privacy Settings'),
- '$maxreq' => ['maxreq', t('Maximum Friend Requests/Day:'), $maxreq , t("\x28to prevent spam abuse\x29")],
- '$permissions' => t('Default Post Permissions'),
- '$permdesc' => t("\x28click to open/close\x29"),
+ '$maxreq' => ['maxreq', L10n::t('Maximum Friend Requests/Day:'), $maxreq , L10n::t("\x28to prevent spam abuse\x29")],
+ '$permissions' => L10n::t('Default Post Permissions'),
+ '$permdesc' => L10n::t("\x28click to open/close\x29"),
'$visibility' => $profile['net-publish'],
'$aclselect' => populate_acl($a->user),
'$suggestme' => $suggestme,
- '$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
- '$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''),
+ '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''),
+ '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''),
// ACL permissions box
- '$group_perms' => t('Show to Groups'),
- '$contact_perms' => t('Show to Contacts'),
- '$private' => t('Default Private Post'),
- '$public' => t('Default Public Post'),
+ '$group_perms' => L10n::t('Show to Groups'),
+ '$contact_perms' => L10n::t('Show to Contacts'),
+ '$private' => L10n::t('Default Private Post'),
+ '$public' => L10n::t('Default Public Post'),
'$is_private' => $private_post,
'$return_path' => $query_str,
'$public_link' => $public_post_link,
- '$settings_perms' => t('Default Permissions for New Posts'),
+ '$settings_perms' => L10n::t('Default Permissions for New Posts'),
'$group_select' => $group_select,
'$hide_friends' => $hide_friends,
'$hide_wall' => $hide_wall,
'$unkmail' => $unkmail,
- '$cntunkmail' => ['cntunkmail', t('Maximum private messages per day from unknown people:'), $cntunkmail , t("\x28to prevent spam abuse\x29")],
-
-
- '$h_not' => t('Notification Settings'),
- '$activity_options' => t('By default post a status message when:'),
- '$post_newfriend' => ['post_newfriend', t('accepting a friend request'), $post_newfriend, ''],
- '$post_joingroup' => ['post_joingroup', t('joining a forum/community'), $post_joingroup, ''],
- '$post_profilechange' => ['post_profilechange', t('making an <em>interesting</em> profile change'), $post_profilechange, ''],
- '$lbl_not' => t('Send a notification email when:'),
- '$notify1' => ['notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
- '$notify2' => ['notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
- '$notify3' => ['notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
- '$notify4' => ['notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
- '$notify5' => ['notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
- '$notify6' => ['notify6', t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
- '$notify7' => ['notify7', t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
- '$notify8' => ['notify8', t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
-
- '$desktop_notifications' => ['desktop_notifications', t('Activate desktop notifications') , false, t('Show desktop popup on new notifications')],
-
- '$email_textonly' => ['email_textonly', t('Text-only notification emails'),
+ '$cntunkmail' => ['cntunkmail', L10n::t('Maximum private messages per day from unknown people:'), $cntunkmail , L10n::t("\x28to prevent spam abuse\x29")],
+
+
+ '$h_not' => L10n::t('Notification Settings'),
+ '$activity_options' => L10n::t('By default post a status message when:'),
+ '$post_newfriend' => ['post_newfriend', L10n::t('accepting a friend request'), $post_newfriend, ''],
+ '$post_joingroup' => ['post_joingroup', L10n::t('joining a forum/community'), $post_joingroup, ''],
+ '$post_profilechange' => ['post_profilechange', L10n::t('making an <em>interesting</em> profile change'), $post_profilechange, ''],
+ '$lbl_not' => L10n::t('Send a notification email when:'),
+ '$notify1' => ['notify1', L10n::t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
+ '$notify2' => ['notify2', L10n::t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
+ '$notify3' => ['notify3', L10n::t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
+ '$notify4' => ['notify4', L10n::t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
+ '$notify5' => ['notify5', L10n::t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
+ '$notify6' => ['notify6', L10n::t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
+ '$notify7' => ['notify7', L10n::t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
+ '$notify8' => ['notify8', L10n::t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
+
+ '$desktop_notifications' => ['desktop_notifications', L10n::t('Activate desktop notifications') , false, L10n::t('Show desktop popup on new notifications')],
+
+ '$email_textonly' => ['email_textonly', L10n::t('Text-only notification emails'),
PConfig::get(local_user(), 'system', 'email_textonly'),
- t('Send text only notification emails, without the html part')],
+ L10n::t('Send text only notification emails, without the html part')],
- '$detailed_notif' => ['detailed_notif', t('Show detailled notifications'),
+ '$detailed_notif' => ['detailed_notif', L10n::t('Show detailled notifications'),
PConfig::get(local_user(), 'system', 'detailed_notif'),
- t('Per default the notificiation are condensed to a single notification per item. When enabled, every notification is displayed.')],
+ L10n::t('Per default the notificiation are condensed to a single notification per item. When enabled, every notification is displayed.')],
- '$h_advn' => t('Advanced Account/Page Type Settings'),
- '$h_descadvn' => t('Change the behaviour of this account for special situations'),
+ '$h_advn' => L10n::t('Advanced Account/Page Type Settings'),
+ '$h_descadvn' => L10n::t('Change the behaviour of this account for special situations'),
'$pagetype' => $pagetype,
- '$relocate' => t('Relocate'),
- '$relocate_text' => t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
- '$relocate_button' => t("Resend relocate message to contacts"),
+ '$relocate' => L10n::t('Relocate'),
+ '$relocate_text' => L10n::t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
+ '$relocate_button' => L10n::t("Resend relocate message to contacts"),
]);
<?php
-
+/**
+ * @file mod/subthread.php
+ */
use Friendica\App;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\System;
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 subthread_content(App $a) {
$uri = item_new_uri($a->get_hostname(),$owner_uid);
- $post_type = (($item['resource-id']) ? t('photo') : t('status'));
+ $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$link = xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
$body = $item['body'];
<content>$body</content>
</object>
EOT;
- $bodyverb = t('%1$s is following %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s is following %2$s\'s %3$s');
if (! isset($bodyverb)) {
return;
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;
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
- '$message' => t('Do you really want to delete this suggestion?'),
+ '$message' => L10n::t('Do you really want to delete this suggestion?'),
'$extra_inputs' => $inputs,
- '$confirm' => t('Yes'),
+ '$confirm' => L10n::t('Yes'),
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
$o = '';
if (! local_user()) {
- notice( t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$r = GContact::suggestionQuery(local_user());
if (! DBM::is_result($r)) {
- $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
+ $o .= L10n::t('No suggestions available. If this is a new site, please try again in 24 hours.');
return $o;
}
$connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id'];
$photo_menu = [
- 'profile' => [t("View Profile"), Profile::zrl($rr["url"])],
- 'follow' => [t("Connect/Follow"), $connlnk],
- 'hide' => [t('Ignore/Hide'), $ignlnk]
+ 'profile' => [L10n::t("View Profile"), Profile::zrl($rr["url"])],
+ 'follow' => [L10n::t("Connect/Follow"), $connlnk],
+ 'hide' => [L10n::t('Ignore/Hide'), $ignlnk]
];
$contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
'account_type' => Contact::getAccountType($contact_details),
'ignlnk' => $ignlnk,
'ignid' => $rr['id'],
- 'conntxt' => t('Connect'),
+ 'conntxt' => L10n::t('Connect'),
'connlnk' => $connlnk,
'photo_menu' => $photo_menu,
- 'ignore' => t('Ignore/Hide'),
+ 'ignore' => L10n::t('Ignore/Hide'),
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
'id' => ++$id,
];
$tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl,[
- '$title' => t('Friend Suggestions'),
+ '$title' => L10n::t('Friend Suggestions'),
'$contacts' => $entries,
]);
<?php
-
+/**
+ * @file mod/tagger.php
+ */
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 tagger_content(App $a) {
$uri = item_new_uri($a->get_hostname(),$owner_uid);
$xterm = xmlify($term);
- $post_type = (($item['resource-id']) ? t('photo') : t('status'));
+ $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$link = xmlify('<link rel="alternate" type="text/html" href="'
</object>
EOT;
- $bodyverb = t('%1$s tagged %2$s\'s %3$s with %4$s');
+ $bodyverb = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s');
if (! isset($bodyverb)) {
return;
<?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) {
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
}
- if ((x($_POST,'submit')) && ($_POST['submit'] === t('Cancel'))) {
+ if ((x($_POST,'submit')) && ($_POST['submit'] === L10n::t('Cancel'))) {
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
}
intval(local_user())
);
- info( t('Tag removed') . EOL );
+ info(L10n::t('Tag removed') . EOL );
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
// NOTREACHED
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
}
- $o .= '<h3>' . t('Remove Item Tag') . '</h3>';
+ $o .= '<h3>' . L10n::t('Remove Item Tag') . '</h3>';
- $o .= '<p id="tag-remove-desc">' . t('Select a tag to remove: ') . '</p>';
+ $o .= '<p id="tag-remove-desc">' . L10n::t('Select a tag to remove: ') . '</p>';
$o .= '<form id="tagrm" action="tagrm" method="post" >';
$o .= '<input type="hidden" name="item" value="' . $item . '" />';
}
$o .= '</ul>';
- $o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . t('Remove') .'" />';
- $o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . t('Cancel') .'" />';
+ $o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . L10n::t('Remove') .'" />';
+ $o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . L10n::t('Cancel') .'" />';
$o .= '</form>';
return $o;
<?php
-
+/**
+ * @file mod/uexport.php
+ */
use Friendica\App;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
* list of array( 'link url', 'link text', 'help text' )
*/
$options = [
- ['uexport/account', t('Export account'), t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')],
- ['uexport/backup', t('Export all'), t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')],
+ ['uexport/account', L10n::t('Export account'), L10n::t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')],
+ ['uexport/backup', L10n::t('Export all'), L10n::t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')],
];
Addon::callHooks('uexport_options', $options);
$tpl = get_markup_template("uexport.tpl");
return replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
- '$title' => t('Export personal data'),
+ '$title' => L10n::t('Export personal data'),
'$options' => $options
]);
}
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\UserImport;
-function uimport_post(App $a) {
+function uimport_post(App $a)
+{
switch ($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
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;
$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;
}
}
$tpl = get_markup_template("uimport.tpl");
return replace_macros($tpl, [
- '$regbutt' => t('Import'),
+ '$regbutt' => L10n::t('Import'),
'$import' => [
- 'title' => t("Move account"),
- 'intro' => t("You can import an account from another Friendica server."),
- 'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
- 'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
- 'field' => ['accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
+ 'title' => L10n::t("Move account"),
+ 'intro' => L10n::t("You can import an account from another Friendica server."),
+ 'instruct' => L10n::t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
+ 'warn' => L10n::t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
+ 'field' => ['accountfile', L10n::t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', L10n::t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
],
]);
}
* @file mod/unfollow.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
function unfollow_post(App $a)
{
if (!local_user()) {
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
$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`
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($uid)
);
- if (DBM::is_result($r)) {
+ if (DBM::is_result($r)) {
Contact::terminateFriendship($r[0], $contact);
}
}
dba::update('contact', ['rel' => CONTACT_IS_FOLLOWER], ['id' => $contact['id']]);
- info(t('Contact unfollowed').EOL);
+ info(L10n::t('Contact unfollowed').EOL);
goaway(System::baseUrl().'/contacts/'.$contact['id']);
}
goaway($return_url);
// NOTREACHED
}
-function unfollow_content(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
}
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
- $submit = t('Submit Request');
+ $submit = L10n::t('Submit Request');
$condition = ["`uid` = ? AND `rel` = ? AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?",
local_user(), CONTACT_IS_FRIEND, normalise_link($url),
$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
}
$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
}
// Makes the connection request for friendica contacts easier
$_SESSION["fastlane"] = $contact["url"];
- $header = t("Disconnect/Unfollow");
+ $header = L10n::t("Disconnect/Unfollow");
- $o = replace_macros($tpl,[
+ $o = replace_macros($tpl, [
'$header' => htmlentities($header),
'$desc' => "",
'$pls_answer' => "",
'$statusnet' => "",
'$diaspora' => "",
'$diasnote' => "",
- '$your_address' => t('Your Identity Address:'),
+ '$your_address' => L10n::t('Your Identity Address:'),
'$invite_desc' => "",
'$emailnet' => "",
'$submit' => $submit,
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
'$nickname' => "",
'$name' => $contact["name"],
'$url' => $contact["url"],
'$zrl' => Profile::zrl($contact["url"]),
- '$url_label' => t("Profile URL"),
+ '$url_label' => L10n::t("Profile URL"),
'$myaddr' => $myaddr,
'$request' => $request,
'$keywords' => "",
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
- $o .= replace_macros(get_markup_template('section_title.tpl'), ['$title' => t('Status Messages and Posts')]);
+ $o .= replace_macros(get_markup_template('section_title.tpl'), ['$title' => L10n::t('Status Messages and Posts')]);
// Show last public posts
$o .= Contact::getPostsFromUrl($contact["url"]);
// 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";
<?php
-
-// See update_profile.php for documentation
+/**
+ * @file mod/update_display.php
+ * See update_profile.php for documentation
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
require_once "mod/display.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";
<?php
-
-// See update_profile.php for documentation
+/**
+ * @file mod/update_network
+ * See update_profile.php for documentation
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
require_once "mod/network.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/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";
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;
if($albums_visible) {
$o .= '<div id="sidebar-photos-albums" class="widget">';
- $o .= '<h3>' . '<a href="' . System::baseUrl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h3>';
+ $o .= '<h3>' . '<a href="' . System::baseUrl() . '/photos/' . $a->data['user']['nickname'] . '">' . L10n::t('Photo Albums') . '</a></h3>';
$o .= '<ul>';
foreach($albums as $album) {
// don't show contact photos. We once translated this name, but then you could still access it under
// a different language setting. Now we store the name in English and check in English (and translated for legacy albums).
- if((! strlen($album['album'])) || ($album['album'] === 'Contact Photos') || ($album['album'] === t('Contact Photos')))
+ if((! strlen($album['album'])) || ($album['album'] === 'Contact Photos') || ($album['album'] === L10n::t('Contact Photos')))
continue;
$o .= '<li>' . '<a href="photos/' . $a->argv[1] . '/album/' . bin2hex($album['album']) . '" >' . $album['album'] . '</a></li>';
}
$o .= '</ul>';
}
if(local_user() && $a->data['user']['uid'] == local_user()) {
- $o .= '<div id="photo-albums-upload-link"><a href="' . System::baseUrl() . '/photos/' . $a->data['user']['nickname'] . '/upload" >' .t('Upload New Photos') . '</a></div>';
+ $o .= '<div id="photo-albums-upload-link"><a href="' . System::baseUrl() . '/photos/' . $a->data['user']['nickname'] . '/upload" >' .L10n::t('Upload New Photos') . '</a></div>';
}
$o .= '</div>';
$drop_url = $a->query_string;
$a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
- '$message' => t('Do you really want to delete this video?'),
+ '$message' => L10n::t('Do you really want to delete this video?'),
'$extra_inputs' => [
['name'=>'id', 'value'=> $_POST['id']],
['name'=>'delete', 'value'=>'x']
],
- '$confirm' => t('Delete Video'),
+ '$confirm' => L10n::t('Delete Video'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'confirm', // Needed so that confirmation will bring us back into this if statement
- '$cancel' => t('Cancel'),
+ '$cancel' => L10n::t('Cancel'),
]);
$a->error = 1; // Set $a->error so the other module functions don't execute
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
- notice( t('Public access denied.') . EOL);
+ notice(L10n::t('Public access denied.') . EOL);
return;
}
require_once('include/conversation.php');
if(! x($a->data,'user')) {
- notice( t('No videos selected') . EOL );
+ notice(L10n::t('No videos selected') . EOL );
return;
}
}
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;
}
$videos[] = [
'id' => $rr['id'],
'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'],
- 'title' => t('View Video'),
+ 'title' => L10n::t('View Video'),
'src' => System::baseUrl() . '/attach/' . $rr['id'] . '?attachment=0',
'alt' => $alt_e,
'mime' => $rr['filetype'],
'album' => [
'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
- 'alt' => t('View Album'),
+ 'alt' => L10n::t('View Album'),
],
];
$tpl = get_markup_template('videos_recent.tpl');
$o .= replace_macros($tpl, [
- '$title' => t('Recent Videos'),
+ '$title' => L10n::t('Recent Videos'),
'$can_post' => $can_post,
- '$upload' => [t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'],
+ '$upload' => [L10n::t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'],
'$videos' => $videos,
'$delete_url' => (($can_post)?System::baseUrl().'/videos/'.$a->data['user']['nickname']:False)
]);
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;
-function viewcontacts_init(App $a) {
-
- if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
+function viewcontacts_init(App $a)
+{
+ if ((Config::get('system', 'block_public')) && (! local_user()) && (! remote_user())) {
return;
}
Nav::setSelected('home');
- if($a->argc > 1) {
+ if ($a->argc > 1) {
$nick = $a->argv[1];
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `blocked` = 0 LIMIT 1",
dbesc($nick)
}
}
-
-function viewcontacts_content(App $a) {
+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);
+ if ((Config::get('system', 'block_public')) && (! local_user()) && (! remote_user())) {
+ notice(L10n::t('Public access denied.') . EOL);
return;
}
// tabs
$o .= Profile::getTabs($a, $is_owner, $a->data['user']['nickname']);
- if(((! count($a->profile)) || ($a->profile['hide-friends']))) {
- notice( t('Permission denied.') . EOL);
+ if (((! count($a->profile)) || ($a->profile['hide-friends']))) {
+ notice(L10n::t('Permission denied.') . EOL);
return $o;
}
dbesc(NETWORK_DIASPORA),
dbesc(NETWORK_OSTATUS)
);
- if (DBM::is_result($r))
+ if (DBM::is_result($r)) {
$a->set_pager_total($r[0]['total']);
+ }
$r = q("SELECT * FROM `contact`
WHERE `uid` = %d AND NOT `blocked` AND NOT `pending`
intval($a->pager['itemspage'])
);
if (!DBM::is_result($r)) {
- info(t('No contacts.').EOL);
+ info(L10n::t('No contacts.').EOL);
return $o;
}
$is_owner = ((local_user() && ($a->profile['profile_uid'] == local_user())) ? true : false);
- if($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel']))
+ if ($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
$url = 'redir/' . $rr['id'];
- else
+ } else {
$url = Profile::zrl($url);
+ }
$contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr);
$contacts[] = [
'id' => $rr['id'],
- 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $contact_details['name'], $rr['url']),
+ 'img_hover' => L10n::t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
'photo_menu' => Contact::photoMenu($rr),
'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
- 'name' => htmlentities(substr($contact_details['name'],0,20)),
+ 'name' => htmlentities(substr($contact_details['name'], 0, 20)),
'username' => htmlentities($contact_details['name']),
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
$tpl = get_markup_template("viewcontact_template.tpl");
$o .= replace_macros($tpl, [
- '$title' => t('Contacts'),
+ '$title' => L10n::t('Contacts'),
'$contacts' => $contacts,
'$paginate' => paginate($a),
]);
<?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;
}
if(! $item_id) {
$a->error = 404;
- notice( t('Item not found.') . EOL);
+ notice(L10n::t('Item not found.') . EOL);
return;
}
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Util\Mimetype;
);
if (! DBM::is_result($r)) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
} else {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
}
if(! $can_post) {
if ($r_json) {
- echo json_encode(['error'=>t('Permission denied.')]);
+ echo json_encode(['error'=>L10n::t('Permission denied.')]);
killme();
}
- notice( t('Permission denied.') . EOL );
+ notice(L10n::t('Permission denied.') . EOL );
killme();
}
if(! x($_FILES,'userfile')) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
}
killme();
}
*/
if($filesize <=0) {
- $msg = t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(t('Or - did you try to upload an empty file?'));
+ $msg = L10n::t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(L10n::t('Or - did you try to upload an empty file?'));
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
}
if(($maxfilesize) && ($filesize > $maxfilesize)) {
- $msg = sprintf(t('File exceeds size limit of %s'), formatBytes($maxfilesize));
+ $msg = L10n::t('File exceeds size limit of %s', formatBytes($maxfilesize));
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
@unlink($src);
if(! $r) {
- $msg = t('File upload failed.');
+ $msg = L10n::t('File upload failed.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
);
if (! DBM::is_result($r)) {
- $msg = t('File upload failed.');
+ $msg = L10n::t('File upload failed.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
<?php
-
/**
* @file mod/wall_upload.php
* @brief Module for uploading a picture to the profile wall
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Database\DBM;
if (! DBM::is_result($r)) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
}
} else {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
if (! $can_post) {
if ($r_json) {
- echo json_encode(['error'=>t('Permission denied.')]);
+ echo json_encode(['error'=>L10n::t('Permission denied.')]);
killme();
}
- notice(t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.') . EOL);
killme();
}
if (! x($_FILES, 'userfile') && ! x($_FILES, 'media')) {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
}
killme();
}
if ($src=="") {
if ($r_json) {
- echo json_encode(['error'=>t('Invalid request.')]);
+ echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
- notice(t('Invalid request.').EOL);
+ notice(L10n::t('Invalid request.').EOL);
killme();
}
$maximagesize = Config::get('system', 'maximagesize');
if (($maximagesize) && ($filesize > $maximagesize)) {
- $msg = sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize));
+ $msg = L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize));
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
$Image = new Image($imagedata, $filetype);
if (! $Image->isValid()) {
- $msg = t('Unable to process image.');
+ $msg = L10n::t('Unable to process image.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
// If we don't have an album name use the Wall Photos album
if (! strlen($album)) {
- $album = t('Wall Photos');
+ $album = L10n::t('Wall Photos');
}
$defperm = '<' . $default_cid . '>';
$r = Photo::store($Image, $page_owner_uid, $visitor, $hash, $filename, $album, 0, 0, $defperm);
if (! $r) {
- $msg = t('Image upload failed.');
+ $msg = L10n::t('Image upload failed.');
if ($r_json) {
echo json_encode(['error'=>$msg]);
} else {
* @file mod/wallmessage.php
*/
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Mail;
function wallmessage_post(App $a) {
$replyto = Profile::getMyURL();
- if(! $replyto) {
- notice( t('Permission denied.') . EOL);
+ if (!$replyto) {
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
$recipient = (($a->argc > 1) ? notags($a->argv[1]) : '');
- if((! $recipient) || (! $body)) {
+ if ((! $recipient) || (! $body)) {
return;
}
$user = $r[0];
- if(! intval($user['unkmail'])) {
- notice( t('Permission denied.') . EOL);
+ if (! intval($user['unkmail'])) {
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
intval($user['uid'])
);
- if($r[0]['total'] > $user['cntunkmail']) {
- notice( sprintf( t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
+ if ($r[0]['total'] > $user['cntunkmail']) {
+ notice(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$ret = Mail::sendWall($user, $body, $subject, $replyto);
- switch($ret){
+ 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']);
-
}
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);
+ if (!$recipient) {
+ notice(L10n::t('No recipient.') . EOL);
return;
}
);
if (! DBM::is_result($r)) {
- notice( t('No recipient.') . EOL);
+ notice(L10n::t('No recipient.') . EOL);
logger('wallmessage: no recipient');
return;
}
$user = $r[0];
- if(! intval($user['unkmail'])) {
- notice( t('Permission denied.') . EOL);
+ if (!intval($user['unkmail'])) {
+ notice(L10n::t('Permission denied.') . EOL);
return;
}
intval($user['uid'])
);
- if($r[0]['total'] > $user['cntunkmail']) {
- notice( sprintf( t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
+ if ($r[0]['total'] > $user['cntunkmail']) {
+ notice(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
}
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('wallmsg-end.tpl');
$a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
+ '$linkurl' => L10n::t('Please enter a link URL:')
]);
$tpl = get_markup_template('wallmessage.tpl');
- $o .= replace_macros($tpl,[
- '$header' => t('Send Private Message'),
- '$subheader' => sprintf( t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
- '$to' => t('To:'),
- '$subject' => t('Subject:'),
+ $o .= replace_macros($tpl, [
+ '$header' => L10n::t('Send Private Message'),
+ '$subheader' => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
+ '$to' => L10n::t('To:'),
+ '$subject' => L10n::t('Subject:'),
'$recipname' => $user['username'],
'$nickname' => $user['nickname'],
- '$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
- '$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
+ '$subjtxt' => ((x($_REQUEST, 'subject')) ? strip_tags($_REQUEST['subject']) : ''),
+ '$text' => ((x($_REQUEST, 'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
'$readonly' => '',
- '$yourmessage' => t('Your message:'),
+ '$yourmessage' => L10n::t('Your message:'),
'$select' => $select,
'$parent' => '',
- '$upload' => t('Upload photo'),
- '$insert' => t('Insert web link'),
- '$wait' => t('Please wait')
+ '$upload' => L10n::t('Upload photo'),
+ '$insert' => L10n::t('Insert web link'),
+ '$wait' => L10n::t('Please wait')
]);
return $o;
<?php
-
+/**
+ * @file mod/webfinger.php
+ */
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Network\Probe;
-function webfinger_content(App $a) {
-
+function webfinger_content(App $a)
+{
if (!local_user()) {
- http_status_exit(403,
- ["title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a probing.")]);
+ http_status_exit(
+ 403,
+ [
+ "title" => L10n::t("Public access denied."),
+ "description" => L10n::t("Only logged in users are permitted to perform a probing.")
+ ]
+ );
killme();
}
$o .= '<br /><br />';
- if(x($_GET,'addr')) {
+ if (x($_GET, 'addr')) {
$addr = trim($_GET['addr']);
$res = Probe::lrdd($addr);
$o .= '<pre>';
- $o .= str_replace("\n",'<br />',print_r($res,true));
+ $o .= str_replace("\n", '<br />', print_r($res, true));
$o .= '</pre>';
}
return $o;
<?php
-
+/**
+ * @file src/App.php
+ */
namespace Friendica;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
'$baseurl' => $this->get_baseurl(),
'$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
- '$delitem' => t('Delete this item?'),
- '$showmore' => t('show more'),
- '$showfewer' => t('show fewer'),
+ '$delitem' => L10n::t('Delete this item?'),
+ '$showmore' => L10n::t('show more'),
+ '$showfewer' => L10n::t('show fewer'),
'$update_interval' => $interval,
'$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon,
namespace Friendica\Content;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use dba;
$o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n";
$rep = [
- 0 => t('Frequently'),
- 1 => t('Hourly'),
- 2 => t('Twice daily'),
- 3 => t('Daily'),
- 4 => t('Weekly'),
- 5 => t('Monthly')
+ 0 => L10n::t('Frequently'),
+ 1 => L10n::t('Hourly'),
+ 2 => L10n::t('Twice daily'),
+ 3 => L10n::t('Daily'),
+ 4 => L10n::t('Weekly'),
+ 5 => L10n::t('Monthly')
];
foreach ($rep as $k => $v) {
public static function networkToName($s, $profile = "")
{
$nets = [
- NETWORK_DFRN => t('Friendica'),
- NETWORK_OSTATUS => t('OStatus'),
- NETWORK_FEED => t('RSS/Atom'),
- NETWORK_MAIL => t('Email'),
- NETWORK_DIASPORA => t('Diaspora'),
- NETWORK_FACEBOOK => t('Facebook'),
- NETWORK_ZOT => t('Zot!'),
- NETWORK_LINKEDIN => t('LinkedIn'),
- NETWORK_XMPP => t('XMPP/IM'),
- NETWORK_MYSPACE => t('MySpace'),
- NETWORK_GPLUS => t('Google+'),
- NETWORK_PUMPIO => t('pump.io'),
- NETWORK_TWITTER => t('Twitter'),
- NETWORK_DIASPORA2 => t('Diaspora Connector'),
- NETWORK_STATUSNET => t('GNU Social Connector'),
- NETWORK_PNUT => t('pnut'),
- NETWORK_APPNET => t('App.net')
+ NETWORK_DFRN => L10n::t('Friendica'),
+ NETWORK_OSTATUS => L10n::t('OStatus'),
+ NETWORK_FEED => L10n::t('RSS/Atom'),
+ NETWORK_MAIL => L10n::t('Email'),
+ NETWORK_DIASPORA => L10n::t('Diaspora'),
+ NETWORK_FACEBOOK => L10n::t('Facebook'),
+ NETWORK_ZOT => L10n::t('Zot!'),
+ NETWORK_LINKEDIN => L10n::t('LinkedIn'),
+ NETWORK_XMPP => L10n::t('XMPP/IM'),
+ NETWORK_MYSPACE => L10n::t('MySpace'),
+ NETWORK_GPLUS => L10n::t('Google+'),
+ NETWORK_PUMPIO => L10n::t('pump.io'),
+ NETWORK_TWITTER => L10n::t('Twitter'),
+ NETWORK_DIASPORA2 => L10n::t('Diaspora Connector'),
+ NETWORK_STATUSNET => L10n::t('GNU Social Connector'),
+ NETWORK_PNUT => L10n::t('pnut'),
+ NETWORK_APPNET => L10n::t('App.net')
];
Addon::callHooks('network_to_name', $nets);
public static function gender($current = "", $suffix = "")
{
$o = '';
- $select = ['', t('Male'), t('Female'), t('Currently Male'), t('Currently Female'), t('Mostly Male'), t('Mostly Female'), t('Transgender'), t('Intersex'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Non-specific'), t('Other'), t('Undecided')];
+ $select = ['', L10n::t('Male'), L10n::t('Female'), L10n::t('Currently Male'), L10n::t('Currently Female'), L10n::t('Mostly Male'), L10n::t('Mostly Female'), L10n::t('Transgender'), L10n::t('Intersex'), L10n::t('Transsexual'), L10n::t('Hermaphrodite'), L10n::t('Neuter'), L10n::t('Non-specific'), L10n::t('Other'), L10n::t('Undecided')];
Addon::callHooks('gender_selector', $select);
public static function sexualPreference($current = "", $suffix = "")
{
$o = '';
- $select = ['', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')];
+ $select = ['', L10n::t('Males'), L10n::t('Females'), L10n::t('Gay'), L10n::t('Lesbian'), L10n::t('No Preference'), L10n::t('Bisexual'), L10n::t('Autosexual'), L10n::t('Abstinent'), L10n::t('Virgin'), L10n::t('Deviant'), L10n::t('Fetish'), L10n::t('Oodles'), L10n::t('Nonsexual')];
Addon::callHooks('sexpref_selector', $select);
public static function maritalStatus($current = "")
{
$o = '';
- $select = ['', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me')];
+ $select = ['', L10n::t('Single'), L10n::t('Lonely'), L10n::t('Available'), L10n::t('Unavailable'), L10n::t('Has crush'), L10n::t('Infatuated'), L10n::t('Dating'), L10n::t('Unfaithful'), L10n::t('Sex Addict'), L10n::t('Friends'), L10n::t('Friends/Benefits'), L10n::t('Casual'), L10n::t('Engaged'), L10n::t('Married'), L10n::t('Imaginarily married'), L10n::t('Partners'), L10n::t('Cohabiting'), L10n::t('Common law'), L10n::t('Happy'), L10n::t('Not looking'), L10n::t('Swinger'), L10n::t('Betrayed'), L10n::t('Separated'), L10n::t('Unstable'), L10n::t('Divorced'), L10n::t('Imaginarily divorced'), L10n::t('Widowed'), L10n::t('Uncertain'), L10n::t('It\'s complicated'), L10n::t('Don\'t care'), L10n::t('Ask me')];
Addon::callHooks('marital_selector', $select);
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
class Feature
// General
'general' => [
- t('General Features'),
- //array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
- ['multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
- ['photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)],
- ['export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
+ L10n::t('General Features'),
+ //array('expire', L10n::t('Content Expiration'), L10n::t('Remove old posts/comments after a period of time')),
+ ['multi_profiles', L10n::t('Multiple Profiles'), L10n::t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
+ ['photo_location', L10n::t('Photo Location'), L10n::t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)],
+ ['export_calendar', L10n::t('Export Public Calendar'), L10n::t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
],
// Post composition
'composition' => [
- t('Post Composition Features'),
- ['preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
- ['aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
+ L10n::t('Post Composition Features'),
+ ['preview', L10n::t('Post Preview'), L10n::t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
+ ['aclautomention', L10n::t('Auto-mention Forums'), L10n::t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
],
// Network sidebar widgets
'widgets' => [
- t('Network Sidebar Widgets'),
- ['archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
- ['forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
- ['groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
- ['networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)],
- ['savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
+ L10n::t('Network Sidebar Widgets'),
+ ['archives', L10n::t('Search by Date'), L10n::t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
+ ['forumlist_widget', L10n::t('List Forums'), L10n::t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
+ ['groups', L10n::t('Group Filter'), L10n::t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
+ ['networks', L10n::t('Network Filter'), L10n::t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)],
+ ['savedsearch', L10n::t('Saved Searches'), L10n::t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
],
// Network tabs
'net_tabs' => [
- t('Network Tabs'),
- ['personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
- ['new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)],
- ['link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
+ L10n::t('Network Tabs'),
+ ['personal_tab', L10n::t('Network Personal Tab'), L10n::t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
+ ['new_tab', L10n::t('Network New Tab'), L10n::t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)],
+ ['link_tab', L10n::t('Network Shared Links Tab'), L10n::t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
],
// Item tools
'tools' => [
- t('Post/Comment Tools'),
- ['multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
- ['edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
- ['commtag', t('Tagging'), t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
- ['categories', t('Post Categories'), t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
- ['filing', t('Saved Folders'), t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
- ['dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
- ['star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
- ['ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
+ L10n::t('Post/Comment Tools'),
+ ['multi_delete', L10n::t('Multiple Deletion'), L10n::t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
+ ['edit_posts', L10n::t('Edit Sent Posts'), L10n::t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
+ ['commtag', L10n::t('Tagging'), L10n::t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
+ ['categories', L10n::t('Post Categories'), L10n::t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
+ ['filing', L10n::t('Saved Folders'), L10n::t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
+ ['dislike', L10n::t('Dislike Posts'), L10n::t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
+ ['star_posts', L10n::t('Star Posts'), L10n::t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
+ ['ignore_posts', L10n::t('Mute Post Notifications'), L10n::t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
],
// Advanced Profile Settings
'advanced_profile' => [
- t('Advanced Profile Settings'),
- ['forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
- ['tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
+ L10n::t('Advanced Profile Settings'),
+ ['forumlist_profile', L10n::t('List Forums'), L10n::t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
+ ['tagadelic', L10n::t('Tag Cloud'), L10n::t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
],
];
use Friendica\App;
use Friendica\Content\Feature;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use dba;
$o .= replace_macros(
$tpl,
[
- '$title' => t('Forums'),
+ '$title' => L10n::t('Forums'),
'$forums' => $entries,
- '$link_desc' => t('External link to forum'),
+ '$link_desc' => L10n::t('External link to forum'),
'$total' => $total,
'$visible_forums' => $visible_forums,
- '$showmore' => t('show more')]
+ '$showmore' => L10n::t('show more')]
);
}
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
require_once 'boot.php';
require_once 'dba.php';
-require_once 'include/pgettext.php';
require_once 'include/text.php';
class Nav
'$sitelocation' => $nav_info['sitelocation'],
'$nav' => $nav_info['nav'],
'$banner' => $nav_info['banner'],
- '$emptynotifications' => t('Nothing new here'),
+ '$emptynotifications' => L10n::t('Nothing new here'),
'$userinfo' => $nav_info['userinfo'],
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
- '$clear_notifs' => t('Clear notifications'),
- '$search_hint' => t('@name, !forum, #tags, content')
+ '$clear_notifs' => L10n::t('Clear notifications'),
+ '$search_hint' => L10n::t('@name, !forum, #tags, content')
]);
Addon::callHooks('page_header', $a->page['nav']);
$userinfo = null;
if (local_user()) {
- $nav['logout'] = ['logout', t('Logout'), '', t('End this session')];
+ $nav['logout'] = ['logout', L10n::t('Logout'), '', L10n::t('End this session')];
// user menu
- $nav['usermenu'][] = ['profile/' . $a->user['nickname'], t('Status'), '', t('Your posts and conversations')];
- $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), '', t('Your profile page')];
- $nav['usermenu'][] = ['photos/' . $a->user['nickname'], t('Photos'), '', t('Your photos')];
- $nav['usermenu'][] = ['videos/' . $a->user['nickname'], t('Videos'), '', t('Your videos')];
- $nav['usermenu'][] = ['events/', t('Events'), '', t('Your events')];
- $nav['usermenu'][] = ['notes/', t('Personal notes'), '', t('Your personal notes')];
+ $nav['usermenu'][] = ['profile/' . $a->user['nickname'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
+ $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
+ $nav['usermenu'][] = ['photos/' . $a->user['nickname'], L10n::t('Photos'), '', L10n::t('Your photos')];
+ $nav['usermenu'][] = ['videos/' . $a->user['nickname'], L10n::t('Videos'), '', L10n::t('Your videos')];
+ $nav['usermenu'][] = ['events/', L10n::t('Events'), '', L10n::t('Your events')];
+ $nav['usermenu'][] = ['notes/', L10n::t('Personal notes'), '', L10n::t('Your personal notes')];
// user info
$contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
'name' => $a->user['username'],
];
} else {
- $nav['login'] = ['login', t('Login'), ($a->module == 'login' ? 'selected' : ''), t('Sign in')];
+ $nav['login'] = ['login', L10n::t('Login'), ($a->module == 'login' ? 'selected' : ''), L10n::t('Sign in')];
}
// "Home" should also take you home from an authenticated remote profile connection
}
if (($a->module != 'home') && (! (local_user()))) {
- $nav['home'] = [$homelink, t('Home'), '', t('Home Page')];
+ $nav['home'] = [$homelink, L10n::t('Home'), '', L10n::t('Home Page')];
}
if (($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) {
- $nav['register'] = ['register', t('Register'), '', t('Create an account')];
+ $nav['register'] = ['register', L10n::t('Register'), '', L10n::t('Create an account')];
}
$help_url = 'help';
if (!Config::get('system', 'hide_help')) {
- $nav['help'] = [$help_url, t('Help'), '', t('Help and documentation')];
+ $nav['help'] = [$help_url, L10n::t('Help'), '', L10n::t('Help and documentation')];
}
if (count($a->apps) > 0) {
- $nav['apps'] = ['apps', t('Apps'), '', t('Addon applications, utilities, games')];
+ $nav['apps'] = ['apps', L10n::t('Apps'), '', L10n::t('Addon applications, utilities, games')];
}
if (local_user() || !Config::get('system', 'local_search')) {
- $nav['search'] = ['search', t('Search'), '', t('Search site content')];
+ $nav['search'] = ['search', L10n::t('Search'), '', L10n::t('Search site content')];
$nav['searchoption'] = [
- t('Full Text'),
- t('Tags'),
- t('Contacts')
+ L10n::t('Full Text'),
+ L10n::t('Tags'),
+ L10n::t('Contacts')
];
if (Config::get('system', 'poco_local_search')) {
- $nav['searchoption'][] = t('Forums');
+ $nav['searchoption'][] = L10n::t('Forums');
}
}
}
if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) {
- $nav['community'] = ['community', t('Community'), '', t('Conversations on this and other servers')];
+ $nav['community'] = ['community', L10n::t('Community'), '', L10n::t('Conversations on this and other servers')];
}
if (local_user()) {
- $nav['events'] = ['events', t('Events'), '', t('Events and Calendar')];
+ $nav['events'] = ['events', L10n::t('Events'), '', L10n::t('Events and Calendar')];
}
- $nav['directory'] = [$gdirpath, t('Directory'), '', t('People directory')];
+ $nav['directory'] = [$gdirpath, L10n::t('Directory'), '', L10n::t('People directory')];
- $nav['about'] = ['friendica', t('Information'), '', t('Information about this friendica instance')];
+ $nav['about'] = ['friendica', L10n::t('Information'), '', L10n::t('Information about this friendica instance')];
// The following nav links are only show to logged in users
if (local_user()) {
- $nav['network'] = ['network', t('Network'), '', t('Conversations from your friends')];
- $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', t('Network Reset'), '', t('Load Network page with no filters')];
+ $nav['network'] = ['network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
+ $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', L10n::t('Network Reset'), '', L10n::t('Load Network page with no filters')];
- $nav['home'] = ['profile/' . $a->user['nickname'], t('Home'), '', t('Your posts and conversations')];
+ $nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')];
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_PRVGROUP])) {
// only show friend requests for normal pages. Other page types have automatic friendship.
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_PRVGROUP])) {
- $nav['introductions'] = ['notifications/intros', t('Introductions'), '', t('Friend Requests')];
+ $nav['introductions'] = ['notifications/intros', L10n::t('Introductions'), '', L10n::t('Friend Requests')];
}
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
- $nav['notifications'] = ['notifications', t('Notifications'), '', t('Notifications')];
- $nav['notifications']['all'] = ['notifications/system', t('See all notifications'), '', ''];
- $nav['notifications']['mark'] = ['', t('Mark as seen'), '', t('Mark all system notifications seen')];
+ $nav['notifications'] = ['notifications', L10n::t('Notifications'), '', L10n::t('Notifications')];
+ $nav['notifications']['all'] = ['notifications/system', L10n::t('See all notifications'), '', ''];
+ $nav['notifications']['mark'] = ['', L10n::t('Mark as seen'), '', L10n::t('Mark all system notifications seen')];
}
}
- $nav['messages'] = ['message', t('Messages'), '', t('Private mail')];
- $nav['messages']['inbox'] = ['message', t('Inbox'), '', t('Inbox')];
- $nav['messages']['outbox'] = ['message/sent', t('Outbox'), '', t('Outbox')];
- $nav['messages']['new'] = ['message/new', t('New Message'), '', t('New Message')];
+ $nav['messages'] = ['message', L10n::t('Messages'), '', L10n::t('Private mail')];
+ $nav['messages']['inbox'] = ['message', L10n::t('Inbox'), '', L10n::t('Inbox')];
+ $nav['messages']['outbox'] = ['message/sent', L10n::t('Outbox'), '', L10n::t('Outbox')];
+ $nav['messages']['new'] = ['message/new', L10n::t('New Message'), '', L10n::t('New Message')];
if (is_array($a->identities) && count($a->identities) > 1) {
- $nav['manage'] = ['manage', t('Manage'), '', t('Manage other pages')];
+ $nav['manage'] = ['manage', L10n::t('Manage'), '', L10n::t('Manage other pages')];
}
- $nav['delegations'] = ['delegate', t('Delegations'), '', t('Delegate Page Management')];
+ $nav['delegations'] = ['delegate', L10n::t('Delegations'), '', L10n::t('Delegate Page Management')];
- $nav['settings'] = ['settings', t('Settings'), '', t('Account settings')];
+ $nav['settings'] = ['settings', L10n::t('Settings'), '', L10n::t('Account settings')];
if (Feature::isEnabled(local_user(), 'multi_profiles')) {
- $nav['profiles'] = ['profiles', t('Profiles'), '', t('Manage/Edit Profiles')];
+ $nav['profiles'] = ['profiles', L10n::t('Profiles'), '', L10n::t('Manage/Edit Profiles')];
}
- $nav['contacts'] = ['contacts', t('Contacts'), '', t('Manage/edit friends and contacts')];
+ $nav['contacts'] = ['contacts', L10n::t('Contacts'), '', L10n::t('Manage/edit friends and contacts')];
}
// Show the link to the admin configuration page if user is admin
if (is_site_admin()) {
- $nav['admin'] = ['admin/', t('Admin'), '', t('Site setup and configuration')];
+ $nav['admin'] = ['admin/', L10n::t('Admin'), '', L10n::t('Site setup and configuration')];
}
- $nav['navigation'] = ['navigation/', t('Navigation'), '', t('Site map')];
+ $nav['navigation'] = ['navigation/', L10n::t('Navigation'), '', L10n::t('Site map')];
// Provide a banner/logo/whatever
$banner = Config::get('system', 'banner');
<?php
-
/**
* @file src/Content/OEmbed.php
*/
-
namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Database\DBM;
{
$stopoembed = Config::get("system", "no_oembed");
if ($stopoembed == true) {
- return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text);
+ return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . L10n::t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text);
}
return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", ['self', 'replaceCallback'], $text);
}
$width = '100%';
$src = System::baseUrl() . '/oembed/' . base64url_encode($src);
- return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . t('Embedded content') . '</iframe>';
+ return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . L10n::t('Embedded content') . '</iframe>';
}
/**
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
public static function follow($value = "")
{
return replace_macros(get_markup_template('follow.tpl'), array(
- '$connect' => t('Add New Contact'),
- '$desc' => t('Enter address or web location'),
- '$hint' => t('Example: bob@example.com, http://example.com/barbara'),
+ '$connect' => L10n::t('Add New Contact'),
+ '$desc' => L10n::t('Enter address or web location'),
+ '$hint' => L10n::t('Example: bob@example.com, http://example.com/barbara'),
'$value' => $value,
- '$follow' => t('Connect')
+ '$follow' => L10n::t('Connect')
));
}
$x = PConfig::get(local_user(), 'system', 'invites_remaining');
if ($x || is_site_admin()) {
$a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
- . tt('%d invitation available', '%d invitations available', $x)
+ . L10n::tt('%d invitation available', '%d invitations available', $x)
. '</div>' . $inv;
}
}
return replace_macros(get_markup_template('peoplefind.tpl'), array(
- '$findpeople' => t('Find People'),
- '$desc' => t('Enter name or interest'),
- '$label' => t('Connect/Follow'),
- '$hint' => t('Examples: Robert Morgenstein, Fishing'),
- '$findthem' => t('Find'),
- '$suggest' => t('Friend Suggestions'),
- '$similar' => t('Similar Interests'),
- '$random' => t('Random Profile'),
- '$inv' => t('Invite Friends'),
- '$directory' => t('View Global Directory'),
+ '$findpeople' => L10n::t('Find People'),
+ '$desc' => L10n::t('Enter name or interest'),
+ '$label' => L10n::t('Connect/Follow'),
+ '$hint' => L10n::t('Examples: Robert Morgenstein, Fishing'),
+ '$findthem' => L10n::t('Find'),
+ '$suggest' => L10n::t('Friend Suggestions'),
+ '$similar' => L10n::t('Similar Interests'),
+ '$random' => L10n::t('Random Profile'),
+ '$inv' => L10n::t('Invite Friends'),
+ '$directory' => L10n::t('View Global Directory'),
'$global_dir' => $global_dir
));
}
}
return replace_macros(get_markup_template('nets.tpl'), array(
- '$title' => t('Networks'),
+ '$title' => L10n::t('Networks'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
- '$all' => t('All Networks'),
+ '$all' => L10n::t('All Networks'),
'$nets' => $nets,
'$base' => $baseurl,
));
}
return replace_macros(get_markup_template('fileas_widget.tpl'), array(
- '$title' => t('Saved Folders'),
+ '$title' => L10n::t('Saved Folders'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
- '$all' => t('Everything'),
+ '$all' => L10n::t('Everything'),
'$terms' => $terms,
'$base' => $baseurl,
));
}
return replace_macros(get_markup_template('categories_widget.tpl'), array(
- '$title' => t('Categories'),
+ '$title' => L10n::t('Categories'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
- '$all' => t('Everything'),
+ '$all' => L10n::t('Everything'),
'$terms' => $terms,
'$base' => $baseurl,
));
}
return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
- '$desc' => tt("%d contact in common", "%d contacts in common", $t),
+ '$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
'$base' => System::baseUrl(),
'$uid' => $profile_uid,
'$cid' => (($cid) ? $cid : '0'),
'$linkmore' => (($t > 5) ? 'true' : ''),
- '$more' => t('show more'),
+ '$more' => L10n::t('show more'),
'$items' => $r)
);
}
--- /dev/null
+<?php
+/**
+ * @file src/Core/L10n.php
+ */
+namespace Friendica\Core;
+
+use Friendica\Core\Config;
+use dba;
+
+require_once 'boot.php';
+require_once 'include/dba.php';
+
+/**
+ * Provide Languange, Translation, and Localisation functions to the application
+ * Localisation can be referred to by the numeronym L10N (as in: "L", followed by ten more letters, and then "N").
+ */
+class L10n
+{
+ /**
+ * @brief get the prefered language from the HTTP_ACCEPT_LANGUAGE header
+ */
+ public static function getBrowserLanguage()
+ {
+ $lang_list = [];
+
+ if (x($_SERVER, 'HTTP_ACCEPT_LANGUAGE')) {
+ // break up string into pieces (languages and q factors)
+ preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $lang_parse);
+
+ if (count($lang_parse[1])) {
+ // go through the list of prefered languages and add a generic language
+ // for sub-linguas (e.g. de-ch will add de) if not already in array
+ for ($i = 0; $i < count($lang_parse[1]); $i++) {
+ $lang_list[] = strtolower($lang_parse[1][$i]);
+ if (strlen($lang_parse[1][$i])>3) {
+ $dashpos = strpos($lang_parse[1][$i], '-');
+ if (!in_array(substr($lang_parse[1][$i], 0, $dashpos), $lang_list)) {
+ $lang_list[] = strtolower(substr($lang_parse[1][$i], 0, $dashpos));
+ }
+ }
+ }
+ }
+ }
+
+ // check if we have translations for the preferred languages and pick the 1st that has
+ foreach ($lang_list as $lang) {
+ if ($lang === 'en' || (file_exists("view/lang/$lang") && is_dir("view/lang/$lang"))) {
+ $preferred = $lang;
+ break;
+ }
+ }
+ if (isset($preferred)) {
+ return $preferred;
+ }
+
+ // in case none matches, get the system wide configured language, or fall back to English
+ return Config::get('system', 'language', 'en');
+ }
+
+ /**
+ * @param string $language language
+ */
+ public static function pushLang($language)
+ {
+ global $lang, $a;
+
+ $a->langsave = $lang;
+
+ if ($language === $lang) {
+ return;
+ }
+
+ if (isset($a->strings) && count($a->strings)) {
+ $a->stringsave = $a->strings;
+ }
+ $a->strings = [];
+ self::loadTranslationTable($language);
+ $lang = $language;
+ }
+
+ /**
+ * Pop language off the top of the stack
+ */
+ public static function popLang()
+ {
+ global $lang, $a;
+
+ if ($lang === $a->langsave) {
+ return;
+ }
+
+ if (isset($a->stringsave)) {
+ $a->strings = $a->stringsave;
+ } else {
+ $a->strings = [];
+ }
+
+ $lang = $a->langsave;
+ }
+
+ /**
+ * load string translation table for alternate language
+ *
+ * first addon strings are loaded, then globals
+ *
+ * @param string $lang language code to load
+ */
+ public static function loadTranslationTable($lang)
+ {
+ $a = get_app();
+
+ $a->strings = [];
+ // load enabled addons strings
+ $addons = dba::select('addon', ['name'], ['installed' => true]);
+ while ($p = dba::fetch($addons)) {
+ $name = $p['name'];
+ if (file_exists("addon/$name/lang/$lang/strings.php")) {
+ include "addon/$name/lang/$lang/strings.php";
+ }
+ }
+
+ if (file_exists("view/lang/$lang/strings.php")) {
+ include "view/lang/$lang/strings.php";
+ }
+ }
+
+ /**
+ * @brief Return the localized version of the provided string with optional string interpolation
+ *
+ * This function takes a english string as parameter, and if a localized version
+ * exists for the current language, substitutes it before performing an eventual
+ * string interpolation (sprintf) with additional optional arguments.
+ *
+ * Usages:
+ * - L10n::t('This is an example')
+ * - L10n::t('URL %s returned no result', $url)
+ * - L10n::t('Current version: %s, new version: %s', $current_version, $new_version)
+ *
+ * @param string $s
+ * @return string
+ */
+ public static function t($s)
+ {
+ $a = get_app();
+
+ if (x($a->strings, $s)) {
+ $t = $a->strings[$s];
+ $s = is_array($t) ? $t[0] : $t;
+ }
+ if (func_num_args() > 1) {
+ $args = array_slice(func_get_args(), 1);
+ $s = @vsprintf($s, $args);
+ }
+
+ return $s;
+ }
+
+ /**
+ * @brief Return the localized version of a singular/plural string with optional string interpolation
+ *
+ * This function takes two english strings as parameters, singular and plural, as
+ * well as a count. If a localized version exists for the current language, they
+ * are used instead. Discrimination between singular and plural is done using the
+ * localized function if any or the default one. Finally, a string interpolation
+ * is performed using the count as parameter.
+ *
+ * Usages:
+ * - L10n::tt('Like', 'Likes', $count)
+ * - L10n::tt("%s user deleted", "%s users deleted", count($users))
+ *
+ * @global type $lang
+ * @param string $singular
+ * @param string $plural
+ * @param int $count
+ * @return string
+ */
+ public static function tt($singular, $plural, $count)
+ {
+ global $lang;
+ $a = get_app();
+
+ if (x($a->strings, $singular)) {
+ $t = $a->strings[$singular];
+ if (is_array($t)) {
+ $plural_function = 'string_plural_select_' . str_replace('-', '_', $lang);
+ if (function_exists($plural_function)) {
+ $i = $plural_function($count);
+ } else {
+ $i = self::stringPluralSelectDefault($count);
+ }
+ $s = $t[$i];
+ } else {
+ $s = $t;
+ }
+ } elseif (self::stringPluralSelectDefault($count)) {
+ $s = $plural;
+ } else {
+ $s = $singular;
+ }
+
+ $s = @sprintf($s, $count);
+
+ return $s;
+ }
+
+ /**
+ * Provide a fallback which will not collide with a function defined in any language file
+ */
+ private static function stringPluralSelectDefault($n)
+ {
+ return $n != 1;
+ }
+
+
+
+ /**
+ * @brief Return installed languages codes as associative array
+ *
+ * Scans the view/lang directory for the existence of "strings.php" files, and
+ * returns an alphabetical list of their folder names (@-char language codes).
+ * Adds the english language if it's missing from the list.
+ *
+ * Ex: array('de' => 'de', 'en' => 'en', 'fr' => 'fr', ...)
+ *
+ * @return array
+ */
+ public static function getAvailableLanguages()
+ {
+ $langs = [];
+ $strings_file_paths = glob('view/lang/*/strings.php');
+
+ if (is_array($strings_file_paths) && count($strings_file_paths)) {
+ if (!in_array('view/lang/en/strings.php', $strings_file_paths)) {
+ $strings_file_paths[] = 'view/lang/en/strings.php';
+ }
+ asort($strings_file_paths);
+ foreach ($strings_file_paths as $strings_file_path) {
+ $path_array = explode('/', $strings_file_path);
+ $langs[$path_array[2]] = $path_array[2];
+ }
+ }
+ return $langs;
+ }
+}
<?php
-
/**
* @file src/Core/NotificationsManager.php
* @brief Methods for read and write notifications from/to database
* or for formatting notifications
*/
-
namespace Friendica\Core;
use Friendica\BaseObject;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
{
$tabs = [
[
- 'label' => t('System'),
+ 'label' => L10n::t('System'),
'url' => 'notifications/system',
'sel' => ((self::getApp()->argv[1] == 'system') ? 'active' : ''),
'id' => 'system-tab',
'accesskey' => 'y',
],
[
- 'label' => t('Network'),
+ 'label' => L10n::t('Network'),
'url' => 'notifications/network',
'sel' => ((self::getApp()->argv[1] == 'network') ? 'active' : ''),
'id' => 'network-tab',
'accesskey' => 'w',
],
[
- 'label' => t('Personal'),
+ 'label' => L10n::t('Personal'),
'url' => 'notifications/personal',
'sel' => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''),
'id' => 'personal-tab',
'accesskey' => 'r',
],
[
- 'label' => t('Home'),
+ 'label' => L10n::t('Home'),
'url' => 'notifications/home',
'sel' => ((self::getApp()->argv[1] == 'home') ? 'active' : ''),
'id' => 'home-tab',
'accesskey' => 'h',
],
[
- 'label' => t('Introductions'),
+ 'label' => L10n::t('Introductions'),
'url' => 'notifications/intros',
'sel' => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''),
'id' => 'intro-tab',
$default_item_link = System::baseUrl(true) . '/display/' . $it['pguid'];
$default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
$default_item_url = $it['author-link'];
- $default_item_text = sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']);
+ $default_item_text = L10n::t("%s commented on %s's post", $it['author-name'], $it['pname']);
$default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
$default_item_ago = relative_date($it['created']);
break;
$default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
$default_item_url = $it['author-link'];
$default_item_text = (($it['id'] == $it['parent'])
- ? sprintf(t("%s created a new post"), $it['author-name'])
- : sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']));
+ ? L10n::t("%s created a new post", $it['author-name'])
+ : L10n::t("%s commented on %s's post", $it['author-name'], $it['pname']));
$default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
$default_item_ago = relative_date($it['created']);
}
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s liked %s's post"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s liked %s's post", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s disliked %s's post"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s disliked %s's post", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s is attending %s's event"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s is attending %s's event", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s is not attending %s's event"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s is not attending %s's event", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s may attend %s's event"), $it['author-name'], $it['pname']),
+ 'text' => L10n::t("%s may attend %s's event", $it['author-name'], $it['pname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'],
- 'text' => sprintf(t("%s is now friends with %s"), $it['author-name'], $it['fname']),
+ 'text' => L10n::t("%s is now friends with %s", $it['author-name'], $it['fname']),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
$intro = [
'label' => 'friend_suggestion',
- 'notify_type' => t('Friend Suggestion'),
+ 'notify_type' => L10n::t('Friend Suggestion'),
'intro_id' => $it['intro_id'],
'madeby' => $it['name'],
'contact_id' => $it['contact-id'],
}
$intro = [
'label' => (($it['network'] !== NETWORK_OSTATUS) ? 'friend_request' : 'follower'),
- 'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')),
+ 'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? L10n::t('Friend/Connect Request') : L10n::t('New Follower')),
'dfrn_id' => $it['issued-id'],
'uid' => $_SESSION['uid'],
'intro_id' => $it['intro_id'],
namespace Friendica\Core;
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
$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;
}
$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;
}
if (DBM::is_result($r) > 0) {
- notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));
+ notice(L10n::t("User '%s' already exists on this server!", $account['user']['nickname']));
return;
}
$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;
}
if (DBM::is_result($r) > 0) {
- notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));
+ notice(L10n::t("User '%s' already exists on this server!", $account['user']['nickname']));
return;
}
$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();
$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;
}
}
}
if ($errorcount > 0) {
- notice(sprintf(tt("%d contact not imported", "%d contacts not imported", $errorcount), $errorcount));
+ notice(L10n::tt("%d contact not imported", "%d contacts not imported", $errorcount));
}
foreach ($account['group'] as &$group) {
// 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");
}
}
namespace Friendica\Database;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use dba;
-require_once "boot.php";
+require_once 'boot.php';
require_once 'include/dba.php';
require_once 'include/enotify.php';
-require_once "include/text.php";
+require_once 'include/text.php';
/**
* @brief This class contain functions for the database management
*
* This class contains functions that doesn't need to know if pdo, mysqli or whatever is used.
*/
-class DBStructure {
+class DBStructure
+{
/*
* Converts all tables from MyISAM to InnoDB
*/
dbesc(dba::database_name()));
if (!DBM::is_result($r)) {
- echo t('There are no tables on MyISAM.')."\n";
+ echo L10n::t('There are no tables on MyISAM.')."\n";
return;
}
// every admin could had different language
foreach ($adminlist as $admin) {
$lang = (($admin['language'])?$admin['language']:'en');
- push_lang($lang);
+ L10n::pushLang($lang);
- $preamble = deindent(t("
+ $preamble = deindent(L10n::t("
The friendica developers released update %s recently,
but when I tried to install it, something went terribly wrong.
This needs to be fixed soon and I can't do it alone. Please contact a
friendica developer if you can not help me on your own. My database might be invalid."));
- $body = t("The error message is\n[pre]%s[/pre]");
+ $body = L10n::t("The error message is\n[pre]%s[/pre]");
$preamble = sprintf($preamble, $update_id);
$body = sprintf($body, $error_message);
* @return string Error message
*/
private static function printUpdateError($message) {
- echo sprintf(t("\nError %d occurred during database update:\n%s\n"),
+ echo L10n::t("\nError %d occurred during database update:\n%s\n",
dba::errorNo(), dba::errorMessage());
- return t('Errors encountered performing database changes: ').$message.EOL;
+ return L10n::t('Errors encountered performing database changes: ').$message.EOL;
}
/**
public static function update($verbose, $action, array $tables = null, array $definition = null) {
if ($action) {
Config::set('system', 'maintenance', 1);
- Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e')));
+ Config::set('system', 'maintenance_reason', L10n::t(': Database update', DBM::date().' '.date('e')));
}
$errors = '';
}
if ($action) {
- Config::set('system', 'maintenance_reason', sprintf(t('%s: updating %s table.'), DBM::date().' '.date('e'), $name));
+ Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DBM::date().' '.date('e'), $name));
// Ensure index conversion to unique removes duplicates
if ($is_unique && ($temp_name != $name)) {
use Friendica\BaseObject;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Core\Worker;
if ($contact['uid'] != $uid) {
if ($uid == 0) {
$profile_link = Profile::zrl($contact['url']);
- $menu = ['profile' => [t('View Profile'), $profile_link, true]];
+ $menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]];
return $menu;
}
$profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url'];
$menu = [
- 'profile' => [t('View Profile'), $profile_link, true],
- 'follow' => [t('Connect/Follow'), $connlnk, true]
+ 'profile' => [L10n::t('View Profile'), $profile_link, true],
+ 'follow' => [L10n::t('Connect/Follow'), $connlnk, true]
];
return $menu;
* "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ]
*/
$menu = [
- 'status' => [t("View Status") , $status_link , true],
- 'profile' => [t("View Profile") , $profile_link , true],
- 'photos' => [t("View Photos") , $photos_link , true],
- 'network' => [t("Network Posts"), $posts_link , false],
- 'edit' => [t("View Contact") , $contact_url , false],
- 'drop' => [t("Drop Contact") , $contact_drop_link, false],
- 'pm' => [t("Send PM") , $pm_url , false],
- 'poke' => [t("Poke") , $poke_link , false],
+ 'status' => [L10n::t("View Status") , $status_link , true],
+ 'profile' => [L10n::t("View Profile") , $profile_link , true],
+ 'photos' => [L10n::t("View Photos") , $photos_link , true],
+ 'network' => [L10n::t("Network Posts"), $posts_link , false],
+ 'edit' => [L10n::t("View Contact") , $contact_url , false],
+ 'drop' => [L10n::t("Drop Contact") , $contact_drop_link, false],
+ 'pm' => [L10n::t("Send PM") , $pm_url , false],
+ 'poke' => [L10n::t("Poke") , $poke_link , false],
];
$args = ['contact' => $contact, 'menu' => &$menu];
switch ($type) {
case ACCOUNT_TYPE_ORGANISATION:
- $account_type = t("Organisation");
+ $account_type = L10n::t("Organisation");
break;
case ACCOUNT_TYPE_NEWS:
- $account_type = t('News');
+ $account_type = L10n::t('News');
break;
case ACCOUNT_TYPE_COMMUNITY:
- $account_type = t("Forum");
+ $account_type = L10n::t("Forum");
break;
default:
$account_type = "";
$url = str_replace('/#!/', '/', $url);
if (!allowed_url($url)) {
- $result['message'] = t('Disallowed profile URL.');
+ $result['message'] = L10n::t('Disallowed profile URL.');
return $result;
}
if (blocked_url($url)) {
- $result['message'] = t('Blocked domain');
+ $result['message'] = L10n::t('Blocked domain');
return $result;
}
if (!$url) {
- $result['message'] = t('Connect URL missing.');
+ $result['message'] = L10n::t('Connect URL missing.');
return $result;
}
// NOTREACHED
}
} elseif (Config::get('system', 'dfrn_only')) {
- $result['message'] = t('This site is not configured to allow communications with other networks.') . EOL;
- $result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL;
+ $result['message'] = L10n::t('This site is not configured to allow communications with other networks.') . EOL;
+ $result['message'] != L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result;
}
// do we have enough information?
if (!((x($ret, 'name')) && (x($ret, 'poll')) && ((x($ret, 'url')) || (x($ret, 'addr'))))) {
- $result['message'] .= t('The profile address specified does not provide adequate information.') . EOL;
+ $result['message'] .= L10n::t('The profile address specified does not provide adequate information.') . EOL;
if (!x($ret, 'poll')) {
- $result['message'] .= t('No compatible communication protocols or feeds were discovered.') . EOL;
+ $result['message'] .= L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
}
if (!x($ret, 'name')) {
- $result['message'] .= t('An author or name was not found.') . EOL;
+ $result['message'] .= L10n::t('An author or name was not found.') . EOL;
}
if (!x($ret, 'url')) {
- $result['message'] .= t('No browser URL could be matched to this address.') . EOL;
+ $result['message'] .= L10n::t('No browser URL could be matched to this address.') . EOL;
}
if (strpos($url, '@') !== false) {
- $result['message'] .= t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
- $result['message'] .= t('Use mailto: in front of address to force email check.') . EOL;
+ $result['message'] .= L10n::t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
+ $result['message'] .= L10n::t('Use mailto: in front of address to force email check.') . EOL;
}
return $result;
}
if ($ret['network'] === NETWORK_OSTATUS && Config::get('system', 'ostatus_disabled')) {
- $result['message'] .= t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
+ $result['message'] .= L10n::t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
$ret['notify'] = '';
}
if (!$ret['notify']) {
- $result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
+ $result['message'] .= L10n::t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
}
$writeable = ((($ret['network'] === NETWORK_OSTATUS) && ($ret['notify'])) ? 1 : 0);
$contact = dba::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
if (!DBM::is_result($contact)) {
- $result['message'] .= t('Unable to retrieve contact information.') . EOL;
+ $result['message'] .= L10n::t('Unable to retrieve contact information.') . EOL;
return $result;
}
<?php
-
/**
* @file src/Model/Group.php
*/
-
namespace Friendica\Model;
+use Friendica\Core\L10n;
use Friendica\BaseObject;
use Friendica\Database\DBM;
use dba;
$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;
}
logger('groups: ' . print_r($display_groups, true));
if ($label == '') {
- $label = t('Default privacy group for new contacts');
+ $label = L10n::t('Default privacy group for new contacts');
}
$o = replace_macros(get_markup_template('group_selection.tpl'), [
$display_groups = [
[
- 'text' => t('Everybody'),
+ 'text' => L10n::t('Everybody'),
'id' => 0,
'selected' => (($group_id == 0) ? 'group-selected' : ''),
'href' => $every,
if ($editmode == 'full') {
$groupedit = [
'href' => 'group/' . $group['id'],
- 'title' => t('edit'),
+ 'title' => L10n::t('edit'),
];
} else {
$groupedit = null;
$tpl = get_markup_template('group_side.tpl');
$o = replace_macros($tpl, [
- '$add' => t('add'),
- '$title' => t('Groups'),
+ '$add' => L10n::t('add'),
+ '$title' => L10n::t('Groups'),
'$groups' => $display_groups,
'newgroup' => $editmode == 'extended' || $editmode == 'full' ? 1 : '',
'grouppage' => 'group/',
- '$edittext' => t('Edit group'),
- '$ungrouped' => $every === 'contacts' ? t('Contacts not in any group') : '',
- '$createtext' => t('Create a new group'),
- '$creategroup' => t('Group Name: '),
- '$editgroupstext' => t('Edit groups'),
+ '$edittext' => L10n::t('Edit group'),
+ '$ungrouped' => $every === 'contacts' ? L10n::t('Contacts not in any group') : '',
+ '$createtext' => L10n::t('Create a new group'),
+ '$creategroup' => L10n::t('Group Name: '),
+ '$editgroupstext' => L10n::t('Edit groups'),
'$form_security_token' => get_form_security_token('group_edit'),
]);
namespace Friendica\Model;
use Friendica\App;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
}
if (!strlen($subject)) {
- $subject = t('[no subject]');
+ $subject = L10n::t('[no subject]');
}
$me = dba::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
}
if (!strlen($subject)) {
- $subject = t('[no subject]');
+ $subject = L10n::t('[no subject]');
}
$guid = get_guid(32);
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);
/**
* @file src/Model/Profile.php
*/
-
namespace Friendica\Model;
use Friendica\App;
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;
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;
}
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;
}
$a->page['aside'] .= replace_macros(
get_markup_template('profile_edlink.tpl'),
[
- '$editprofile' => t('Edit profile'),
+ '$editprofile' => L10n::t('Edit profile'),
'$profid' => $a->profile['id']
]
);
// don't show connect link to yourself
- $connect = $profile['uid'] != local_user() ? t('Connect') : false;
+ $connect = $profile['uid'] != local_user() ? L10n::t('Connect') : false;
// don't show connect link to authenticated visitors either
if (remote_user() && count($_SESSION['remote'])) {
}
if ($connect && ($profile['network'] == NETWORK_DFRN) && !isset($remoteconnect)) {
- $subscribe_feed = t('Atom feed');
+ $subscribe_feed = L10n::t('Atom feed');
} else {
$subscribe_feed = false;
}
if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
- $wallmessage = t('Message');
+ $wallmessage = L10n::t('Message');
$wallmessage_link = 'wallmessage/' . $profile['nickname'];
if (remote_user()) {
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) {
- $profile['edit'] = [System::baseUrl() . '/profiles', t('Profiles'), '', t('Manage/edit profiles')];
+ $profile['edit'] = [System::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
$r = q(
"SELECT * FROM `profile` WHERE `uid` = %d",
local_user()
);
$profile['menu'] = [
- 'chg_photo' => t('Change profile photo'),
- 'cr_new' => t('Create New Profile'),
+ 'chg_photo' => L10n::t('Change profile photo'),
+ 'cr_new' => L10n::t('Create New Profile'),
'entries' => [],
];
$profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
'id' => $rr['id'],
- 'alt' => t('Profile Image'),
+ 'alt' => L10n::t('Profile Image'),
'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'],
- 'visibile_to_everybody' => t('visible to everybody'),
- 'edit_visibility' => t('Edit visibility'),
+ 'visibile_to_everybody' => L10n::t('visible to everybody'),
+ 'edit_visibility' => L10n::t('Edit visibility'),
];
}
}
}
if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) {
- $profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], t('Edit profile'), '', t('Edit profile')];
+ $profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
$profile['menu'] = [
- 'chg_photo' => t('Change profile photo'),
+ 'chg_photo' => L10n::t('Change profile photo'),
'cr_new' => null,
'entries' => [],
];
|| x($profile, 'postal-code')
|| x($profile, 'country-name')
) {
- $location = t('Location:');
+ $location = L10n::t('Location:');
}
- $gender = x($profile, 'gender') ? t('Gender:') : false;
- $marital = x($profile, 'marital') ? t('Status:') : false;
- $homepage = x($profile, 'homepage') ? t('Homepage:') : false;
- $about = x($profile, 'about') ? t('About:') : false;
- $xmpp = x($profile, 'xmpp') ? t('XMPP:') : false;
+ $gender = x($profile, 'gender') ? L10n::t('Gender:') : false;
+ $marital = x($profile, 'marital') ? L10n::t('Status:') : false;
+ $homepage = x($profile, 'homepage') ? L10n::t('Homepage:') : false;
+ $about = x($profile, 'about') ? L10n::t('About:') : false;
+ $xmpp = x($profile, 'xmpp') ? L10n::t('XMPP:') : false;
if ((x($profile, 'hidewall') || $block) && !local_user() && !remote_user()) {
$location = $gender = $marital = $homepage = $about = false;
'$marital' => $marital,
'$homepage' => $homepage,
'$about' => $about,
- '$network' => t('Network:'),
+ '$network' => L10n::t('Network:'),
'$contacts' => $contacts,
'$updated' => $updated,
'$diaspora' => $diaspora,
* return $o;
*/
- $bd_format = t('g A l F d'); // 8 AM Friday January 18
- $bd_short = t('F d');
+ $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
+ $bd_short = L10n::t('F d');
$cachekey = 'get_birthdays:' . local_user();
$r = Cache::get($cachekey);
$rr['link'] = $url;
$rr['title'] = $rr['name'];
- $rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . t('[today]') : '');
+ $rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = null;
$rr['today'] = $today;
}
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => $total,
- '$event_reminders' => t('Birthday Reminders'),
- '$event_title' => t('Birthdays this week:'),
+ '$event_reminders' => L10n::t('Birthday Reminders'),
+ '$event_title' => L10n::t('Birthdays this week:'),
'$events' => $r,
'$lbr' => '{', // raw brackets mess up if/endif macro processing
'$rbr' => '}'
* return $o;
*/
- $bd_format = t('g A l F d'); // 8 AM Friday January 18
+ $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
$classtoday = '';
$s = dba::p(
$description = substr(strip_tags(bbcode($rr['desc'])), 0, 32) . '... ';
if (!$description) {
- $description = t('[No description]');
+ $description = L10n::t('[No description]');
}
$strt = datetime_convert('UTC', $rr['convert'] ? $a->timezone : 'UTC', $rr['start']);
$rr['title'] = $title;
$rr['description'] = $description;
- $rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : '');
+ $rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = $strt;
$rr['today'] = $today;
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => count($r),
- '$event_reminders' => t('Event Reminders'),
- '$event_title' => t('Events this week:'),
+ '$event_reminders' => L10n::t('Event Reminders'),
+ '$event_title' => L10n::t('Events this week:'),
'$events' => $r,
]);
}
$o .= replace_macros(
get_markup_template('section_title.tpl'),
- ['$title' => t('Profile')]
+ ['$title' => L10n::t('Profile')]
);
if ($a->profile['name']) {
$profile = [];
- $profile['fullname'] = [t('Full Name:'), $a->profile['name']];
+ $profile['fullname'] = [L10n::t('Full Name:'), $a->profile['name']];
if ($a->profile['gender']) {
- $profile['gender'] = [t('Gender:'), $a->profile['gender']];
+ $profile['gender'] = [L10n::t('Gender:'), $a->profile['gender']];
}
if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
- $year_bd_format = t('j F, Y');
- $short_bd_format = t('j F');
+ $year_bd_format = L10n::t('j F, Y');
+ $short_bd_format = L10n::t('j F');
$val = intval($a->profile['dob']) ?
day_translate(datetime_convert('UTC', 'UTC', $a->profile['dob'] . ' 00:00 +00:00', $year_bd_format))
: day_translate(datetime_convert('UTC', 'UTC', '2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format));
- $profile['birthday'] = [t('Birthday:'), $val];
+ $profile['birthday'] = [L10n::t('Birthday:'), $val];
}
if (!empty($a->profile['dob'])
&& $a->profile['dob'] > '0001-01-01'
&& $age = age($a->profile['dob'], $a->profile['timezone'], '')
) {
- $profile['age'] = [t('Age:'), $age];
+ $profile['age'] = [L10n::t('Age:'), $age];
}
if ($a->profile['marital']) {
- $profile['marital'] = [t('Status:'), $a->profile['marital']];
+ $profile['marital'] = [L10n::t('Status:'), $a->profile['marital']];
}
/// @TODO Maybe use x() here, plus below?
}
if (strlen($a->profile['howlong']) && $a->profile['howlong'] >= NULL_DATE) {
- $profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s'));
+ $profile['howlong'] = relative_date($a->profile['howlong'], L10n::t('for %1$d %2$s'));
}
if ($a->profile['sexual']) {
- $profile['sexual'] = [t('Sexual Preference:'), $a->profile['sexual']];
+ $profile['sexual'] = [L10n::t('Sexual Preference:'), $a->profile['sexual']];
}
if ($a->profile['homepage']) {
- $profile['homepage'] = [t('Homepage:'), linkify($a->profile['homepage'])];
+ $profile['homepage'] = [L10n::t('Homepage:'), linkify($a->profile['homepage'])];
}
if ($a->profile['hometown']) {
- $profile['hometown'] = [t('Hometown:'), linkify($a->profile['hometown'])];
+ $profile['hometown'] = [L10n::t('Hometown:'), linkify($a->profile['hometown'])];
}
if ($a->profile['pub_keywords']) {
- $profile['pub_keywords'] = [t('Tags:'), $a->profile['pub_keywords']];
+ $profile['pub_keywords'] = [L10n::t('Tags:'), $a->profile['pub_keywords']];
}
if ($a->profile['politic']) {
- $profile['politic'] = [t('Political Views:'), $a->profile['politic']];
+ $profile['politic'] = [L10n::t('Political Views:'), $a->profile['politic']];
}
if ($a->profile['religion']) {
- $profile['religion'] = [t('Religion:'), $a->profile['religion']];
+ $profile['religion'] = [L10n::t('Religion:'), $a->profile['religion']];
}
if ($txt = prepare_text($a->profile['about'])) {
- $profile['about'] = [t('About:'), $txt];
+ $profile['about'] = [L10n::t('About:'), $txt];
}
if ($txt = prepare_text($a->profile['interest'])) {
- $profile['interest'] = [t('Hobbies/Interests:'), $txt];
+ $profile['interest'] = [L10n::t('Hobbies/Interests:'), $txt];
}
if ($txt = prepare_text($a->profile['likes'])) {
- $profile['likes'] = [t('Likes:'), $txt];
+ $profile['likes'] = [L10n::t('Likes:'), $txt];
}
if ($txt = prepare_text($a->profile['dislikes'])) {
- $profile['dislikes'] = [t('Dislikes:'), $txt];
+ $profile['dislikes'] = [L10n::t('Dislikes:'), $txt];
}
if ($txt = prepare_text($a->profile['contact'])) {
- $profile['contact'] = [t('Contact information and Social Networks:'), $txt];
+ $profile['contact'] = [L10n::t('Contact information and Social Networks:'), $txt];
}
if ($txt = prepare_text($a->profile['music'])) {
- $profile['music'] = [t('Musical interests:'), $txt];
+ $profile['music'] = [L10n::t('Musical interests:'), $txt];
}
if ($txt = prepare_text($a->profile['book'])) {
- $profile['book'] = [t('Books, literature:'), $txt];
+ $profile['book'] = [L10n::t('Books, literature:'), $txt];
}
if ($txt = prepare_text($a->profile['tv'])) {
- $profile['tv'] = [t('Television:'), $txt];
+ $profile['tv'] = [L10n::t('Television:'), $txt];
}
if ($txt = prepare_text($a->profile['film'])) {
- $profile['film'] = [t('Film/dance/culture/entertainment:'), $txt];
+ $profile['film'] = [L10n::t('Film/dance/culture/entertainment:'), $txt];
}
if ($txt = prepare_text($a->profile['romance'])) {
- $profile['romance'] = [t('Love/Romance:'), $txt];
+ $profile['romance'] = [L10n::t('Love/Romance:'), $txt];
}
if ($txt = prepare_text($a->profile['work'])) {
- $profile['work'] = [t('Work/employment:'), $txt];
+ $profile['work'] = [L10n::t('Work/employment:'), $txt];
}
if ($txt = prepare_text($a->profile['education'])) {
- $profile['education'] = [t('School/education:'), $txt];
+ $profile['education'] = [L10n::t('School/education:'), $txt];
}
//show subcribed forum if it is enabled in the usersettings
if (Feature::isEnabled($uid, 'forumlist_profile')) {
- $profile['forumlist'] = [t('Forums:'), ForumManager::profileAdvanced($uid)];
+ $profile['forumlist'] = [L10n::t('Forums:'), ForumManager::profileAdvanced($uid)];
}
if ($a->profile['uid'] == local_user()) {
- $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], t('Edit profile'), '', t('Edit profile')];
+ $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
}
return replace_macros($tpl, [
- '$title' => t('Profile'),
- '$basic' => t('Basic'),
- '$advanced' => t('Advanced'),
+ '$title' => L10n::t('Profile'),
+ '$basic' => L10n::t('Basic'),
+ '$advanced' => L10n::t('Advanced'),
'$profile' => $profile
]);
}
$tabs = [
[
- 'label' => t('Status'),
+ 'label' => L10n::t('Status'),
'url' => $url,
'sel' => !$tab && $a->argv[0] == 'profile' ? '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' => $url . '/?tab=profile',
'sel' => $tab == 'profile' ? 'active' : '',
- 'title' => t('Profile Details'),
+ 'title' => L10n::t('Profile Details'),
'id' => 'profile-tab',
'accesskey' => 'r',
],
[
- 'label' => t('Photos'),
+ 'label' => L10n::t('Photos'),
'url' => System::baseUrl() . '/photos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'photos' ? 'active' : '',
- 'title' => t('Photo Albums'),
+ 'title' => L10n::t('Photo Albums'),
'id' => 'photo-tab',
'accesskey' => 'h',
],
[
- 'label' => t('Videos'),
+ 'label' => L10n::t('Videos'),
'url' => System::baseUrl() . '/videos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'videos' ? 'active' : '',
- 'title' => t('Videos'),
+ 'title' => L10n::t('Videos'),
'id' => 'video-tab',
'accesskey' => 'v',
],
// the calendar link for the full featured events calendar
if ($is_owner && $a->theme_events_in_profile) {
$tabs[] = [
- 'label' => t('Events'),
+ 'label' => L10n::t('Events'),
'url' => System::baseUrl() . '/events',
'sel' => !$tab && $a->argv[0] == 'events' ? 'active' : '',
- 'title' => t('Events and Calendar'),
+ 'title' => L10n::t('Events and Calendar'),
'id' => 'events-tab',
'accesskey' => 'e',
];
// with the public events of the calendar owner
} elseif (!$is_owner) {
$tabs[] = [
- 'label' => t('Events'),
+ 'label' => L10n::t('Events'),
'url' => System::baseUrl() . '/cal/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'cal' ? 'active' : '',
- 'title' => t('Events and Calendar'),
+ 'title' => L10n::t('Events and Calendar'),
'id' => 'events-tab',
'accesskey' => 'e',
];
if ($is_owner) {
$tabs[] = [
- 'label' => t('Personal Notes'),
+ 'label' => L10n::t('Personal Notes'),
'url' => System::baseUrl() . '/notes',
'sel' => !$tab && $a->argv[0] == 'notes' ? 'active' : '',
- 'title' => t('Only You Can See This'),
+ 'title' => L10n::t('Only You Can See This'),
'id' => 'notes-tab',
'accesskey' => 't',
];
if ((!$is_owner) && ((count($a->profile)) || (!$a->profile['hide-friends']))) {
$tabs[] = [
- 'label' => t('Contacts'),
+ 'label' => L10n::t('Contacts'),
'url' => System::baseUrl() . '/viewcontacts/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'viewcontacts' ? 'active' : '',
- 'title' => t('Contacts'),
+ 'title' => L10n::t('Contacts'),
'id' => 'viewcontacts-tab',
'accesskey' => 'k',
];
<?php
-
/**
* @file src/Model/User.php
* @brief This file includes the User class with user related database functions
*/
-
namespace Friendica\Model;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
require_once 'include/enotify.php';
require_once 'include/network.php';
require_once 'library/openid.php';
-require_once 'include/pgettext.php';
require_once 'include/text.php';
/**
* @brief This class handles User related functions
$netpublish = strlen(Config::get('system', 'directory')) ? $publish : 0;
if ($password1 != $confirm) {
- throw new Exception(t('Passwords do not match. Password unchanged.'));
+ throw new Exception(L10n::t('Passwords do not match. Password unchanged.'));
} elseif ($password1 != '') {
$password = $password1;
}
if ($using_invites) {
if (!$invite_id) {
- throw new Exception(t('An invitation is required.'));
+ throw new Exception(L10n::t('An invitation is required.'));
}
if (!dba::exists('register', ['hash' => $invite_id])) {
- throw new Exception(t('Invitation could not be verified.'));
+ throw new Exception(L10n::t('Invitation could not be verified.'));
}
}
if (!x($username) || !x($email) || !x($nickname)) {
if ($openid_url) {
if (!validate_url($openid_url)) {
- throw new Exception(t('Invalid OpenID url'));
+ throw new Exception(L10n::t('Invalid OpenID url'));
}
$_SESSION['register'] = 1;
$_SESSION['openid'] = $openid_url;
try {
$authurl = $openid->authUrl();
} catch (Exception $e) {
- throw new Exception(t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . t('The error message was:') . $e->getMessage(), 0, $e);
+ throw new Exception(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . L10n::t('The error message was:') . $e->getMessage(), 0, $e);
}
goaway($authurl);
// NOTREACHED
}
- throw new Exception(t('Please enter the required information.'));
+ throw new Exception(L10n::t('Please enter the required information.'));
}
if (!validate_url($openid_url)) {
$username = preg_replace('/ +/', ' ', $username);
if (mb_strlen($username) > 48) {
- throw new Exception(t('Please use a shorter name.'));
+ throw new Exception(L10n::t('Please use a shorter name.'));
}
if (mb_strlen($username) < 3) {
- throw new Exception(t('Name too short.'));
+ throw new Exception(L10n::t('Name too short.'));
}
// So now we are just looking for a space in the full name.
if (!$loose_reg) {
$username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8');
if (!strpos($username, ' ')) {
- throw new Exception(t("That doesn't appear to be your full \x28First Last\x29 name."));
+ throw new Exception(L10n::t("That doesn't appear to be your full \x28First Last\x29 name."));
}
}
if (!allowed_email($email)) {
- throw new Exception(t('Your email domain is not among those allowed on this site.'));
+ throw new Exception(L10n::t('Your email domain is not among those allowed on this site.'));
}
if (!valid_email($email) || !validate_email($email)) {
- throw new Exception(t('Not a valid email address.'));
+ throw new Exception(L10n::t('Not a valid email address.'));
}
if (dba::exists('user', ['email' => $email])) {
- throw new Exception(t('Cannot use that email.'));
+ throw new Exception(L10n::t('Cannot use that email.'));
}
// Disallow somebody creating an account using openid that uses the admin email address,
if (x($a->config, 'admin_email') && strlen($openid_url)) {
$adminlist = explode(',', str_replace(' ', '', strtolower($a->config['admin_email'])));
if (in_array(strtolower($email), $adminlist)) {
- throw new Exception(t('Cannot use that email.'));
+ throw new Exception(L10n::t('Cannot use that email.'));
}
}
$nickname = $data['nickname'] = strtolower($nickname);
if (!preg_match('/^[a-z0-9][a-z0-9\_]*$/', $nickname)) {
- throw new Exception(t('Your "nickname" can only contain "a-z", "0-9" and "_".'));
+ throw new Exception(L10n::t('Your "nickname" can only contain "a-z", "0-9" and "_".'));
}
// Check existing and deleted accounts for this nickname.
if (dba::exists('user', ['nickname' => $nickname])
|| dba::exists('userd', ['username' => $nickname])
) {
- throw new Exception(t('Nickname is already registered. Please choose another.'));
+ throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
}
$new_password = strlen($password) ? $password : User::generateNewPassword();
$keys = Crypto::newKeypair(4096);
if ($keys === false) {
- throw new Exception(t('SERIOUS ERROR: Generation of security keys failed.'));
+ throw new Exception(L10n::t('SERIOUS ERROR: Generation of security keys failed.'));
}
$prvkey = $keys['prvkey'];
$uid = dba::lastInsertId();
$user = dba::selectFirst('user', [], ['uid' => $uid]);
} else {
- throw new Exception(t('An error occurred during registration. Please try again.'));
+ throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
}
if (!$uid) {
- throw new Exception(t('An error occurred during registration. Please try again.'));
+ throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
}
// if somebody clicked submit twice very quickly, they could end up with two accounts
if ($user_count > 1) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('Nickname is already registered. Please choose another.'));
+ throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
}
$insert_result = dba::insert('profile', [
'publish' => $publish,
'is-default' => 1,
'net-publish' => $netpublish,
- 'profile-name' => t('default')
+ 'profile-name' => L10n::t('default')
]);
if (!$insert_result) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('An error occurred creating your default profile. Please try again.'));
+ throw new Exception(L10n::t('An error occurred creating your default profile. Please try again.'));
}
// Create the self contact
if (!Contact::createSelfFromUserId($uid)) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('An error occurred creating your self contact. Please try again.'));
+ throw new Exception(L10n::t('An error occurred creating your self contact. Please try again.'));
}
// Create a group with no members. This allows somebody to use it
// right away as a default group for new contacts.
- $def_gid = Group::create($uid, t('Friends'));
+ $def_gid = Group::create($uid, L10n::t('Friends'));
if (!$def_gid) {
dba::delete('user', ['uid' => $uid]);
- throw new Exception(t('An error occurred creating your default contact group. Please try again.'));
+ throw new Exception(L10n::t('An error occurred creating your default contact group. Please try again.'));
}
$fields = ['def_gid' => $def_gid];
$hash = photo_new_resource();
- $r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 4);
+ $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 4);
if ($r === false) {
$photo_failure = true;
$Image->scaleDown(80);
- $r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 5);
+ $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 5);
if ($r === false) {
$photo_failure = true;
$Image->scaleDown(48);
- $r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 6);
+ $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 6);
if ($r === false) {
$photo_failure = true;
*/
public static function sendRegisterPendingEmail($email, $sitename, $username)
{
- $body = deindent(t('
+ $body = deindent(L10n::t('
Dear %1$s,
Thank you for registering at %2$s. Your account is pending for approval by the administrator.
'));
return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
- 'subject'=> sprintf( t('Registration at %s'), $sitename),
+ 'subject'=> L10n::t('Registration at %s', $sitename),
'body' => $body]);
}
*/
public static function sendRegisterOpenEmail($email, $sitename, $siteurl, $username, $password)
{
- $preamble = deindent(t('
+ $preamble = deindent(L10n::t('
Dear %1$s,
Thank you for registering at %2$s. Your account has been created.
'));
- $body = deindent(t('
+ $body = deindent(L10n::t('
The login details are as follows:
Site Location: %3$s
Login Name: %1$s
return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
- 'subject'=> sprintf( t('Registration details for %s'), $sitename),
+ 'subject'=> L10n::t('Registration details for %s', $sitename),
'preamble'=> $preamble,
'body' => $body]);
}
<?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;
require_once 'boot.php';
require_once 'include/datetime.php';
-require_once 'include/pgettext.php';
require_once 'include/security.php';
require_once 'include/text.php';
// 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
}
$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 >' . L10n::t('The error message was:') . ' ' . $e->getMessage());
}
// NOTREACHED
}
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());
}
$reg = false;
if ($register) {
$reg = [
- 'title' => t('Create a New Account'),
- 'desc' => t('Register')
+ 'title' => L10n::t('Create a New Account'),
+ 'desc' => L10n::t('Register')
];
}
$tpl,
[
'$dest_url' => self::getApp()->get_baseurl(true) . '/login',
- '$logout' => t('Logout'),
- '$login' => t('Login'),
+ '$logout' => L10n::t('Logout'),
+ '$login' => L10n::t('Login'),
- '$lname' => ['username', t('Nickname or Email: ') , '', ''],
- '$lpassword' => ['password', t('Password: '), '', ''],
- '$lremember' => ['remember', t('Remember me'), 0, ''],
+ '$lname' => ['username', L10n::t('Nickname or Email: ') , '', ''],
+ '$lpassword' => ['password', L10n::t('Password: '), '', ''],
+ '$lremember' => ['remember', L10n::t('Remember me'), 0, ''],
'$openid' => !$noid,
- '$lopenid' => ['openid_url', t('Or login using OpenID: '),'',''],
+ '$lopenid' => ['openid_url', L10n::t('Or login using OpenID: '),'',''],
'$hiddens' => $hiddens,
'$register' => $reg,
- '$lostpass' => t('Forgot your password?'),
- '$lostlink' => t('Password Reset'),
+ '$lostpass' => L10n::t('Forgot your password?'),
+ '$lostlink' => L10n::t('Password Reset'),
- '$tostitle' => t('Website Terms of Service'),
- '$toslink' => t('terms of service'),
+ '$tostitle' => L10n::t('Website Terms of Service'),
+ '$toslink' => L10n::t('terms of service'),
- '$privacytitle' => t('Website Privacy Policy'),
- '$privacylink' => t('privacy policy'),
+ '$privacytitle' => L10n::t('Website Privacy Policy'),
+ '$privacylink' => L10n::t('privacy policy'),
]
);
<?php\r
-\r
+/**\r
+ * @file src/Module/Logout.php\r
+ */\r
namespace Friendica\Module;\r
\r
use Friendica\BaseModule;\r
use Friendica\Core\Addon;\r
+use Friendica\Core\L10n;\r
\r
require_once 'boot.php';\r
-require_once 'include/pgettext.php';\r
require_once 'include/security.php';\r
\r
/**\r
{\r
Addon::callHooks("logging_out");\r
nuke_session();\r
- info(t('Logged out.') . EOL);\r
+ info(L10n::t('Logged out.') . EOL);\r
goaway(self::getApp()->get_baseurl());\r
}\r
}\r
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Photo;
$defperm = "";
$visitor = 0;
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 0, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 0, 0, $defperm);
if (!$r) {
logger("Picture couldn't be stored", LOGGER_DEBUG);
if ($width > 640 || $height > 640) {
$Image->scaleDown(640);
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 1, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 1, 0, $defperm);
if ($r) {
$image["medium"] = System::baseUrl()."/photo/{$hash}-1.".$Image->getExt();
}
if ($width > 320 || $height > 320) {
$Image->scaleDown(320);
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 2, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 2, 0, $defperm);
if ($r) {
$image["small"] = System::baseUrl()."/photo/{$hash}-2.".$Image->getExt();
}
$min = 160;
$Image->crop(160, $x, $y, $min, $min);
- $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 3, 0, $defperm);
+ $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 3, 0, $defperm);
if ($r) {
$image["thumb"] = System::baseUrl()."/photo/{$hash}-3.".$Image->getExt();
}
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
// only if the difference is more than 1 second.
if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
$edited = [
- 'label' => t('This entry was edited'),
+ 'label' => L10n::t('This entry was edited'),
'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),
'relative' => relative_date($item['edited'])
];
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
- ? t('Private Message')
+ ? L10n::t('Private Message')
: false);
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
if (local_user() && link_compare($a->contact['url'], $item['author-link'])) {
if ($item["event-id"] != 0) {
- $edpost = ["events/event/" . $item['event-id'], t("Edit")];
+ $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
} else {
- $edpost = ["editpost/" . $item['id'], t("Edit")];
+ $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
}
$dropping = in_array($item['uid'], [0, local_user()]);
} else {
$drop = [
'dropping' => $dropping,
'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''),
- 'select' => t('Select'),
- 'delete' => t('Delete'),
+ 'select' => L10n::t('Select'),
+ 'delete' => L10n::t('Delete'),
];
- $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? t("save to folder") : false);
+ $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
$diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
$response_verbs[] = 'attendmaybe';
if ($conv->isWritable()) {
$isevent = true;
- $attend = [t('I will attend'), t('I will not attend'), t('I might attend')];
+ $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
}
}
$isstarred = (($item['starred']) ? "starred" : "unstarred");
$star = [
- 'do' => t("add star"),
- 'undo' => t("remove star"),
- 'toggle' => t("toggle star status"),
+ 'do' => L10n::t("add star"),
+ 'undo' => L10n::t("remove star"),
+ 'toggle' => L10n::t("toggle star status"),
'classdo' => $item['starred'] ? "hidden" : "",
'classundo' => $item['starred'] ? "" : "hidden",
- 'starred' => t('starred'),
+ 'starred' => L10n::t('starred'),
];
$thread = dba::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]);
if (DBM::is_result($thread)) {
$ignore = [
- 'do' => t("ignore thread"),
- 'undo' => t("unignore thread"),
- 'toggle' => t("toggle ignore status"),
+ 'do' => L10n::t("ignore thread"),
+ 'undo' => L10n::t("unignore thread"),
+ 'toggle' => L10n::t("toggle ignore status"),
'classdo' => $thread['ignored'] ? "hidden" : "",
'classundo' => $thread['ignored'] ? "" : "hidden",
- 'ignored' => t('ignored'),
+ 'ignored' => L10n::t('ignored'),
];
}
if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) {
$tagger = [
- 'add' => t("add tag"),
+ 'add' => L10n::t("add tag"),
'class' => "",
];
}
if ($conv->isWritable()) {
$buttons = [
- 'like' => [t("I like this \x28toggle\x29"), t("like")],
- 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [t("I don't like this \x28toggle\x29"), t("dislike")] : '',
+ 'like' => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
+ 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")] : '',
];
if ($shareable) {
- $buttons['share'] = [t('Share this'), t('share')];
+ $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
}
}
'tags' => $item['tags'],
'hashtags' => $item['hashtags'],
'mentions' => $item['mentions'],
- 'txt_cats' => t('Categories:'),
- 'txt_folders' => t('Filed under:'),
+ 'txt_cats' => L10n::t('Categories:'),
+ 'txt_folders' => L10n::t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
'has_folders' => ((count($folders)) ? 'true' : ''),
'categories' => $categories,
'guid' => urlencode($item['guid']),
'isevent' => $isevent,
'attend' => $attend,
- 'linktitle' => t('View %s\'s profile @ %s', $profile_name, defaults($item, 'author-link', $item['url'])),
- 'olinktitle' => t('View %s\'s profile @ %s', htmlentities($this->getOwnerName()), defaults($item, 'owner-link', $item['url'])),
- 'to' => t('to'),
- 'via' => t('via'),
- 'wall' => t('Wall-to-Wall'),
- 'vwall' => t('via Wall-To-Wall:'),
+ 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, defaults($item, 'author-link', $item['url'])),
+ 'olinktitle' => L10n::t('View %s\'s profile @ %s', htmlentities($this->getOwnerName()), defaults($item, 'owner-link', $item['url'])),
+ 'to' => L10n::t('to'),
+ 'via' => L10n::t('via'),
+ 'wall' => L10n::t('Wall-to-Wall'),
+ 'vwall' => L10n::t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $name_e,
'sparkle' => $sparkle,
'title' => $title_e,
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
- 'ago' => $item['app'] ? t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']),
+ 'ago' => $item['app'] ? L10n::t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']),
'app' => $item['app'],
'created' => relative_date($item['created']),
'lock' => $lock,
'like' => $responses['like']['output'],
'dislike' => $responses['dislike']['output'],
'responses' => $responses,
- 'switchcomment' => t('Comment'),
+ 'switchcomment' => L10n::t('Comment'),
'comment' => $comment,
'previewing' => $conv->isPreview() ? ' preview ' : '',
- 'wait' => t('Please wait'),
+ 'wait' => L10n::t('Please wait'),
'thread_level' => $thread_level,
'edited' => $edited,
'network' => $item["item_network"],
// Collapse
if (($nb_children > 2) || ($thread_level > 1)) {
$result['children'][0]['comment_firstcollapsed'] = true;
- $result['children'][0]['num_comments'] = tt('%d comment', '%d comments', $total_children);
+ $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
$result['children'][0]['hidden_comments_num'] = $total_children;
- $result['children'][0]['hidden_comments_text'] = tt('comment', 'comments', $total_children);
- $result['children'][0]['hide_text'] = t('show more');
+ $result['children'][0]['hidden_comments_text'] = L10n::tt('comment', 'comments', $total_children);
+ $result['children'][0]['hide_text'] = L10n::t('show more');
if ($thread_level > 1) {
$result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
} else {
if ($this->isToplevel()) {
$result['total_comments_num'] = "$total_children";
- $result['total_comments_text'] = tt('comment', 'comments', $total_children);
+ $result['total_comments_text'] = L10n::tt('comment', 'comments', $total_children);
}
$result['private'] = $item['private'];
'$qcomment' => $qcomment,
'$profile_uid' => $uid,
'$mylink' => $a->remove_baseurl($a->contact['url']),
- '$mytitle' => t('This is you'),
+ '$mytitle' => L10n::t('This is you'),
'$myphoto' => $a->remove_baseurl($a->contact['thumb']),
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$edbold' => t('Bold'),
- '$editalic' => t('Italic'),
- '$eduline' => t('Underline'),
- '$edquote' => t('Quote'),
- '$edcode' => t('Code'),
- '$edimg' => t('Image'),
- '$edurl' => t('Link'),
- '$edvideo' => t('Video'),
- '$preview' => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? t('Preview') : ''),
+ '$comment' => L10n::t('Comment'),
+ '$submit' => L10n::t('Submit'),
+ '$edbold' => L10n::t('Bold'),
+ '$editalic' => L10n::t('Italic'),
+ '$eduline' => L10n::t('Underline'),
+ '$edquote' => L10n::t('Quote'),
+ '$edcode' => L10n::t('Code'),
+ '$edimg' => L10n::t('Image'),
+ '$edurl' => L10n::t('Link'),
+ '$edvideo' => L10n::t('Video'),
+ '$preview' => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? L10n::t('Preview') : ''),
'$indent' => $indent,
- '$sourceapp' => t($a->sourcename),
+ '$sourceapp' => L10n::t($a->sourcename),
'$ww' => $conv->getMode() === 'network' ? $ww : '',
'$rand_num' => random_digits(12)
]);
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 = L10n::t("%s\'s birthday", $contact["name"]);
+ $bdtext2 = 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`)
use Friendica\Core\System;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
*/
private static function constructLikeBody($contact, $parent_item, $guid)
{
- $bodyverb = t('%1$s likes %2$s\'s %3$s');
+ $bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
$ulink = "[url=".$contact["url"]."]".$contact["name"]."[/url]";
$alink = "[url=".$parent_item["author-link"]."]".$parent_item["author-name"]."[/url]";
- $plink = "[url=".System::baseUrl()."/display/".urlencode($guid)."]".t("status")."[/url]";
+ $plink = "[url=".System::baseUrl()."/display/".urlencode($guid)."]".L10n::t("status")."[/url]";
return sprintf($bodyverb, $ulink, $alink, $plink);
}
$A = "[url=".$self[0]["url"]."]".$self[0]["name"]."[/url]";
$B = "[url=".$contact["url"]."]".$contact["name"]."[/url]";
$BPhoto = "[url=".$contact["url"]."][img]".$contact["thumb"]."[/img][/url]";
- $arr["body"] = sprintf(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"] = self::constructNewFriendObject($contact);
intval($contact_record["id"]),
0,
0,
- dbesc(t("Sharing notification from Diaspora network")),
+ dbesc(L10n::t("Sharing notification from Diaspora network")),
dbesc($hash),
dbesc(datetime_convert())
);
if ($item["attach"]) {
$cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism', $item["attach"], $matches, PREG_SET_ORDER);
if (cnt) {
- $body .= "\n".t("Attachments:")."\n";
+ $body .= "\n".L10n::t("Attachments:")."\n";
foreach ($matches as $mtch) {
$body .= "[".$mtch[3]."](".$mtch[1].")\n";
}
use Friendica\App;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
$root->setAttribute("xmlns:mastodon", NAMESPACE_MASTODON);
switch ($filter) {
- case 'activity': $title = t('%s\'s timeline', $owner['name']); break;
- case 'posts' : $title = t('%s\'s posts' , $owner['name']); break;
- case 'comments': $title = t('%s\'s comments', $owner['name']); break;
+ case 'activity': $title = L10n::t('%s\'s timeline', $owner['name']); break;
+ case 'posts' : $title = L10n::t('%s\'s posts' , $owner['name']); break;
+ case 'comments': $title = L10n::t('%s\'s comments', $owner['name']); break;
}
$attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION];
}
if ($item['verb'] == ACTIVITY_FOLLOW) {
- $message = t('%s is now following %s.');
- $title = t('following');
+ $message = L10n::t('%s is now following %s.');
+ $title = L10n::t('following');
$action = "subscription";
} else {
- $message = t('%s stopped following %s.');
- $title = t('stopped following');
+ $message = L10n::t('%s stopped following %s.');
+ $title = L10n::t('stopped following');
$action = "unfollow";
}
use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Queue;
$reply_to = $r1[0]['reply_to'];
}
- $subject = (($it['title']) ? Email::encodeHeader($it['title'],'UTF-8') : t("\x28no subject\x29")) ;
+ $subject = (($it['title']) ? Email::encodeHeader($it['title'],'UTF-8') : L10n::t("\x28no subject\x29")) ;
// only expose our real email address to true friends
$headers = 'From: '.Email::encodeHeader($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n";
}
} else {
- $headers = 'From: '. Email::encodeHeader($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
+ $headers = 'From: '. Email::encodeHeader($local_user[0]['username'],'UTF-8') .' <'. L10n::t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
}
//if ($reply_to)
currently doesn't pick up strings in other libraries we might be using such as
the HTML parsers.
-In order for extract to do its job, every use of the t() translation function
+In order for extract to do its job, every use of the L10n::t() translation function
must be preceded by one space. The string also can not contain parentheses. If
parens are required in a string which requires translation, please use hex escapes.
Plural
-The tt() function supports plural form. Script extract.php write this in
+The L10n::tt() function supports plural form. Script extract.php write this in
strings.php as an array, one string for every plural form language supports:
$a->string["%d message sent"] = Array(
Xgettext and .po workflow
1. Run util/run_xgettext.sh script (on *unix sistems, with GNU xgettext installed)
- This script runs xgettext on source tree, extracting strings from t() and tt()
+ This script runs xgettext on source tree, extracting strings from L10n::t() and L10n::tt()
functions, and creates a util/messages.po file.
$ cd util; ./run_xgettext.sh
foreach($files as $file) {
$str = file_get_contents($file);
- $pat = '| t\(([^\)]*)\)|';
- $patt = '| tt\(([^\)]*)\)|';
+ $pat = '| L10n::t\(([^\)]*)\)|';
+ $patt = '| L10n::tt\(([^\)]*)\)|';
preg_match_all($pat,$str,$matches);
preg_match_all($patt, $str, $matchestt);
}
use Friendica\BaseObject;
+use Friendica\Core\L10n;
use Friendica\Model\Contact;
require_once 'boot.php';
require_once 'include/dba.php';
require_once 'include/text.php';
-$a = get_app();;
+$a = get_app();
BaseObject::setApp($a);
require_once '.htconfig.php';
$contact_id = Contact::getIdForURL($argv[1], 0);
if (!$contact_id) {
- echo t('Could not find any contact entry for this URL (%s)', $nurl);
+ echo L10n::t('Could not find any contact entry for this URL (%s)', $nurl);
echo "\r\n";
exit(1);
}
Contact::block($contact_id);
-echo t('The contact has been blocked from the node');
+echo L10n::t('The contact has been blocked from the node');
echo "\r\n";
exit(0);
<?php
-
+/**
+ * @file util/maintenance.php
+ */
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
-require_once("boot.php");
+require_once 'boot.php';
+require_once 'include/dba.php';
if (empty($a)) {
$a = new App(dirname(__DIR__));
@include(".htconfig.php");
-$lang = get_browser_language();
-load_translation_table($lang);
+$lang = L10n::getBrowserLanguage();
+L10n::loadTranslationTable($lang);
-require_once("include/dba.php");
dba::connect($db_host, $db_user, $db_pass, $db_data, false);
unset($db_host, $db_user, $db_pass, $db_data);
</div>
<div class="upload">
- <button id="upload-{{$type}}"><img id="profile-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait|escape:'html'}}" style="display: none;" /> {{"Upload"|t}}</button>
+ <button id="upload-{{$type}}"><img id="profile-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait|escape:'html'}}" style="display: none;" /> {{$upload}}</button>
</div>
</div>
<?php
-
/**
* Theme settings
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
-function theme_content(App $a) {
+function theme_content(App $a)
+{
if (!local_user()) {
return;
}
- $colorset = PConfig::get( local_user(), 'duepuntozero', 'colorset');
+ $colorset = PConfig::get(local_user(), 'duepuntozero', 'colorset');
$user = true;
return clean_form($a, $colorset, $user);
}
-function theme_post(App $a) {
+function theme_post(App $a)
+{
if (! local_user()) {
return;
}
- if (isset($_POST['duepuntozero-settings-submit'])){
+ if (isset($_POST['duepuntozero-settings-submit'])) {
PConfig::set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
-function theme_admin(App $a) {
- $colorset = Config::get( 'duepuntozero', 'colorset');
+function theme_admin(App $a)
+{
+ $colorset = Config::get('duepuntozero', 'colorset');
$user = false;
return clean_form($a, $colorset, $user);
}
-function theme_admin_post(App $a) {
- if (isset($_POST['duepuntozero-settings-submit'])){
+function theme_admin_post(App $a)
+{
+ if (isset($_POST['duepuntozero-settings-submit'])) {
Config::set('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
}
/// @TODO $a is no longer used
-function clean_form(App $a, &$colorset, $user) {
+function clean_form(App $a, &$colorset, $user)
+{
$colorset = [
- 'default' =>t('default'),
- 'greenzero' =>t('greenzero'),
- 'purplezero' =>t('purplezero'),
- 'easterbunny' =>t('easterbunny'),
- 'darkzero' =>t('darkzero'),
- 'comix' =>t('comix'),
- 'slackr' =>t('slackr'),
+ 'default' => L10n::t('default'),
+ 'greenzero' => L10n::t('greenzero'),
+ 'purplezero' => L10n::t('purplezero'),
+ 'easterbunny' => L10n::t('easterbunny'),
+ 'darkzero' => L10n::t('darkzero'),
+ 'comix' => L10n::t('comix'),
+ 'slackr' => L10n::t('slackr'),
];
if ($user) {
$color = PConfig::get(local_user(), 'duepuntozero', 'colorset');
} else {
- $color = Config::get( 'duepuntozero', 'colorset');
+ $color = Config::get('duepuntozero', 'colorset');
}
- $t = get_markup_template("theme_settings.tpl" );
+ $t = get_markup_template("theme_settings.tpl");
/// @TODO No need for adding string here, $o is not defined
$o .= replace_macros($t, [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$colorset' => ['duepuntozero_colorset', t('Variations'), $color, '', $colorset],
+ '$title' => L10n::t("Theme settings"),
+ '$colorset' => ['duepuntozero_colorset', L10n::t('Variations'), $color, '', $colorset],
]);
return $o;
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
-require_once('view/theme/frio/php/Image.php');
+require_once 'view/theme/frio/php/Image.php';
function theme_post(App $a) {
if (!local_user()) {
}
$scheme_choices = [];
- $scheme_choices["---"] = t("Default");
+ $scheme_choices["---"] = L10n::t("Default");
$files = glob('view/theme/frio/schema/*.php');
if ($files) {
foreach ($files as $file) {
}
}
- $background_image_help = "<strong>" . 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 = [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$schema' => ['frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices],
- '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : ['frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']],
- '$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : ['frio_nav_icon_color', t('Navigation bar icon color '), $arr['nav_icon_color']],
- '$link_color' => array_key_exists("link_color", $disable) ? "" : ['frio_link_color', t('Link color'), $arr['link_color'], '', $link_colors],
- '$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : ['frio_background_color', t('Set the background color'), $arr['bgcolor']],
- '$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : ['frio_contentbg_transp', t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)],
- '$background_image' => array_key_exists("background_image", $disable ) ? "" : ['frio_background_image', t('Set the background image'), $arr['background_image'], $background_image_help],
+ '$title' => L10n::t("Theme settings"),
+ '$schema' => ['frio_schema', L10n::t("Select scheme"), $arr["schema"], '', $scheme_choices],
+ '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : ['frio_nav_bg', L10n::t('Navigation bar background color'), $arr['nav_bg']],
+ '$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : ['frio_nav_icon_color', L10n::t('Navigation bar icon color '), $arr['nav_icon_color']],
+ '$link_color' => array_key_exists("link_color", $disable) ? "" : ['frio_link_color', L10n::t('Link color'), $arr['link_color'], '', $link_colors],
+ '$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : ['frio_background_color', L10n::t('Set the background color'), $arr['bgcolor']],
+ '$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : ['frio_contentbg_transp', L10n::t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)],
+ '$background_image' => array_key_exists("background_image", $disable) ? "" : ['frio_background_image', L10n::t('Set the background image'), $arr['background_image'], $background_image_help],
'$bg_image_options' => Image::get_options($arr),
];
- if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
- $ctx['$login_bg_image'] = ['frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help];
+ if (array_key_exists("login_bg_image", $arr) && !array_key_exists("login_bg_image", $disable)) {
+ $ctx['$login_bg_image'] = ['frio_login_bg_image', L10n::t('Login page background image'), $arr['login_bg_image'], $background_image_help];
}
- if ( array_key_exists("login_bg_color", $arr ) && !array_key_exists("login_bg_color", $disable ) ) {
- $ctx['$login_bg_color'] = ['frio_login_bg_color', t('Login page background color'), $arr['login_bg_color'], t('Leave background image and color empty for theme defaults')];
+ if (array_key_exists("login_bg_color", $arr) && !array_key_exists("login_bg_color", $disable)) {
+ $ctx['$login_bg_color'] = ['frio_login_bg_color', L10n::t('Login page background color'), $arr['login_bg_color'], L10n::t('Leave background image and color empty for theme defaults')];
}
<?php
-
/**
* @file view/theme/frio/php/Image.php
* @brief contain methods to deal with images
/**
* @brief This class contains methods to deal with images
*/
-class Image {
+use Friendica\Core\L10n;
+class Image
+{
/**
* @brief Give all available options for the background image
*
*
* @return array Array with the immage options
*/
- public static function get_options($arr) {
+ public static function get_options($arr)
+ {
$bg_image_options = [
'repeat' => [
- 'frio_bg_image_option', t("Repeat the image"), "repeat", t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")],
+ 'frio_bg_image_option', L10n::t("Repeat the image"), "repeat", L10n::t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")],
'stretch' => [
- 'frio_bg_image_option', t("Stretch"), "stretch", t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")],
+ 'frio_bg_image_option', L10n::t("Stretch"), "stretch", L10n::t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")],
'cover' => [
- 'frio_bg_image_option', t("Resize fill and-clip"), "cover", t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")],
+ 'frio_bg_image_option', L10n::t("Resize fill and-clip"), "cover", L10n::t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")],
'contain' => [
- 'frio_bg_image_option', t("Resize best fit"), "contain", t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")],
+ 'frio_bg_image_option', L10n::t("Resize best fit"), "contain", L10n::t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")],
];
return $bg_image_options;
}
-}
\ No newline at end of file
+}
</div>
<div class="upload">
- <button id="upload-{{$type}}">{{"Upload"|t}}</button>
+ <button id="upload-{{$type}}">{{$upload}}</button>
</div>
</div>
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
$r[0]['name'] = $a->user['username'];
} elseif (!local_user() && remote_user()) {
$r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
- $nav['remote'] = t("Guest");
+ $nav['remote'] = L10n::t("Guest");
} elseif (Profile::getMyURL()) {
$r = q("SELECT `name`, `nick`, `photo` FROM `gcontact`
WHERE `addr` = '%s' AND `network` = 'dfrn'",
dbesc($webbie));
- $nav['remote'] = t("Visitor");
+ $nav['remote'] = L10n::t("Visitor");
} else {
$r = false;
}
}
if (!local_user() && !empty($server_url)) {
- $nav['logout'] = [$server_url . '/logout', t('Logout'), "", t('End this session')];
+ $nav['logout'] = [$server_url . '/logout', L10n::t('Logout'), "", L10n::t('End this session')];
// user menu
- $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations')];
- $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page')];
- $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')];
- $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos')];
- $nav['usermenu'][] = [$server_url . '/events/', t('Events'), "", t('Your events')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], L10n::t('Status'), "", L10n::t('Your posts and conversations')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), "", L10n::t('Your profile page')];
+ $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], L10n::t('Photos'), "", L10n::t('Your photos')];
+ $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], L10n::t('Videos'), "", L10n::t('Your videos')];
+ $nav['usermenu'][] = [$server_url . '/events/', L10n::t('Events'), "", L10n::t('Your events')];
// navbar links
- $nav['network'] = [$server_url . '/network', t('Network'), "", t('Conversations from your friends')];
- $nav['events'] = [$server_url . '/events', t('Events'), "", t('Events and Calendar')];
- $nav['messages'] = [$server_url . '/message', t('Messages'), "", t('Private mail')];
- $nav['settings'] = [$server_url . '/settings', t('Settings'), "", t('Account settings')];
- $nav['contacts'] = [$server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts')];
+ $nav['network'] = [$server_url . '/network', L10n::t('Network'), "", L10n::t('Conversations from your friends')];
+ $nav['events'] = [$server_url . '/events', L10n::t('Events'), "", L10n::t('Events and Calendar')];
+ $nav['messages'] = [$server_url . '/message', L10n::t('Messages'), "", L10n::t('Private mail')];
+ $nav['settings'] = [$server_url . '/settings', L10n::t('Settings'), "", L10n::t('Account settings')];
+ $nav['contacts'] = [$server_url . '/contacts', L10n::t('Contacts'), "", L10n::t('Manage/edit friends and contacts')];
$nav['sitename'] = $a->config['sitename'];
}
}
if (local_user() == $arr['item']['uid'] && $arr['item']['parent'] == $arr['item']['id'] && !$arr['item']['self']) {
$subthread = [
'menu' => 'follow_thread',
- 'title' => t('Follow Thread'),
+ 'title' => L10n::t('Follow Thread'),
'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
'href' => '#'
];
<?php
-
/**
* Theme settings
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
$t = get_markup_template("theme_settings.tpl" );
$o .= replace_macros($t, [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$align' => ['quattro_align', t('Alignment'), $align, '', ['left'=>t('Left'), 'center'=>t('Center')]],
- '$color' => ['quattro_color', t('Color scheme'), $color, '', $colors],
- '$pfs' => ['quattro_pfs', t('Posts font size'), $pfs],
- '$tfs' => ['quattro_tfs', t('Textareas font size'), $tfs],
+ '$title' => L10n::t("Theme settings"),
+ '$align' => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]],
+ '$color' => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors],
+ '$pfs' => ['quattro_pfs', L10n::t('Posts font size'), $pfs],
+ '$tfs' => ['quattro_tfs', L10n::t('Textareas font size'), $tfs],
]);
return $o;
}
<?php
-
/**
* Theme settings
*/
use Friendica\App;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
-function theme_content(App $a) {
+function theme_content(App $a)
+{
if (!local_user()) {
return;
}
$show_services, $show_friends, $show_lastusers);
}
-function theme_post(App $a) {
+function theme_post(App $a)
+{
if (! local_user()) {
return;
}
- if (isset($_POST['vier-settings-submit'])){
+ if (isset($_POST['vier-settings-submit'])) {
PConfig::set(local_user(), 'vier', 'style', $_POST['vier_style']);
PConfig::set(local_user(), 'vier', 'show_pages', $_POST['vier_show_pages']);
PConfig::set(local_user(), 'vier', 'show_profiles', $_POST['vier_show_profiles']);
$t = get_markup_template("theme_admin_settings.tpl");
$o .= replace_macros($t, [
- '$helperlist' => ['vier_helperlist', t('Comma separated list of helper forums'), $helperlist, '', ''],
+ '$helperlist' => ['vier_helperlist', L10n::t('Comma separated list of helper forums'), $helperlist, '', ''],
]);
$show_pages = get_vier_config('show_pages', true, true);
"shadow"=>"Shadow"
];
- $show_or_not = ['0'=>t("don't show"), '1'=>t("show"),];
+ $show_or_not = ['0' => L10n::t("don't show"), '1' => L10n::t("show"),];
$t = get_markup_template("theme_settings.tpl");
$o .= replace_macros($t, [
- '$submit' => t('Submit'),
+ '$submit' => L10n::t('Submit'),
'$baseurl' => System::baseUrl(),
- '$title' => t("Theme settings"),
- '$style' => ['vier_style',t ('Set style'),$style,'',$styles],
- '$show_pages' => ['vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not],
- '$show_profiles' => ['vier_show_profiles', t('Community Profiles'), $show_profiles, '', $show_or_not],
- '$show_helpers' => ['vier_show_helpers', t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
- '$show_services' => ['vier_show_services', t('Connect Services'), $show_services, '', $show_or_not],
- '$show_friends' => ['vier_show_friends', t('Find Friends'), $show_friends, '', $show_or_not],
- '$show_lastusers' => ['vier_show_lastusers', t('Last users'), $show_lastusers, '', $show_or_not]
+ '$title' => L10n::t("Theme settings"),
+ '$style' => ['vier_style', L10n::t('Set style'), $style, '', $styles],
+ '$show_pages' => ['vier_show_pages', L10n::t('Community Pages'), $show_pages, '', $show_or_not],
+ '$show_profiles' => ['vier_show_profiles', L10n::t('Community Profiles'), $show_profiles, '', $show_or_not],
+ '$show_helpers' => ['vier_show_helpers', L10n::t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
+ '$show_services' => ['vier_show_services', L10n::t('Connect Services'), $show_services, '', $show_or_not],
+ '$show_friends' => ['vier_show_friends', L10n::t('Find Friends'), $show_friends, '', $show_or_not],
+ '$show_lastusers' => ['vier_show_lastusers', L10n::t('Last users'), $show_lastusers, '', $show_or_not]
]);
return $o;
}
use Friendica\App;
use Friendica\Content\ForumManager;
use Friendica\Core\Addon;
+use Friendica\Core\L10n;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
require_once "mod/proxy.php";
-function vier_init(App $a) {
-
+function vier_init(App $a)
+{
$a->theme_events_in_profile = false;
$a->set_template_engine('smarty3');
</script>
EOT;
- if ($a->is_mobile || $a->is_tablet){
+ if ($a->is_mobile || $a->is_tablet) {
$a->page['htmlhead'] .= <<< EOT
<script>
$(document).ready(function() {
}
}
-function get_vier_config($key, $default = false, $admin = false) {
+function get_vier_config($key, $default = false, $admin = false)
+{
if (local_user() && !$admin) {
$result = PConfig::get(local_user(), "vier", $key);
if (!is_null($result)) {
return $default;
}
-function vier_community_info() {
+function vier_community_info()
+{
$a = get_app();
$show_pages = get_vier_config("show_pages", 1);
$tpl = get_markup_template('ch_directory_item.tpl');
if (DBM::is_result($r)) {
-
- $aside['$comunity_profiles_title'] = t('Community Profiles');
+ $aside['$comunity_profiles_title'] = L10n::t('Community Profiles');
$aside['$comunity_profiles_items'] = [];
foreach ($r as $rr) {
- $entry = replace_macros($tpl,[
+ $entry = replace_macros($tpl, [
'$id' => $rr['id'],
//'$profile_link' => Profile::zrl($rr['url']),
'$profile_link' => 'follow/?url='.urlencode($rr['url']),
$r = q("SELECT `profile`.*, `profile`.`uid` AS `profile_uid`, `user`.`nickname`
FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $order LIMIT %d , %d ",
- 0, 9);
+ 0,
+ 9
+ );
if (DBM::is_result($r)) {
-
- $aside['$lastusers_title'] = t('Last users');
+ $aside['$lastusers_title'] = L10n::t('Last users');
$aside['$lastusers_items'] = [];
foreach ($r as $rr) {
$profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
- $entry = replace_macros($tpl,[
+ $entry = replace_macros($tpl, [
'$id' => $rr['id'],
'$profile_link' => $profile_link,
'$photo' => $a->remove_baseurl($rr['thumb']),
//right_aside FIND FRIENDS
if ($show_friends && local_user()) {
$nv = [];
- $nv['title'] = ["", t('Find Friends'), "", ""];
- $nv['directory'] = ['directory', t('Local Directory'), "", ""];
- $nv['global_directory'] = [get_server(), t('Global Directory'), "", ""];
- $nv['match'] = ['match', t('Similar Interests'), "", ""];
- $nv['suggest'] = ['suggest', t('Friend Suggestions'), "", ""];
- $nv['invite'] = ['invite', t('Invite Friends'), "", ""];
+ $nv['title'] = ["", L10n::t('Find Friends'), "", ""];
+ $nv['directory'] = ['directory', L10n::t('Local Directory'), "", ""];
+ $nv['global_directory'] = [get_server(), L10n::t('Global Directory'), "", ""];
+ $nv['match'] = ['match', L10n::t('Similar Interests'), "", ""];
+ $nv['suggest'] = ['suggest', L10n::t('Friend Suggestions'), "", ""];
+ $nv['invite'] = ['invite', L10n::t('Invite Friends'), "", ""];
$nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
<span class="sbox_l"></span>
$page .= replace_macros(
$tpl,
[
- '$title' => t('Forums'),
+ '$title' => L10n::t('Forums'),
'$forums' => $entries,
- '$link_desc' => t('External link to forum'),
+ '$link_desc' => L10n::t('External link to forum'),
'$total' => $total,
'$visible_forums' => $visible_forums,
- '$showmore' => t('show more')]
+ '$showmore' => L10n::t('show more')]
);
$aside['$page'] = $page;
$helperlist = Config::get("vier", "helperlist");
- $helpers = explode(",",$helperlist);
+ $helpers = explode(",", $helperlist);
if ($helpers) {
$query = "";
- foreach ($helpers AS $index=>$helper) {
- if ($query != "")
+ foreach ($helpers as $index => $helper) {
+ if ($query != "") {
$query .= ",";
+ }
$query .= "'".dbesc(normalise_link(trim($helper)))."'";
}
$r = q("SELECT `url`, `name` FROM `gcontact` WHERE `nurl` IN (%s)", $query);
}
- foreach ($r AS $index => $helper)
+ foreach ($r as $index => $helper) {
$r[$index]["url"] = Profile::zrl($helper["url"]);
+ }
- $r[] = ["url" => "help/Quick-Start-guide", "name" => t("Quick Start")];
+ $r[] = ["url" => "help/Quick-Start-guide", "name" => L10n::t("Quick Start")];
$tpl = get_markup_template('ch_helpers.tpl');
if ($r) {
-
$helpers = [];
- $helpers['title'] = ["", t('Help'), "", ""];
+ $helpers['title'] = ["", L10n::t('Help'), "", ""];
$aside['$helpers_items'] = [];
foreach ($r as $rr) {
- $entry = replace_macros($tpl,[
+ $entry = replace_macros($tpl, [
'$url' => $rr['url'],
'$title' => $rr['name'],
]);
// connectable services
if ($show_services) {
-
/// @TODO This whole thing is hard-coded, better rewrite to Intercepting Filter Pattern (future-todo)
$r = [];
$r[] = ["photo" => "images/wordpress.png", "name" => "Wordpress"];
}
- if (function_exists("imap_open") && !Config::get("system","imap_disabled") && !Config::get("system","dfrn_only")) {
+ if (function_exists("imap_open") && !Config::get("system", "imap_disabled") && !Config::get("system", "dfrn_only")) {
$r[] = ["photo" => "images/mail.png", "name" => "E-Mail"];
}
$tpl = get_markup_template('ch_connectors.tpl');
if (DBM::is_result($r)) {
-
$con_services = [];
- $con_services['title'] = ["", t('Connect Services'), "", ""];
+ $con_services['title'] = ["", L10n::t('Connect Services'), "", ""];
$aside['$con_services'] = $con_services;
foreach ($r as $rr) {
- $entry = replace_macros($tpl,[
+ $entry = replace_macros($tpl, [
'$url' => $url,
'$photo' => $rr['photo'],
'$alt_text' => $rr['name'],
$aside['$connector_items'][] = $entry;
}
}
-
}
//end connectable services