mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
Merge pull request #4312 from zeroadam/feature/L10n
Move pgettext to src
This commit is contained in:
commit
30c1cc0e8c
144 changed files with 3411 additions and 3186 deletions
5
boot.php
5
boot.php
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
/** @file boot.php
|
||||
*
|
||||
* This file defines some global constants and includes the central App class.
|
||||
|
@ -25,6 +24,7 @@ use Friendica\Core\Addon;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendida\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -35,7 +35,6 @@ use Friendica\Module\Login;
|
|||
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');
|
||||
|
@ -782,7 +781,7 @@ function run_update_function($x)
|
|||
//send the administrator an e-mail
|
||||
DBStructure::updateFail(
|
||||
$x,
|
||||
sprintf(t('Update %s failed. See error logs.'), $x)
|
||||
L10n::t('Update %s failed. See error logs.', $x)
|
||||
);
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
@ -39,7 +39,7 @@ They are initialized with an array of data, depending on the tyle of the field.
|
|||
|
||||
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.
|
||||
|
||||
|
|
|
@ -109,17 +109,17 @@ The _post functions handle the processing of the send form, in this case they sa
|
|||
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){
|
||||
|
|
|
@ -7,6 +7,7 @@ use Friendica\Content\Feature;
|
|||
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;
|
||||
|
@ -351,31 +352,30 @@ function populate_acl($user = null, $show_jotnets = false) {
|
|||
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")
|
||||
],
|
||||
|
|
|
@ -12,6 +12,7 @@ use Friendica\Core\Addon;
|
|||
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;
|
||||
|
@ -1176,8 +1177,8 @@ function api_statuses_update($type)
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1200,8 +1201,8 @@ function api_statuses_update($type)
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1224,8 +1225,8 @@ function api_statuses_update($type)
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4374,7 +4375,7 @@ function api_account_update_profile_image($type)
|
|||
$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'])) {
|
||||
|
|
|
@ -234,13 +234,13 @@ function format_event_diaspora($ev) {
|
|||
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',
|
||||
|
@ -248,7 +248,7 @@ function format_event_diaspora($ev) {
|
|||
. '](' . 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',
|
||||
|
@ -257,7 +257,7 @@ function format_event_diaspora($ev) {
|
|||
}
|
||||
|
||||
if (strlen($ev['location'])) {
|
||||
$o .= t('Location:') . bb2diaspora($ev['location'])
|
||||
$o .= L10n::t('Location:') . bb2diaspora($ev['location'])
|
||||
. "\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?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;
|
||||
|
@ -411,7 +414,7 @@ function bb_replace_images($body, $images) {
|
|||
// 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++;
|
||||
}
|
||||
|
||||
|
@ -549,7 +552,7 @@ function bb_ShareAttributes($share, $simplehtml)
|
|||
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]);
|
||||
|
@ -1180,7 +1183,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
|
||||
// Check for [spoiler=Author] text
|
||||
|
||||
$t_wrote = t('$1 wrote:');
|
||||
$t_wrote = L10n::t('$1 wrote:');
|
||||
|
||||
// handle nested quotes
|
||||
$endlessloop = 0;
|
||||
|
@ -1202,7 +1205,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
|
||||
// Check for [quote=Author] text
|
||||
|
||||
$t_wrote = t('$1 wrote:');
|
||||
$t_wrote = L10n::t('$1 wrote:');
|
||||
|
||||
// handle nested quotes
|
||||
$endlessloop = 0;
|
||||
|
@ -1223,8 +1226,8 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
// [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",
|
||||
|
@ -1232,9 +1235,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
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) {
|
||||
|
@ -1352,7 +1355,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
// 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
|
||||
|
@ -1363,7 +1366,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
|
|||
$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);
|
||||
|
|
|
@ -7,6 +7,7 @@ use Friendica\Content\ContactSelector;
|
|||
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;
|
||||
|
@ -137,39 +138,39 @@ function localize_item(&$item) {
|
|||
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);
|
||||
|
||||
|
@ -202,7 +203,7 @@ function localize_item(&$item) {
|
|||
$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)) {
|
||||
|
@ -243,11 +244,11 @@ function localize_item(&$item) {
|
|||
* 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
|
||||
|
||||
|
@ -275,19 +276,19 @@ function localize_item(&$item) {
|
|||
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;
|
||||
|
@ -297,7 +298,7 @@ function localize_item(&$item) {
|
|||
$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)) {
|
||||
|
@ -324,8 +325,8 @@ function localize_item(&$item) {
|
|||
$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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -601,8 +602,8 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
$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)
|
||||
|
@ -746,8 +747,8 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
$drop = [
|
||||
'dropping' => $dropping,
|
||||
'pagedrop' => $page_dropping,
|
||||
'select' => t('Select'),
|
||||
'delete' => t('Delete'),
|
||||
'select' => L10n::t('Select'),
|
||||
'delete' => L10n::t('Delete'),
|
||||
];
|
||||
|
||||
$star = false;
|
||||
|
@ -779,7 +780,7 @@ function conversation(App $a, $items, $mode, $update, $preview = 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,
|
||||
|
@ -791,15 +792,15 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
'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,
|
||||
|
@ -814,9 +815,9 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
'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,
|
||||
];
|
||||
|
||||
|
@ -887,11 +888,11 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
'$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;
|
||||
|
@ -1053,25 +1054,25 @@ function item_photo_menu($item) {
|
|||
|
||||
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];
|
||||
|
@ -1187,19 +1188,19 @@ function format_like($cnt, array $arr, $type, $id) {
|
|||
// 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;
|
||||
}
|
||||
}
|
||||
|
@ -1210,13 +1211,13 @@ function format_like($cnt, array $arr, $type, $id) {
|
|||
$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;
|
||||
|
@ -1225,24 +1226,24 @@ function format_like($cnt, array $arr, $type, $id) {
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1272,14 +1273,14 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
|
|||
'$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');
|
||||
|
@ -1288,13 +1289,13 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
|
|||
'$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 = '';
|
||||
|
@ -1328,28 +1329,28 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
|
|||
$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', ''),
|
||||
|
@ -1357,28 +1358,28 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
|
|||
'$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'),
|
||||
]);
|
||||
|
||||
|
||||
|
@ -1645,7 +1646,7 @@ function get_responses($conv_responses, $response_verbs, $ob, $item) {
|
|||
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'] = '';
|
||||
}
|
||||
|
@ -1668,19 +1669,19 @@ function get_response_button_text($v, $count)
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
|
@ -17,21 +18,21 @@ use Friendica\Database\DBM;
|
|||
*/
|
||||
function timezone_cmp($a, $b) {
|
||||
if (strstr($a, '/') && strstr($b, '/')) {
|
||||
if ( t($a) == t($b)) {
|
||||
if (L10n::t($a) == L10n::t($b)) {
|
||||
return 0;
|
||||
}
|
||||
return ( t($a) < t($b)) ? -1 : 1;
|
||||
return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
|
||||
}
|
||||
|
||||
if (strstr($a, '/')) {
|
||||
return -1;
|
||||
} elseif (strstr($b, '/')) {
|
||||
return 1;
|
||||
} elseif ( t($a) == t($b)) {
|
||||
} elseif (L10n::t($a) == L10n::t($b)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ( t($a) < t($b)) ? -1 : 1;
|
||||
return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +57,7 @@ function select_timezone($current = 'America/Los_Angeles') {
|
|||
$o .= '</optgroup>';
|
||||
}
|
||||
$continent = $ex[0];
|
||||
$o .= '<optgroup label="' . t($continent) . '">';
|
||||
$o .= '<optgroup label="' . L10n::t($continent) . '">';
|
||||
}
|
||||
if (count($ex) > 2) {
|
||||
$city = substr($value,strpos($value,'/')+1);
|
||||
|
@ -65,13 +66,13 @@ function select_timezone($current = 'America/Los_Angeles') {
|
|||
}
|
||||
} else {
|
||||
$city = $ex[0];
|
||||
if ($continent != t('Miscellaneous')) {
|
||||
if ($continent != L10n::t('Miscellaneous')) {
|
||||
$o .= '</optgroup>';
|
||||
$continent = t('Miscellaneous');
|
||||
$o .= '<optgroup label="' . t($continent) . '">';
|
||||
$continent = L10n::t('Miscellaneous');
|
||||
$o .= '<optgroup label="' . L10n::t($continent) . '">';
|
||||
}
|
||||
}
|
||||
$city = str_replace('_', ' ', t($city));
|
||||
$city = str_replace('_', ' ', L10n::t($city));
|
||||
$selected = (($value == $current) ? " selected=\"selected\" " : "");
|
||||
$o .= "<option value=\"$value\" $selected >$city</option>";
|
||||
}
|
||||
|
@ -192,11 +193,11 @@ function dob($dob)
|
|||
$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') . '"'
|
||||
]
|
||||
]);
|
||||
|
||||
|
@ -270,7 +271,7 @@ function datetimesel($min, $max, $default, $label, $id = 'datetimepicker', $pick
|
|||
// 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"])) {
|
||||
|
@ -352,23 +353,23 @@ function relative_date($posted_date, $format = null) {
|
|||
|
||||
$abs = strtotime($localtime);
|
||||
|
||||
if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === False) {
|
||||
return t('never');
|
||||
if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === false) {
|
||||
return L10n::t('never');
|
||||
}
|
||||
|
||||
$etime = time() - $abs;
|
||||
|
||||
if ($etime < 1) {
|
||||
return t('less than a second ago');
|
||||
return L10n::t('less than a second ago');
|
||||
}
|
||||
|
||||
$a = [ 12 * 30 * 24 * 60 * 60 => [ t('year'), t('years')],
|
||||
30 * 24 * 60 * 60 => [ t('month'), t('months')],
|
||||
7 * 24 * 60 * 60 => [ t('week'), t('weeks')],
|
||||
24 * 60 * 60 => [ t('day'), t('days')],
|
||||
60 * 60 => [ t('hour'), t('hours')],
|
||||
60 => [ t('minute'), t('minutes')],
|
||||
1 => [ t('second'), t('seconds')]
|
||||
$a = [ 12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
|
||||
30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
|
||||
7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
|
||||
24 * 60 * 60 => [L10n::t('day'), L10n::t('days')],
|
||||
60 * 60 => [L10n::t('hour'), L10n::t('hours')],
|
||||
60 => [L10n::t('minute'), L10n::t('minutes')],
|
||||
1 => [L10n::t('second'), L10n::t('seconds')]
|
||||
];
|
||||
|
||||
foreach ($a as $secs => $str) {
|
||||
|
@ -377,7 +378,7 @@ function relative_date($posted_date, $format = null) {
|
|||
$r = round($d);
|
||||
// translators - e.g. 22 hours ago, 1 minute ago
|
||||
if (!$format) {
|
||||
$format = t('%1$d %2$s ago');
|
||||
$format = L10n::t('%1$d %2$s ago');
|
||||
}
|
||||
|
||||
return sprintf($format, $r, (($r == 1) ? $str[0] : $str[1]));
|
||||
|
@ -604,8 +605,8 @@ function update_contact_birthdays() {
|
|||
continue;
|
||||
}
|
||||
|
||||
$bdtext = sprintf( t('%s\'s birthday'), $rr['name']);
|
||||
$bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;
|
||||
$bdtext = 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' ) ",
|
||||
|
|
|
@ -55,7 +55,7 @@ class dba {
|
|||
if ($install) {
|
||||
if (strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) {
|
||||
if (! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) {
|
||||
self::$error = sprintf(t('Cannot locate DNS info for database server \'%s\''), $server);
|
||||
self::$error = L10n::t('Cannot locate DNS info for database server \'%s\'', $server);
|
||||
self::$connected = false;
|
||||
self::$db = null;
|
||||
return false;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
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;
|
||||
|
@ -26,17 +27,17 @@ function notification($params)
|
|||
$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;
|
||||
|
@ -47,7 +48,7 @@ function notification($params)
|
|||
|
||||
$sender_email = $a->config['sender_email'];
|
||||
if (empty($sender_email)) {
|
||||
$sender_email = t('noreply').'@'.$hostname;
|
||||
$sender_email = L10n::t('noreply').'@'.$hostname;
|
||||
}
|
||||
|
||||
if ($params['type'] != SYSTEM_EMAIL) {
|
||||
|
@ -95,12 +96,12 @@ function notification($params)
|
|||
}
|
||||
|
||||
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'];
|
||||
|
@ -123,7 +124,7 @@ function notification($params)
|
|||
intval($params['uid'])
|
||||
);
|
||||
if ($p && count($p)) {
|
||||
pop_lang();
|
||||
L10n::popLang();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,26 +139,29 @@ function notification($params)
|
|||
$item_post_type = item_post_type($item);
|
||||
|
||||
// "a post"
|
||||
$dest_str = sprintf(t('%1$s commented on [url=%2$s]a %3$s[/url]'),
|
||||
'[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.
|
||||
|
@ -165,102 +169,108 @@ function notification($params)
|
|||
// Before this we have the name of the replier on the subject rendering
|
||||
// differents subjects for messages on the same thread.
|
||||
|
||||
$subject = sprintf(t('[Friendica:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $params['source_name']);
|
||||
$subject = 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'];
|
||||
|
@ -268,21 +278,23 @@ function notification($params)
|
|||
switch ($params['verb']) {
|
||||
case ACTIVITY_FRIEND:
|
||||
// someone started to share with user (mostly OStatus)
|
||||
$subject = sprintf(t('[Friendica:Notify] A new person is sharing with you'));
|
||||
$subject = 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
|
||||
|
@ -291,19 +303,20 @@ function notification($params)
|
|||
}
|
||||
|
||||
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'];
|
||||
|
@ -311,32 +324,34 @@ function notification($params)
|
|||
|
||||
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'];
|
||||
|
@ -346,17 +361,21 @@ function notification($params)
|
|||
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'];
|
||||
|
@ -444,7 +463,7 @@ function notification($params)
|
|||
Addon::callHooks('enotify_store', $datarray);
|
||||
|
||||
if ($datarray['abort']) {
|
||||
pop_lang();
|
||||
L10n::popLang();
|
||||
return False;
|
||||
}
|
||||
|
||||
|
@ -473,7 +492,7 @@ function notification($params)
|
|||
if ($r) {
|
||||
$notify_id = $r[0]['id'];
|
||||
} else {
|
||||
pop_lang();
|
||||
L10n::popLang();
|
||||
return False;
|
||||
}
|
||||
|
||||
|
@ -492,8 +511,8 @@ function notification($params)
|
|||
|
||||
// only continue on if we stored the first one
|
||||
if ($notify_id != $p[0]['id']) {
|
||||
pop_lang();
|
||||
return False;
|
||||
L10n::popLang();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -22,7 +23,7 @@ function format_event_html($ev, $simple = false) {
|
|||
return '';
|
||||
}
|
||||
|
||||
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM.
|
||||
$bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM.
|
||||
|
||||
$event_start = (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),
|
||||
$ev['start'] , $bd_format ))
|
||||
|
@ -39,14 +40,14 @@ function format_event_html($ev, $simple = false) {
|
|||
|
||||
$o .= "<div>" . bbcode($ev['desc']) . "</div>";
|
||||
|
||||
$o .= "<h4>" . t('Starts:') . "</h4><p>" . $event_start . "</p>";
|
||||
$o .= "<h4>" . L10n::t('Starts:') . "</h4><p>" . $event_start . "</p>";
|
||||
|
||||
if (! $ev['nofinish']) {
|
||||
$o .= "<h4>" . t('Finishes:') . "</h4><p>" . $event_end ."</p>";
|
||||
$o .= "<h4>" . L10n::t('Finishes:') . "</h4><p>" . $event_end ."</p>";
|
||||
}
|
||||
|
||||
if (strlen($ev['location'])) {
|
||||
$o .= "<h4>" . t('Location:') . "</h4><p>" . $ev['location'] . "</p>";
|
||||
$o .= "<h4>" . L10n::t('Location:') . "</h4><p>" . $ev['location'] . "</p>";
|
||||
}
|
||||
|
||||
return $o;
|
||||
|
@ -56,13 +57,13 @@ function format_event_html($ev, $simple = false) {
|
|||
|
||||
$o .= '<div class="summary event-summary">' . bbcode($ev['summary']) . '</div>' . "\r\n";
|
||||
|
||||
$o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span> <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";
|
||||
|
@ -71,7 +72,7 @@ function format_event_html($ev, $simple = false) {
|
|||
$o .= '<div class="description event-description">' . bbcode($ev['desc']) . '</div>' . "\r\n";
|
||||
|
||||
if (strlen($ev['location'])) {
|
||||
$o .= '<div class="event-location"><span class="event-label">' . t('Location:') . '</span> <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";
|
||||
|
||||
|
@ -425,60 +426,60 @@ function get_event_strings() {
|
|||
|
||||
$i18n = [
|
||||
"firstDay" => $firstDay,
|
||||
"allday" => t("all-day"),
|
||||
"allday" => L10n::t("all-day"),
|
||||
|
||||
"Sun" => t("Sun"),
|
||||
"Mon" => t("Mon"),
|
||||
"Tue" => t("Tue"),
|
||||
"Wed" => t("Wed"),
|
||||
"Thu" => t("Thu"),
|
||||
"Fri" => t("Fri"),
|
||||
"Sat" => t("Sat"),
|
||||
"Sun" => L10n::t("Sun"),
|
||||
"Mon" => L10n::t("Mon"),
|
||||
"Tue" => L10n::t("Tue"),
|
||||
"Wed" => L10n::t("Wed"),
|
||||
"Thu" => L10n::t("Thu"),
|
||||
"Fri" => L10n::t("Fri"),
|
||||
"Sat" => L10n::t("Sat"),
|
||||
|
||||
"Sunday" => t("Sunday"),
|
||||
"Monday" => t("Monday"),
|
||||
"Tuesday" => t("Tuesday"),
|
||||
"Wednesday" => t("Wednesday"),
|
||||
"Thursday" => t("Thursday"),
|
||||
"Friday" => t("Friday"),
|
||||
"Saturday" => t("Saturday"),
|
||||
"Sunday" => L10n::t("Sunday"),
|
||||
"Monday" => L10n::t("Monday"),
|
||||
"Tuesday" => L10n::t("Tuesday"),
|
||||
"Wednesday" => L10n::t("Wednesday"),
|
||||
"Thursday" => L10n::t("Thursday"),
|
||||
"Friday" => L10n::t("Friday"),
|
||||
"Saturday" => L10n::t("Saturday"),
|
||||
|
||||
"Jan" => t("Jan"),
|
||||
"Feb" => t("Feb"),
|
||||
"Mar" => t("Mar"),
|
||||
"Apr" => t("Apr"),
|
||||
"May" => t("May"),
|
||||
"Jun" => t("Jun"),
|
||||
"Jul" => t("Jul"),
|
||||
"Aug" => t("Aug"),
|
||||
"Sep" => t("Sept"),
|
||||
"Oct" => t("Oct"),
|
||||
"Nov" => t("Nov"),
|
||||
"Dec" => t("Dec"),
|
||||
"Jan" => L10n::t("Jan"),
|
||||
"Feb" => L10n::t("Feb"),
|
||||
"Mar" => L10n::t("Mar"),
|
||||
"Apr" => L10n::t("Apr"),
|
||||
"May" => L10n::t("May"),
|
||||
"Jun" => L10n::t("Jun"),
|
||||
"Jul" => L10n::t("Jul"),
|
||||
"Aug" => L10n::t("Aug"),
|
||||
"Sep" => L10n::t("Sept"),
|
||||
"Oct" => L10n::t("Oct"),
|
||||
"Nov" => L10n::t("Nov"),
|
||||
"Dec" => L10n::t("Dec"),
|
||||
|
||||
"January" => t("January"),
|
||||
"February" => t("February"),
|
||||
"March" => t("March"),
|
||||
"April" => t("April"),
|
||||
"May" => t("May"),
|
||||
"June" => t("June"),
|
||||
"July" => t("July"),
|
||||
"August" => t("August"),
|
||||
"September" => t("September"),
|
||||
"October" => t("October"),
|
||||
"November" => t("November"),
|
||||
"December" => t("December"),
|
||||
"January" => L10n::t("January"),
|
||||
"February" => L10n::t("February"),
|
||||
"March" => L10n::t("March"),
|
||||
"April" => L10n::t("April"),
|
||||
"May" => L10n::t("May"),
|
||||
"June" => L10n::t("June"),
|
||||
"July" => L10n::t("July"),
|
||||
"August" => L10n::t("August"),
|
||||
"September" => L10n::t("September"),
|
||||
"October" => L10n::t("October"),
|
||||
"November" => L10n::t("November"),
|
||||
"December" => L10n::t("December"),
|
||||
|
||||
"today" => t("today"),
|
||||
"month" => t("month"),
|
||||
"week" => t("week"),
|
||||
"day" => t("day"),
|
||||
"today" => L10n::t("today"),
|
||||
"month" => L10n::t("month"),
|
||||
"week" => L10n::t("week"),
|
||||
"day" => L10n::t("day"),
|
||||
|
||||
"noevent" => t("No events to display"),
|
||||
"noevent" => L10n::t("No events to display"),
|
||||
|
||||
"dtstart_label" => t("Starts:"),
|
||||
"dtend_label" => t("Finishes:"),
|
||||
"location_label" => t("Location:")
|
||||
"dtstart_label" => L10n::t("Starts:"),
|
||||
"dtend_label" => L10n::t("Finishes:"),
|
||||
"location_label" => L10n::t("Location:")
|
||||
];
|
||||
|
||||
return $i18n;
|
||||
|
@ -588,7 +589,7 @@ function process_events($arr) {
|
|||
$events=[];
|
||||
|
||||
$last_date = '';
|
||||
$fmt = t('l, F j');
|
||||
$fmt = L10n::t('l, F j');
|
||||
if (count($arr)) {
|
||||
foreach ($arr as $rr) {
|
||||
$j = (($rr['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $rr['start'], 'j') : datetime_convert('UTC', 'UTC', $rr['start'], 'j'));
|
||||
|
@ -612,9 +613,9 @@ function process_events($arr) {
|
|||
$copy = null;
|
||||
$drop = null;
|
||||
if (local_user() && local_user() == $rr['uid'] && $rr['type'] == 'event') {
|
||||
$edit = ((! $rr['cid']) ? [System::baseUrl() . '/events/event/' . $rr['id'], t('Edit event'), '', ''] : null);
|
||||
$copy = ((! $rr['cid']) ? [System::baseUrl() . '/events/copy/' . $rr['id'], t('Duplicate event'), '', ''] : null);
|
||||
$drop = [System::baseUrl() . '/events/drop/' . $rr['id'], t('Delete event'), '', ''];
|
||||
$edit = ((! $rr['cid']) ? [System::baseUrl() . '/events/event/' . $rr['id'], L10n::t('Edit event'), '', ''] : null);
|
||||
$copy = ((! $rr['cid']) ? [System::baseUrl() . '/events/copy/' . $rr['id'], L10n::t('Duplicate event'), '', ''] : null);
|
||||
$drop = [System::baseUrl() . '/events/drop/' . $rr['id'], L10n::t('Delete event'), '', ''];
|
||||
}
|
||||
|
||||
$title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8'));
|
||||
|
@ -641,7 +642,7 @@ function process_events($arr) {
|
|||
'is_first' => $is_first,
|
||||
'item' => $rr,
|
||||
'html' => $html,
|
||||
'plink' => [$rr['plink'], t('link to source'), '', ''],
|
||||
'plink' => [$rr['plink'], L10n::t('link to source'), '', ''],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -901,9 +902,9 @@ function widget_events() {
|
|||
}
|
||||
|
||||
return replace_macros(get_markup_template("events_aside.tpl"), [
|
||||
'$etitle' => t("Export"),
|
||||
'$export_ical' => t("Export calendar as ical"),
|
||||
'$export_csv' => t("Export calendar as csv"),
|
||||
'$etitle' => L10n::t("Export"),
|
||||
'$export_ical' => L10n::t("Export calendar as ical"),
|
||||
'$export_csv' => L10n::t("Export calendar as csv"),
|
||||
'$user' => $user
|
||||
]);
|
||||
}
|
||||
|
@ -919,9 +920,9 @@ function format_event_item($item) {
|
|||
$finish = false;
|
||||
|
||||
// Set the different time formats.
|
||||
$dformat = t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8:01 AM.
|
||||
$dformat_short = t('D g:i A'); // Fri 8:01 AM.
|
||||
$tformat = t('g:i A'); // 8:01 AM.
|
||||
$dformat = L10n::t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8:01 AM.
|
||||
$dformat_short = L10n::t('D g:i A'); // Fri 8:01 AM.
|
||||
$tformat = L10n::t('g:i A'); // 8:01 AM.
|
||||
|
||||
// Convert the time to different formats.
|
||||
$dtstart_dt = (($item['event-adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $item['event-start'], $dformat)) : day_translate(datetime_convert('UTC', 'UTC', $item['event-start'], $dformat)));
|
||||
|
@ -971,11 +972,11 @@ function format_event_item($item) {
|
|||
$event = replace_macros(get_markup_template('event_stream_item.tpl'), [
|
||||
'$id' => $item['event-id'],
|
||||
'$title' => prepare_text($item['event-summary']),
|
||||
'$dtstart_label' => t('Starts:'),
|
||||
'$dtstart_label' => L10n::t('Starts:'),
|
||||
'$dtstart_title' => $dtstart_title,
|
||||
'$dtstart_dt' => $dtstart_dt,
|
||||
'$finish' => $finish,
|
||||
'$dtend_label' => t('Finishes:'),
|
||||
'$dtend_label' => L10n::t('Finishes:'),
|
||||
'$dtend_title' => $dtend_title,
|
||||
'$dtend_dt' => $dtend_dt,
|
||||
'$month_short' => $month_short,
|
||||
|
@ -989,10 +990,10 @@ function format_event_item($item) {
|
|||
'$author_link' => $profile_link,
|
||||
'$author_avatar' => $item['author-avatar'],
|
||||
'$description' => prepare_text($item['event-desc']),
|
||||
'$location_label' => t('Location:'),
|
||||
'$show_map_label' => t('Show map'),
|
||||
'$hide_map_label' => t('Hide map'),
|
||||
'$map_btn_label' => t('Show map'),
|
||||
'$location_label' => L10n::t('Location:'),
|
||||
'$show_map_label' => L10n::t('Show map'),
|
||||
'$hide_map_label' => L10n::t('Hide map'),
|
||||
'$map_btn_label' => L10n::t('Show map'),
|
||||
'$location' => $location
|
||||
]);
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ use Friendica\App;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Core\System;
|
||||
|
@ -1495,7 +1496,7 @@ function new_follower($importer, $contact, $datarray, $item, $sharing = false) {
|
|||
'to_email' => $r[0]['email'],
|
||||
'uid' => $r[0]['uid'],
|
||||
'link' => System::baseUrl() . '/notifications/intro',
|
||||
'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : t('[Name Withheld]')),
|
||||
'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : L10n::t('[Name Withheld]')),
|
||||
'source_link' => $contact_record['url'],
|
||||
'source_photo' => $contact_record['photo'],
|
||||
'verb' => ($sharing ? ACTIVITY_FRIEND : ACTIVITY_FOLLOW),
|
||||
|
@ -1867,7 +1868,7 @@ function drop_item($id) {
|
|||
);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(t('Item not found.') . EOL);
|
||||
notice(L10n::t('Item not found.') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
|
||||
}
|
||||
|
||||
|
@ -1907,12 +1908,12 @@ function drop_item($id) {
|
|||
|
||||
return replace_macros(get_markup_template('confirm.tpl'), [
|
||||
'$method' => 'get',
|
||||
'$message' => t('Do you really want to delete this item?'),
|
||||
'$message' => L10n::t('Do you really want to delete this item?'),
|
||||
'$extra_inputs' => $inputs,
|
||||
'$confirm' => t('Yes'),
|
||||
'$confirm' => L10n::t('Yes'),
|
||||
'$confirm_url' => $query['base'],
|
||||
'$confirm_name' => 'confirmed',
|
||||
'$cancel' => t('Cancel'),
|
||||
'$cancel' => L10n::t('Cancel'),
|
||||
]);
|
||||
}
|
||||
// Now check how the user responded to the confirmation query
|
||||
|
@ -1926,7 +1927,7 @@ function drop_item($id) {
|
|||
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
|
||||
//NOTREACHED
|
||||
} else {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
|
||||
//NOTREACHED
|
||||
}
|
||||
|
@ -2015,13 +2016,13 @@ function posted_date_widget($url, $uid, $wall) {
|
|||
$cutoff = ((array_key_exists($cutoff_year, $ret))? true : false);
|
||||
|
||||
$o = replace_macros(get_markup_template('posted_date_widget.tpl'),[
|
||||
'$title' => t('Archives'),
|
||||
'$title' => L10n::t('Archives'),
|
||||
'$size' => $visible_years,
|
||||
'$cutoff_year' => $cutoff_year,
|
||||
'$cutoff' => $cutoff,
|
||||
'$url' => $url,
|
||||
'$dates' => $ret,
|
||||
'$showmore' => t('show more')
|
||||
'$showmore' => L10n::t('show more')
|
||||
|
||||
]);
|
||||
return $o;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file include/like.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -31,31 +34,31 @@ function do_like($item_id, $verb) {
|
|||
|
||||
switch ($verb) {
|
||||
case 'like':
|
||||
$bodyverb = t('%1$s likes %2$s\'s %3$s');
|
||||
$bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
|
||||
$activity = ACTIVITY_LIKE;
|
||||
break;
|
||||
case 'unlike':
|
||||
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
|
||||
$bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
|
||||
$activity = ACTIVITY_LIKE;
|
||||
break;
|
||||
case 'dislike':
|
||||
case 'undislike':
|
||||
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
|
||||
$bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
|
||||
$activity = ACTIVITY_DISLIKE;
|
||||
break;
|
||||
case 'attendyes':
|
||||
case 'unattendyes':
|
||||
$bodyverb = t('%1$s is attending %2$s\'s %3$s');
|
||||
$bodyverb = L10n::t('%1$s is attending %2$s\'s %3$s');
|
||||
$activity = ACTIVITY_ATTEND;
|
||||
break;
|
||||
case 'attendno':
|
||||
case 'unattendno':
|
||||
$bodyverb = t('%1$s is not attending %2$s\'s %3$s');
|
||||
$bodyverb = L10n::t('%1$s is not attending %2$s\'s %3$s');
|
||||
$activity = ACTIVITY_ATTENDNO;
|
||||
break;
|
||||
case 'attendmaybe':
|
||||
case 'unattendmaybe':
|
||||
$bodyverb = t('%1$s may attend %2$s\'s %3$s');
|
||||
$bodyverb = L10n::t('%1$s may attend %2$s\'s %3$s');
|
||||
$activity = ACTIVITY_ATTENDMAYBE;
|
||||
break;
|
||||
default:
|
||||
|
@ -185,9 +188,9 @@ function do_like($item_id, $verb) {
|
|||
}
|
||||
|
||||
// Else or if event verb different from existing row, create a new item row
|
||||
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
|
||||
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
|
||||
if ($item['object-type'] === ACTIVITY_OBJ_EVENT) {
|
||||
$post_type = t('event');
|
||||
$post_type = L10n::t('event');
|
||||
}
|
||||
$objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ;
|
||||
$link = xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . '" />' . "\n") ;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Network\Probe;
|
||||
|
@ -737,7 +738,7 @@ function scale_external_images($srctext, $include_link = true, $scale_replace =
|
|||
$mtch[0],
|
||||
'[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]'
|
||||
. "\n" . (($include_link)
|
||||
? '[url=' . $mtch[1] . ']' . t('view full size') . '[/url]' . "\n"
|
||||
? '[url=' . $mtch[1] . ']' . L10n::t('view full size') . '[/url]' . "\n"
|
||||
: ''),
|
||||
$s
|
||||
);
|
||||
|
|
|
@ -1,233 +0,0 @@
|
|||
<?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;
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file include/security.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -74,10 +77,10 @@ function authenticate_success($user_record, $login_initial = false, $interactive
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -401,7 +404,7 @@ function check_form_security_token($typename = '', $formname = 'form_security_to
|
|||
|
||||
function check_form_security_std_err_msg()
|
||||
{
|
||||
return t('The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it.') . EOL;
|
||||
return L10n::t('The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it.') . EOL;
|
||||
}
|
||||
|
||||
function check_form_security_token_redirectOnErr($err_redirect, $typename = '', $formname = 'form_security_token')
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file include/tags.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -239,7 +239,7 @@ function wtagblock($uid, $count = 0, $owner_id = 0, $flags = '', $type = TERM_HA
|
|||
|
||||
$tpl = get_markup_template('tagblock_widget.tpl');
|
||||
$o = replace_macros($tpl, [
|
||||
'$title' => t('Tags'),
|
||||
'$title' => L10n::t('Tags'),
|
||||
'$tags' => $tags
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ use Friendica\Content\Feature;
|
|||
use Friendica\Content\Smilies;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -294,14 +295,14 @@ function paginate_data(App $a, $count = null) {
|
|||
if (!is_null($count)) {
|
||||
// minimal pager (newer / older)
|
||||
$data['class'] = 'pager';
|
||||
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), t('newer'), 'previous' . ($a->pager['page'] == 1 ? ' disabled' : ''));
|
||||
_l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), t('older'), 'next' . ($count <= 0 ? ' disabled' : ''));
|
||||
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), L10n::t('newer'), 'previous' . ($a->pager['page'] == 1 ? ' disabled' : ''));
|
||||
_l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), L10n::t('older'), 'next' . ($count <= 0 ? ' disabled' : ''));
|
||||
} else {
|
||||
// full pager (first / prev / 1 / 2 / ... / 14 / 15 / next / last)
|
||||
$data['class'] = 'pagination';
|
||||
if ($a->pager['total'] > $a->pager['itemspage']) {
|
||||
_l($data, 'first', $url . '&page=1', t('first'), $a->pager['page'] == 1 ? 'disabled' : '');
|
||||
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), t('prev'), $a->pager['page'] == 1 ? 'disabled' : '');
|
||||
_l($data, 'first', $url . '&page=1', L10n::t('first'), $a->pager['page'] == 1 ? 'disabled' : '');
|
||||
_l($data, 'prev', $url . '&page=' . ($a->pager['page'] - 1), L10n::t('prev'), $a->pager['page'] == 1 ? 'disabled' : '');
|
||||
|
||||
$numpages = $a->pager['total'] / $a->pager['itemspage'];
|
||||
|
||||
|
@ -335,8 +336,8 @@ function paginate_data(App $a, $count = null) {
|
|||
$data['pages'] = $pages;
|
||||
|
||||
$lastpage = (($numpages > intval($numpages)) ? intval($numpages)+1 : $numpages);
|
||||
_l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), t('next'), $a->pager['page'] == $lastpage ? 'disabled' : '');
|
||||
_l($data, 'last', $url . '&page=' . $lastpage, t('last'), $a->pager['page'] == $lastpage ? 'disabled' : '');
|
||||
_l($data, 'next', $url . '&page=' . ($a->pager['page'] + 1), L10n::t('next'), $a->pager['page'] == $lastpage ? 'disabled' : '');
|
||||
_l($data, 'last', $url . '&page=' . $lastpage, L10n::t('last'), $a->pager['page'] == $lastpage ? 'disabled' : '');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,8 +391,8 @@ function alt_pager(App $a, $i) {
|
|||
function scroll_loader() {
|
||||
$tpl = get_markup_template("scroll_loader.tpl");
|
||||
return replace_macros($tpl, [
|
||||
'wait' => t('Loading more entries...'),
|
||||
'end' => t('The end')
|
||||
'wait' => L10n::t('Loading more entries...'),
|
||||
'end' => L10n::t('The end')
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -927,7 +928,7 @@ function contact_block() {
|
|||
$total = intval($r[0]['total']);
|
||||
}
|
||||
if (!$total) {
|
||||
$contacts = t('No contacts');
|
||||
$contacts = L10n::t('No contacts');
|
||||
$micropro = null;
|
||||
} else {
|
||||
// Splitting the query in two parts makes it much faster
|
||||
|
@ -951,10 +952,10 @@ function contact_block() {
|
|||
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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -964,7 +965,7 @@ function contact_block() {
|
|||
$o = replace_macros($tpl, [
|
||||
'$contacts' => $contacts,
|
||||
'$nickname' => $a->profile['nickname'],
|
||||
'$viewcontacts' => t('View Contacts'),
|
||||
'$viewcontacts' => L10n::t('View Contacts'),
|
||||
'$micropro' => $micropro,
|
||||
]);
|
||||
|
||||
|
@ -1053,27 +1054,27 @@ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside =
|
|||
if (strpos($s, '#') === 0) {
|
||||
$mode = 'tag';
|
||||
}
|
||||
$save_label = $mode === 'text' ? t('Save') : t('Follow');
|
||||
$save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow');
|
||||
|
||||
$values = [
|
||||
'$s' => htmlspecialchars($s),
|
||||
'$id' => $id,
|
||||
'$action_url' => $url,
|
||||
'$search_label' => t('Search'),
|
||||
'$search_label' => L10n::t('Search'),
|
||||
'$save_label' => $save_label,
|
||||
'$savedsearch' => Feature::isEnabled(local_user(),'savedsearch'),
|
||||
'$search_hint' => t('@name, !forum, #tags, content'),
|
||||
'$search_hint' => L10n::t('@name, !forum, #tags, content'),
|
||||
'$mode' => $mode
|
||||
];
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1117,12 +1118,12 @@ function get_poke_verbs() {
|
|||
// value is array containing past tense verb, translation of present, translation of past
|
||||
|
||||
$arr = [
|
||||
'poke' => ['poked', t('poke'), t('poked')],
|
||||
'ping' => ['pinged', t('ping'), t('pinged')],
|
||||
'prod' => ['prodded', t('prod'), t('prodded')],
|
||||
'slap' => ['slapped', t('slap'), t('slapped')],
|
||||
'finger' => ['fingered', t('finger'), t('fingered')],
|
||||
'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')],
|
||||
'poke' => ['poked', L10n::t('poke'), L10n::t('poked')],
|
||||
'ping' => ['pinged', L10n::t('ping'), L10n::t('pinged')],
|
||||
'prod' => ['prodded', L10n::t('prod'), L10n::t('prodded')],
|
||||
'slap' => ['slapped', L10n::t('slap'), L10n::t('slapped')],
|
||||
'finger' => ['fingered', L10n::t('finger'), L10n::t('fingered')],
|
||||
'rebuff' => ['rebuffed', L10n::t('rebuff'), L10n::t('rebuffed')],
|
||||
];
|
||||
Addon::callHooks('poke_verbs', $arr);
|
||||
return $arr;
|
||||
|
@ -1136,11 +1137,11 @@ function get_poke_verbs() {
|
|||
*/
|
||||
function day_translate($s) {
|
||||
$ret = str_replace(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
|
||||
[t('Monday'), t('Tuesday'), t('Wednesday'), t('Thursday'), t('Friday'), t('Saturday'), t('Sunday')],
|
||||
[L10n::t('Monday'), L10n::t('Tuesday'), L10n::t('Wednesday'), L10n::t('Thursday'), L10n::t('Friday'), L10n::t('Saturday'), L10n::t('Sunday')],
|
||||
$s);
|
||||
|
||||
$ret = str_replace(['January','February','March','April','May','June','July','August','September','October','November','December'],
|
||||
[t('January'), t('February'), t('March'), t('April'), t('May'), t('June'), t('July'), t('August'), t('September'), t('October'), t('November'), t('December')],
|
||||
[L10n::t('January'), L10n::t('February'), L10n::t('March'), L10n::t('April'), L10n::t('May'), L10n::t('June'), L10n::t('July'), L10n::t('August'), L10n::t('September'), L10n::t('October'), L10n::t('November'), L10n::t('December')],
|
||||
$ret);
|
||||
|
||||
return $ret;
|
||||
|
@ -1154,10 +1155,10 @@ function day_translate($s) {
|
|||
*/
|
||||
function day_short_translate($s) {
|
||||
$ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
[t('Mon'), t('Tue'), t('Wed'), t('Thu'), t('Fri'), t('Sat'), t('Sun')],
|
||||
[L10n::t('Mon'), L10n::t('Tue'), L10n::t('Wed'), L10n::t('Thu'), L10n::t('Fri'), L10n::t('Sat'), L10n::t('Sun')],
|
||||
$s);
|
||||
$ret = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov','Dec'],
|
||||
[t('Jan'), t('Feb'), t('Mar'), t('Apr'), t('May'), ('Jun'), t('Jul'), t('Aug'), t('Sep'), t('Oct'), t('Nov'), t('Dec')],
|
||||
[L10n::t('Jan'), L10n::t('Feb'), L10n::t('Mar'), L10n::t('Apr'), L10n::t('May'), ('Jun'), L10n::t('Jul'), L10n::t('Aug'), L10n::t('Sep'), L10n::t('Oct'), L10n::t('Nov'), L10n::t('Dec')],
|
||||
$ret);
|
||||
return $ret;
|
||||
}
|
||||
|
@ -1358,7 +1359,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
|
|||
$as .= replace_macros(get_markup_template('video_top.tpl'), [
|
||||
'$video' => [
|
||||
'id' => $id,
|
||||
'title' => t('View Video'),
|
||||
'title' => L10n::t('View Video'),
|
||||
'src' => $the_url,
|
||||
'mime' => $mime,
|
||||
],
|
||||
|
@ -1375,7 +1376,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
|
|||
}
|
||||
|
||||
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
|
||||
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
|
||||
$title .= ' ' . $mtch[2] . ' ' . L10n::t('bytes');
|
||||
|
||||
$icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
|
||||
$as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
|
||||
|
@ -1410,7 +1411,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
|
|||
while ((strpos($s, $spoilersearch) !== false)) {
|
||||
$pos = strpos($s, $spoilersearch);
|
||||
$rnd = random_string(8);
|
||||
$spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" class="spoiler-wrap fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>'.
|
||||
$spoilerreplace = '<br /> <span id="spoiler-wrap-' . $rnd . '" class="spoiler-wrap fakelink" onclick="openClose(\'spoiler-' . $rnd . '\');">' . L10n::t('Click to open/close') . '</span>'.
|
||||
'<blockquote class="spoiler" id="spoiler-' . $rnd . '" style="display: none;">';
|
||||
$s = substr($s, 0, $pos) . $spoilerreplace . substr($s, $pos + strlen($spoilersearch));
|
||||
}
|
||||
|
@ -1421,7 +1422,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
|
|||
while ((strpos($s, $authorsearch) !== false)) {
|
||||
$pos = strpos($s, $authorsearch);
|
||||
$rnd = random_string(8);
|
||||
$authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" class="author-wrap fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . sprintf(t('Click to open/close')) . '</span>'.
|
||||
$authorreplace = '<br /> <span id="author-wrap-' . $rnd . '" class="author-wrap fakelink" onclick="openClose(\'author-' . $rnd . '\');">' . L10n::t('Click to open/close') . '</span>'.
|
||||
'<blockquote class="author" id="author-' . $rnd . '" style="display: block;">';
|
||||
$s = substr($s, 0, $pos) . $authorreplace . substr($s, $pos + strlen($authorsearch));
|
||||
}
|
||||
|
@ -1548,20 +1549,20 @@ function get_plink($item) {
|
|||
//'href' => "display/" . $a->user['nickname'] . "/" . $item['id'],
|
||||
'href' => "display/" . $item['guid'],
|
||||
'orig' => "display/" . $item['guid'],
|
||||
'title' => t('View on separate page'),
|
||||
'orig_title' => t('view on separate page'),
|
||||
'title' => L10n::t('View on separate page'),
|
||||
'orig_title' => L10n::t('view on separate page'),
|
||||
];
|
||||
|
||||
if (x($item, 'plink')) {
|
||||
$ret["href"] = $a->remove_baseurl($item['plink']);
|
||||
$ret["title"] = t('link to source');
|
||||
$ret["title"] = L10n::t('link to source');
|
||||
}
|
||||
|
||||
} elseif (x($item, 'plink') && ($item['private'] != 1)) {
|
||||
$ret = [
|
||||
'href' => $item['plink'],
|
||||
'orig' => $item['plink'],
|
||||
'title' => t('link to source'),
|
||||
'title' => L10n::t('link to source'),
|
||||
];
|
||||
} else {
|
||||
$ret = [];
|
||||
|
@ -1763,16 +1764,16 @@ function reltoabs($text, $base) {
|
|||
*/
|
||||
function item_post_type($item) {
|
||||
if (intval($item['event-id'])) {
|
||||
return t('event');
|
||||
return L10n::t('event');
|
||||
} elseif (strlen($item['resource-id'])) {
|
||||
return t('photo');
|
||||
return L10n::t('photo');
|
||||
} elseif (strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST) {
|
||||
return t('activity');
|
||||
return L10n::t('activity');
|
||||
} elseif ($item['id'] != $item['parent']) {
|
||||
return t('comment');
|
||||
return L10n::t('comment');
|
||||
}
|
||||
|
||||
return t('post');
|
||||
return L10n::t('post');
|
||||
}
|
||||
|
||||
// post categories and "save to file" use the same item.file table for storage.
|
||||
|
@ -1935,7 +1936,7 @@ function file_tag_save_file($uid, $item, $file)
|
|||
if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) {
|
||||
PConfig::set($uid, 'system', 'filetags', $saved . '[' . file_tag_encode($file) . ']');
|
||||
}
|
||||
info(t('Item filed'));
|
||||
info(L10n::t('Item filed'));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
19
index.php
19
index.php
|
@ -15,6 +15,7 @@ use Friendica\Core\Addon;
|
|||
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;
|
||||
|
@ -83,9 +84,9 @@ if (!$install) {
|
|||
$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.
|
||||
|
@ -121,7 +122,7 @@ if (x($_SESSION, 'authenticated') && !x($_SESSION, 'language')) {
|
|||
|
||||
if ((x($_SESSION, 'language')) && ($_SESSION['language'] !== $lang)) {
|
||||
$lang = $_SESSION['language'];
|
||||
load_translation_table($lang);
|
||||
L10n::loadTranslationTable($lang);
|
||||
}
|
||||
|
||||
if ((x($_GET, 'zrl')) && (!$install && !$maintenance)) {
|
||||
|
@ -246,7 +247,7 @@ if (strlen($a->module)) {
|
|||
if (is_array($a->addons) && in_array($a->module, $a->addons) && file_exists("addon/{$a->module}/{$a->module}.php")) {
|
||||
//Check if module is an app and if public access to apps is allowed or not
|
||||
if ((!local_user()) && Addon::isApp($a->module) && $privateapps === "1") {
|
||||
info(t("You must be logged in to use addons. "));
|
||||
info(L10n::t("You must be logged in to use addons. "));
|
||||
} else {
|
||||
include_once "addon/{$a->module}/{$a->module}.php";
|
||||
if (function_exists($a->module . '_module')) {
|
||||
|
@ -293,12 +294,12 @@ if (strlen($a->module)) {
|
|||
}
|
||||
|
||||
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
|
||||
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . L10n::t('Not Found'));
|
||||
$tpl = get_markup_template("404.tpl");
|
||||
$a->page['content'] = replace_macros(
|
||||
$tpl,
|
||||
[
|
||||
'$message' => t('Page not found.')]
|
||||
'$message' => L10n::t('Page not found.')]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -416,8 +417,8 @@ if (isset($homebase)) {
|
|||
* now that we've been through the module content, see if the page reported
|
||||
* a permission problem and if so, a 403 response would seem to be in order.
|
||||
*/
|
||||
if (stristr(implode("", $_SESSION['sysmsg']), t('Permission denied'))) {
|
||||
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.'));
|
||||
if (stristr(implode("", $_SESSION['sysmsg']), L10n::t('Permission denied'))) {
|
||||
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . L10n::t('Permission denied.'));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -445,7 +446,7 @@ if ($a->is_mobile || $a->is_tablet) {
|
|||
get_markup_template("toggle_mobile_footer.tpl"),
|
||||
[
|
||||
'$toggle_link' => $link,
|
||||
'$toggle_text' => t('toggle mobile')]
|
||||
'$toggle_text' => L10n::t('toggle mobile')]
|
||||
);
|
||||
}
|
||||
|
||||
|
|
629
mod/admin.php
629
mod/admin.php
File diff suppressed because it is too large
Load diff
|
@ -4,12 +4,12 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GContact;
|
||||
use Friendica\Model\Profile;
|
||||
use dba;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
require_once 'mod/contacts.php';
|
||||
|
@ -18,7 +18,7 @@ function allfriends_content(App $a)
|
|||
{
|
||||
$o = '';
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ function allfriends_content(App $a)
|
|||
|
||||
$r = GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
|
||||
if (!DBM::is_result($r)) {
|
||||
$o .= t('No friends to display.');
|
||||
$o .= L10n::t('No friends to display.');
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -70,8 +70,8 @@ function allfriends_content(App $a)
|
|||
} else {
|
||||
$connlnk = System::baseUrl() . '/follow/?url=' . $rr['url'];
|
||||
$photo_menu = [
|
||||
'profile' => [t("View Profile"), Profile::zrl($rr['url'])],
|
||||
'follow' => [t("Connect/Follow"), $connlnk]
|
||||
'profile' => [L10n::t("View Profile"), Profile::zrl($rr['url'])],
|
||||
'follow' => [L10n::t("Connect/Follow"), $connlnk]
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ function allfriends_content(App $a)
|
|||
'account_type' => Contact::getAccountType($contact_details),
|
||||
'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
|
||||
'photo_menu' => $photo_menu,
|
||||
'conntxt' => t('Connect'),
|
||||
'conntxt' => L10n::t('Connect'),
|
||||
'connlnk' => $connlnk,
|
||||
'id' => ++$id,
|
||||
];
|
||||
|
@ -99,7 +99,7 @@ function allfriends_content(App $a)
|
|||
$tpl = get_markup_template('viewcontact_template.tpl');
|
||||
|
||||
$o .= replace_macros($tpl, [
|
||||
//'$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])),
|
||||
//'$title' => L10n::t('Friends of %s', htmlentities($c[0]['name'])),
|
||||
'$tab_str' => $tab_str,
|
||||
'$contacts' => $entries,
|
||||
'$paginate' => paginate($a),
|
||||
|
|
28
mod/api.php
28
mod/api.php
|
@ -1,11 +1,14 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/api.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Module\Login;
|
||||
|
||||
require_once('include/api.php');
|
||||
require_once 'include/api.php';
|
||||
|
||||
function oauth_get_client($request)
|
||||
{
|
||||
|
@ -19,8 +22,9 @@ function oauth_get_client($request)
|
|||
WHERE `clients`.`client_id`=`tokens`.`client_id`
|
||||
AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'", dbesc($token));
|
||||
|
||||
if (!DBM::is_result($r))
|
||||
if (!DBM::is_result($r)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $r[0];
|
||||
}
|
||||
|
@ -28,12 +32,12 @@ function oauth_get_client($request)
|
|||
function api_post(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -78,8 +82,8 @@ function api_content(App $a)
|
|||
|
||||
$tpl = get_markup_template("oauth_authorize_done.tpl");
|
||||
$o = replace_macros($tpl, [
|
||||
'$title' => t('Authorize application connection'),
|
||||
'$info' => t('Return to your app and insert this Securty Code:'),
|
||||
'$title' => L10n::t('Authorize application connection'),
|
||||
'$info' => L10n::t('Return to your app and insert this Securty Code:'),
|
||||
'$code' => $verifier,
|
||||
]);
|
||||
|
||||
|
@ -88,7 +92,7 @@ function api_content(App $a)
|
|||
|
||||
if (!local_user()) {
|
||||
/// @TODO We need login form to redirect to this page
|
||||
notice(t('Please login to continue.') . EOL);
|
||||
notice(L10n::t('Please login to continue.') . EOL);
|
||||
return Login::form($a->query_string, false, $request->get_parameters());
|
||||
}
|
||||
//FKOAuth1::loginUser(4);
|
||||
|
@ -100,11 +104,11 @@ function api_content(App $a)
|
|||
|
||||
$tpl = get_markup_template('oauth_authorize.tpl');
|
||||
$o = replace_macros($tpl, [
|
||||
'$title' => t('Authorize application connection'),
|
||||
'$title' => L10n::t('Authorize application connection'),
|
||||
'$app' => $app,
|
||||
'$authorize' => t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
|
||||
'$yes' => t('Yes'),
|
||||
'$no' => t('No'),
|
||||
'$authorize' => L10n::t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
|
||||
'$yes' => L10n::t('Yes'),
|
||||
'$no' => L10n::t('No'),
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
|
14
mod/apps.php
14
mod/apps.php
|
@ -1,21 +1,25 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/apps.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
function apps_content(App $a) {
|
||||
function apps_content(App $a)
|
||||
{
|
||||
$privateaddons = Config::get('config', 'private_addons');
|
||||
if ($privateaddons === "1") {
|
||||
if (! local_user()) {
|
||||
info(t('You must be logged in to use addons. '));
|
||||
info(L10n::t('You must be logged in to use addons. '));
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
$title = t('Applications');
|
||||
$title = L10n::t('Applications');
|
||||
|
||||
if (count($a->apps) == 0) {
|
||||
notice(t('No installed applications.') . EOL);
|
||||
notice(L10n::t('No installed applications.') . EOL);
|
||||
}
|
||||
|
||||
$tpl = get_markup_template('apps.tpl');
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/attach.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once 'include/dba.php';
|
||||
require_once 'include/security.php';
|
||||
|
||||
function attach_init(App $a) {
|
||||
|
||||
if($a->argc != 2) {
|
||||
notice( t('Item not available.') . EOL);
|
||||
function attach_init(App $a)
|
||||
{
|
||||
if ($a->argc != 2) {
|
||||
notice(L10n::t('Item not available.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -16,15 +20,13 @@ function attach_init(App $a) {
|
|||
|
||||
// Check for existence, which will also provide us the owner uid
|
||||
|
||||
$r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1",
|
||||
intval($item_id)
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Item was not found.'). EOL);
|
||||
$r = dba::selectFirst('attach', [], ['id' => $item_id]);
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(L10n::t('Item was not found.'). EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$sql_extra = permissions_sql($r[0]['uid']);
|
||||
$sql_extra = permissions_sql($r['uid']);
|
||||
|
||||
// Now we'll see if we can access the attachment
|
||||
|
||||
|
@ -32,8 +34,8 @@ function attach_init(App $a) {
|
|||
dbesc($item_id)
|
||||
);
|
||||
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -41,10 +43,11 @@ function attach_init(App $a) {
|
|||
// error in Chrome for filenames with commas in them
|
||||
header('Content-type: ' . $r[0]['filetype']);
|
||||
header('Content-length: ' . $r[0]['filesize']);
|
||||
if(isset($_GET['attachment']) && $_GET['attachment'] === '0')
|
||||
if (isset($_GET['attachment']) && $_GET['attachment'] === '0') {
|
||||
header('Content-disposition: filename="' . $r[0]['filename'] . '"');
|
||||
else
|
||||
} else {
|
||||
header('Content-disposition: attachment; filename="' . $r[0]['filename'] . '"');
|
||||
}
|
||||
|
||||
echo $r[0]['data'];
|
||||
killme();
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<?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)
|
||||
{
|
||||
|
@ -17,14 +19,14 @@ function babel_content()
|
|||
$o = '<h1>Babel Diagnostic</h1>';
|
||||
|
||||
$o .= '<form action="babel" method="post">';
|
||||
$o .= t('Source (bbcode) text:') . EOL;
|
||||
$o .= L10n::t('Source (bbcode) text:') . EOL;
|
||||
$o .= '<textarea name="text" cols="80" rows="10">' . htmlspecialchars($_REQUEST['text']) . '</textarea>' . EOL;
|
||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||
|
||||
$o .= '<br /><br />';
|
||||
|
||||
$o .= '<form action="babel" method="post">';
|
||||
$o .= t('Source (Diaspora) text to convert to BBcode:') . EOL;
|
||||
$o .= L10n::t('Source (Diaspora) text to convert to BBcode:') . EOL;
|
||||
$o .= '<textarea name="d2bbtext" cols="80" rows="10">' . htmlspecialchars($_REQUEST['d2bbtext']) . '</textarea>' . EOL;
|
||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||
|
||||
|
@ -32,45 +34,45 @@ function babel_content()
|
|||
|
||||
if (x($_REQUEST, 'text')) {
|
||||
$text = trim($_REQUEST['text']);
|
||||
$o .= '<h2>' . t('Source input: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('Source input: ') . '</h2>' . EOL . EOL;
|
||||
$o .= visible_lf($text) . EOL . EOL;
|
||||
|
||||
$html = bbcode($text);
|
||||
$o .= '<h2>' . t('bbcode (raw HTML): ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bbcode (raw HTML): ') . '</h2>' . EOL . EOL;
|
||||
$o .= htmlspecialchars($html) . EOL . EOL;
|
||||
|
||||
//$html = bbcode($text);
|
||||
$o .= '<h2>' . t('bbcode: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bbcode: ') . '</h2>' . EOL . EOL;
|
||||
$o .= $html . EOL . EOL;
|
||||
|
||||
$bbcode = html2bbcode($html);
|
||||
$o .= '<h2>' . t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL;
|
||||
$o .= visible_lf($bbcode) . EOL . EOL;
|
||||
|
||||
$diaspora = bb2diaspora($text);
|
||||
$o .= '<h2>' . t('bb2diaspora: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bb2diaspora: ') . '</h2>' . EOL . EOL;
|
||||
$o .= visible_lf($diaspora) . EOL . EOL;
|
||||
|
||||
$html = Markdown::convert($diaspora);
|
||||
$o .= '<h2>' . t('bb2diaspora => Markdown: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bb2diaspora => Markdown: ') . '</h2>' . EOL . EOL;
|
||||
$o .= $html . EOL . EOL;
|
||||
|
||||
$bbcode = diaspora2bb($diaspora);
|
||||
$o .= '<h2>' . t('bb2diaspora => diaspora2bb: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bb2diaspora => diaspora2bb: ') . '</h2>' . EOL . EOL;
|
||||
$o .= visible_lf($bbcode) . EOL . EOL;
|
||||
|
||||
$bbcode = html2bbcode($html);
|
||||
$o .= '<h2>' . t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('bbcode => html2bbcode: ') . '</h2>' . EOL . EOL;
|
||||
$o .= visible_lf($bbcode) . EOL . EOL;
|
||||
}
|
||||
|
||||
if (x($_REQUEST, 'd2bbtext')) {
|
||||
$d2bbtext = trim($_REQUEST['d2bbtext']);
|
||||
$o .= '<h2>' . t('Source input (Diaspora format): ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('Source input (Diaspora format): ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<pre>' . $d2bbtext . '</pre>' . EOL . EOL;
|
||||
|
||||
$bb = diaspora2bb($d2bbtext);
|
||||
$o .= '<h2>' . t('diaspora2bb: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<h2>' . L10n::t('diaspora2bb: ') . '</h2>' . EOL . EOL;
|
||||
$o .= '<pre>' . $bb . '</pre>' . EOL . EOL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/bookmarklet.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Module\Login;
|
||||
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/items.php');
|
||||
require_once 'include/conversation.php';
|
||||
require_once 'include/items.php';
|
||||
|
||||
function bookmarklet_init()
|
||||
{
|
||||
|
@ -15,7 +18,7 @@ function bookmarklet_init()
|
|||
function bookmarklet_content(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
$o = '<h2>' . t('Login') . '</h2>';
|
||||
$o = '<h2>' . L10n::t('Login') . '</h2>';
|
||||
$o .= Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? false : true);
|
||||
return $o;
|
||||
}
|
||||
|
@ -43,7 +46,7 @@ function bookmarklet_content(App $a)
|
|||
$o = status_editor($a, $x, 0, false);
|
||||
$o .= "<script>window.resizeTo(800,550);</script>";
|
||||
} else {
|
||||
$o = '<h2>' . t('The post was created') . '</h2>';
|
||||
$o = '<h2>' . L10n::t('The post was created') . '</h2>';
|
||||
$o .= "<script>window.close()</script>";
|
||||
}
|
||||
|
||||
|
|
31
mod/cal.php
31
mod/cal.php
|
@ -9,6 +9,7 @@ use Friendica\App;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -135,7 +136,7 @@ function cal_content(App $a)
|
|||
$is_owner = local_user() == $a->profile['profile_uid'];
|
||||
|
||||
if ($a->profile['hidewall'] && (!$is_owner) && (!$remote_contact)) {
|
||||
notice(t('Access to this profile has been restricted.') . EOL);
|
||||
notice(L10n::t('Access to this profile has been restricted.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -267,17 +268,17 @@ function cal_content(App $a)
|
|||
$o = replace_macros($tpl, [
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$tabs' => $tabs,
|
||||
'$title' => t('Events'),
|
||||
'$view' => t('View'),
|
||||
'$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", t('Previous'), '', ''],
|
||||
'$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", t('Next'), '', ''],
|
||||
'$title' => L10n::t('Events'),
|
||||
'$view' => L10n::t('View'),
|
||||
'$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", L10n::t('Previous'), '', ''],
|
||||
'$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", L10n::t('Next'), '', ''],
|
||||
'$calendar' => cal($y, $m, $links, ' eventcal'),
|
||||
'$events' => $events,
|
||||
"today" => t("today"),
|
||||
"month" => t("month"),
|
||||
"week" => t("week"),
|
||||
"day" => t("day"),
|
||||
"list" => t("list"),
|
||||
"today" => L10n::t("today"),
|
||||
"month" => L10n::t("month"),
|
||||
"week" => L10n::t("week"),
|
||||
"day" => L10n::t("day"),
|
||||
"list" => L10n::t("list"),
|
||||
]);
|
||||
|
||||
if (x($_GET, 'id')) {
|
||||
|
@ -290,14 +291,14 @@ function cal_content(App $a)
|
|||
|
||||
if ($mode == 'export') {
|
||||
if (!(intval($owner_uid))) {
|
||||
notice(t('User not found'));
|
||||
notice(L10n::t('User not found'));
|
||||
return;
|
||||
}
|
||||
|
||||
// Test permissions
|
||||
// Respect the export feature setting for all other /cal pages if it's not the own profile
|
||||
if (((local_user() !== intval($owner_uid))) && !Feature::isEnabled($owner_uid, "export_calendar")) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway('cal/' . $nick);
|
||||
}
|
||||
|
||||
|
@ -306,9 +307,9 @@ function cal_content(App $a)
|
|||
|
||||
if (!$evexport["success"]) {
|
||||
if ($evexport["content"]) {
|
||||
notice(t('This calendar format is not supported'));
|
||||
notice(L10n::t('This calendar format is not supported'));
|
||||
} else {
|
||||
notice(t('No exportable data found'));
|
||||
notice(L10n::t('No exportable data found'));
|
||||
}
|
||||
|
||||
// If it the own calendar return to the events page
|
||||
|
@ -325,7 +326,7 @@ function cal_content(App $a)
|
|||
// If nothing went wrong we can echo the export content
|
||||
if ($evexport["success"]) {
|
||||
header('Content-type: text/calendar');
|
||||
header('content-disposition: attachment; filename="' . t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
|
||||
header('content-disposition: attachment; filename="' . L10n::t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
|
||||
echo $evexport["content"];
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GContact;
|
||||
use Friendica\Model\Profile;
|
||||
use dba;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
require_once 'mod/contacts.php';
|
||||
|
@ -23,7 +23,7 @@ function common_content(App $a)
|
|||
$zcid = 0;
|
||||
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ function common_content(App $a)
|
|||
if ($t > 0) {
|
||||
$a->set_pager_total($t);
|
||||
} else {
|
||||
notice(t('No contacts in common.') . EOL);
|
||||
notice(L10n::t('No contacts in common.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ function common_content(App $a)
|
|||
if ($cmd === 'loc' && $cid && local_user() == $uid) {
|
||||
$tab_str = contacts_tab($a, $cid, 4);
|
||||
} else {
|
||||
$title = t('Common Friends');
|
||||
$title = L10n::t('Common Friends');
|
||||
}
|
||||
|
||||
$tpl = get_markup_template('viewcontact_template.tpl');
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
|
@ -21,7 +22,7 @@ function community_content(App $a, $update = 0)
|
|||
$o = '';
|
||||
|
||||
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
|
||||
notice(t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -30,7 +31,7 @@ function community_content(App $a, $update = 0)
|
|||
if ($a->argc > 1) {
|
||||
$content = $a->argv[1];
|
||||
} else {
|
||||
if (!empty(Config::get('system','singleuser'))) {
|
||||
if (!empty(Config::get('system', 'singleuser'))) {
|
||||
// On single user systems only the global page does make sense
|
||||
$content = 'global';
|
||||
} else {
|
||||
|
@ -40,7 +41,7 @@ function community_content(App $a, $update = 0)
|
|||
}
|
||||
|
||||
if (!in_array($content, ['local', 'global'])) {
|
||||
notice(t('Community option not available.') . EOL);
|
||||
notice(L10n::t('Community option not available.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -57,7 +58,7 @@ function community_content(App $a, $update = 0)
|
|||
}
|
||||
|
||||
if (!$available) {
|
||||
notice(t('Not available.') . EOL);
|
||||
notice(L10n::t('Not available.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -69,12 +70,12 @@ function community_content(App $a, $update = 0)
|
|||
if (!$update) {
|
||||
$tabs = [];
|
||||
|
||||
if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system','singleuser'))) {
|
||||
if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system', 'singleuser'))) {
|
||||
$tabs[] = [
|
||||
'label' => t('Community'),
|
||||
'label' => L10n::t('Community'),
|
||||
'url' => 'community/local',
|
||||
'sel' => $content == 'local' ? 'active' : '',
|
||||
'title' => t('Posts from local users on this server'),
|
||||
'title' => L10n::t('Posts from local users on this server'),
|
||||
'id' => 'community-local-tab',
|
||||
'accesskey' => 'l'
|
||||
];
|
||||
|
@ -82,10 +83,10 @@ function community_content(App $a, $update = 0)
|
|||
|
||||
if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) {
|
||||
$tabs[] = [
|
||||
'label' => t('Global Timeline'),
|
||||
'label' => L10n::t('Global Timeline'),
|
||||
'url' => 'community/global',
|
||||
'sel' => $content == 'global' ? 'active' : '',
|
||||
'title' => t('Posts from users of the federated network'),
|
||||
'title' => L10n::t('Posts from users of the federated network'),
|
||||
'id' => 'community-global-tab',
|
||||
'accesskey' => 'g'
|
||||
];
|
||||
|
@ -134,7 +135,7 @@ function community_content(App $a, $update = 0)
|
|||
$r = community_getitems($a->pager['start'], $a->pager['itemspage'], $content);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
info(t('No results.') . EOL);
|
||||
info(L10n::t('No results.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -178,7 +179,7 @@ function community_content(App $a, $update = 0)
|
|||
'$content' => $o,
|
||||
'$header' => '',
|
||||
'$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'),
|
||||
'$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this 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.")
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
233
mod/contacts.php
233
mod/contacts.php
|
@ -7,6 +7,7 @@ use Friendica\Content\ContactSelector;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -56,7 +57,7 @@ function contacts_init(App $a)
|
|||
'$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/" . $a->data['contact']['id'] : $a->data['contact']['url'],
|
||||
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
|
||||
'$network_name' => $networkname,
|
||||
'$network' => t('Network:'),
|
||||
'$network' => L10n::t('Network:'),
|
||||
'$account_type' => Contact::getAccountType($a->data['contact'])
|
||||
]);
|
||||
|
||||
|
@ -142,7 +143,7 @@ function contacts_batch_actions(App $a)
|
|||
}
|
||||
}
|
||||
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')) {
|
||||
|
@ -169,7 +170,7 @@ function contacts_post(App $a)
|
|||
}
|
||||
|
||||
if (!dba::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
|
||||
notice(t('Could not access contact record.') . EOL);
|
||||
notice(L10n::t('Could not access contact record.') . EOL);
|
||||
goaway('contacts');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -179,7 +180,7 @@ function contacts_post(App $a)
|
|||
$profile_id = intval($_POST['profile-assign']);
|
||||
if ($profile_id) {
|
||||
if (!dba::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
|
||||
notice(t('Could not locate selected profile.') . EOL);
|
||||
notice(L10n::t('Could not locate selected profile.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -213,9 +214,9 @@ function contacts_post(App $a)
|
|||
intval(local_user())
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
info(t('Contact updated.') . EOL);
|
||||
info(L10n::t('Contact updated.') . EOL);
|
||||
} else {
|
||||
notice(t('Failed to update contact record.') . EOL);
|
||||
notice(L10n::t('Failed to update contact record.') . EOL);
|
||||
}
|
||||
|
||||
$contact = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
|
||||
|
@ -374,7 +375,7 @@ function contacts_content(App $a)
|
|||
Nav::setSelected('contacts');
|
||||
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -388,7 +389,7 @@ function contacts_content(App $a)
|
|||
|
||||
$orig_record = dba::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'self' => false]);
|
||||
if (!DBM::is_result($orig_record)) {
|
||||
notice(t('Could not access contact record.') . EOL);
|
||||
notice(L10n::t('Could not access contact record.') . EOL);
|
||||
goaway('contacts');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -409,7 +410,7 @@ function contacts_content(App $a)
|
|||
$r = _contact_block($contact_id, $orig_record);
|
||||
if ($r) {
|
||||
$blocked = (($orig_record['blocked']) ? 0 : 1);
|
||||
info((($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL);
|
||||
info((($blocked) ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
|
||||
}
|
||||
|
||||
goaway('contacts/' . $contact_id);
|
||||
|
@ -420,7 +421,7 @@ function contacts_content(App $a)
|
|||
$r = _contact_ignore($contact_id, $orig_record);
|
||||
if ($r) {
|
||||
$readonly = (($orig_record['readonly']) ? 0 : 1);
|
||||
info((($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL);
|
||||
info((($readonly) ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
|
||||
}
|
||||
|
||||
goaway('contacts/' . $contact_id);
|
||||
|
@ -431,7 +432,7 @@ function contacts_content(App $a)
|
|||
$r = _contact_archive($contact_id, $orig_record);
|
||||
if ($r) {
|
||||
$archived = (($orig_record['archive']) ? 0 : 1);
|
||||
info((($archived) ? t('Contact has been archived') : t('Contact has been unarchived')) . EOL);
|
||||
info((($archived) ? L10n::t('Contact has been archived') : L10n::t('Contact has been unarchived')) . EOL);
|
||||
}
|
||||
|
||||
goaway('contacts/' . $contact_id);
|
||||
|
@ -455,15 +456,15 @@ function contacts_content(App $a)
|
|||
$a->page['aside'] = '';
|
||||
|
||||
return replace_macros(get_markup_template('contact_drop_confirm.tpl'), [
|
||||
'$header' => t('Drop contact'),
|
||||
'$header' => L10n::t('Drop contact'),
|
||||
'$contact' => _contact_detail_for_template($orig_record),
|
||||
'$method' => 'get',
|
||||
'$message' => t('Do you really want to delete this contact?'),
|
||||
'$message' => L10n::t('Do you really want to delete this contact?'),
|
||||
'$extra_inputs' => $inputs,
|
||||
'$confirm' => t('Yes'),
|
||||
'$confirm' => L10n::t('Yes'),
|
||||
'$confirm_url' => $query['base'],
|
||||
'$confirm_name' => 'confirmed',
|
||||
'$cancel' => t('Cancel'),
|
||||
'$cancel' => L10n::t('Cancel'),
|
||||
]);
|
||||
}
|
||||
// Now check how the user responded to the confirmation query
|
||||
|
@ -476,7 +477,7 @@ function contacts_content(App $a)
|
|||
}
|
||||
|
||||
_contact_drop($orig_record);
|
||||
info(t('Contact has been removed.') . EOL);
|
||||
info(L10n::t('Contact has been removed.') . EOL);
|
||||
if (x($_SESSION, 'return_url')) {
|
||||
goaway('' . $_SESSION['return_url']);
|
||||
} else {
|
||||
|
@ -507,15 +508,15 @@ function contacts_content(App $a)
|
|||
switch ($contact['rel']) {
|
||||
case CONTACT_IS_FRIEND:
|
||||
$dir_icon = 'images/lrarrow.gif';
|
||||
$relation_text = t('You are mutual friends with %s');
|
||||
$relation_text = L10n::t('You are mutual friends with %s');
|
||||
break;
|
||||
case CONTACT_IS_FOLLOWER;
|
||||
$dir_icon = 'images/larrow.gif';
|
||||
$relation_text = t('You are sharing with %s');
|
||||
$relation_text = L10n::t('You are sharing with %s');
|
||||
break;
|
||||
case CONTACT_IS_SHARING;
|
||||
$dir_icon = 'images/rarrow.gif';
|
||||
$relation_text = t('%s is sharing with you');
|
||||
$relation_text = L10n::t('%s is sharing with you');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -535,35 +536,35 @@ function contacts_content(App $a)
|
|||
$sparkle = '';
|
||||
}
|
||||
|
||||
$insecure = t('Private communications are not available for this contact.');
|
||||
$insecure = L10n::t('Private communications are not available for this contact.');
|
||||
|
||||
$last_update = (($contact['last-update'] <= NULL_DATE) ? t('Never') : datetime_convert('UTC', date_default_timezone_get(), $contact['last-update'], 'D, j M Y, g:i A'));
|
||||
$last_update = (($contact['last-update'] <= NULL_DATE) ? L10n::t('Never') : datetime_convert('UTC', date_default_timezone_get(), $contact['last-update'], 'D, j M Y, g:i A'));
|
||||
|
||||
if ($contact['last-update'] > NULL_DATE) {
|
||||
$last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
|
||||
$last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? L10n::t("\x28Update was successful\x29") : L10n::t("\x28Update was not successful\x29"));
|
||||
}
|
||||
$lblsuggest = (($contact['network'] === NETWORK_DFRN) ? t('Suggest friends') : '');
|
||||
$lblsuggest = (($contact['network'] === NETWORK_DFRN) ? L10n::t('Suggest friends') : '');
|
||||
|
||||
$poll_enabled = in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL]);
|
||||
|
||||
$nettype = t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"]));
|
||||
$nettype = L10n::t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"]));
|
||||
|
||||
// tabs
|
||||
$tab_str = contacts_tab($a, $contact_id, 2);
|
||||
|
||||
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_convert('', '', 'now')) ? t('Communications lost with this contact!') : '');
|
||||
$lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_converL10n::t('', '', 'now')) ? L10n::t('Communications lost with this contact!') : '');
|
||||
|
||||
$fetch_further_information = null;
|
||||
if ($contact['network'] == NETWORK_FEED) {
|
||||
$fetch_further_information = [
|
||||
'fetch_further_information',
|
||||
t('Fetch further information for feeds'),
|
||||
L10n::t('Fetch further information for feeds'),
|
||||
$contact['fetch_further_information'],
|
||||
t("Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn't contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags."),
|
||||
['0' => t('Disabled'),
|
||||
'1' => t('Fetch information'),
|
||||
'3' => t('Fetch keywords'),
|
||||
'2' => t('Fetch information and keywords')
|
||||
L10n::t("Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn't contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags."),
|
||||
['0' => L10n::t('Disabled'),
|
||||
'1' => L10n::t('Fetch information'),
|
||||
'3' => L10n::t('Fetch keywords'),
|
||||
'2' => L10n::t('Fetch information and keywords')
|
||||
]
|
||||
];
|
||||
}
|
||||
|
@ -583,10 +584,10 @@ function contacts_content(App $a)
|
|||
if (in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
|
||||
if ($contact['rel'] == CONTACT_IS_FOLLOWER) {
|
||||
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
|
||||
$follow_text = t("Connect/Follow");
|
||||
$follow_text = L10n::t("Connect/Follow");
|
||||
} elseif ($contact['rel'] == CONTACT_IS_FRIEND) {
|
||||
$follow = System::baseUrl(true) . "/unfollow?url=" . urlencode($contact["url"]);
|
||||
$follow_text = t("Disconnect/Unfollow");
|
||||
$follow_text = L10n::t("Disconnect/Unfollow");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -595,70 +596,70 @@ function contacts_content(App $a)
|
|||
|
||||
$tpl = get_markup_template("contact_edit.tpl");
|
||||
$o .= replace_macros($tpl, [
|
||||
'$header' => t("Contact"),
|
||||
'$header' => L10n::t("Contact"),
|
||||
'$tab_str' => $tab_str,
|
||||
'$submit' => t('Submit'),
|
||||
'$lbl_vis1' => t('Profile Visibility'),
|
||||
'$lbl_vis2' => t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
|
||||
'$lbl_info1' => t('Contact Information / Notes'),
|
||||
'$lbl_info2' => t('Their personal note'),
|
||||
'$submit' => L10n::t('Submit'),
|
||||
'$lbl_vis1' => L10n::t('Profile Visibility'),
|
||||
'$lbl_vis2' => L10n::t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
|
||||
'$lbl_info1' => L10n::t('Contact Information / Notes'),
|
||||
'$lbl_info2' => L10n::t('Their personal note'),
|
||||
'$reason' => trim(notags($contact['reason'])),
|
||||
'$infedit' => t('Edit contact notes'),
|
||||
'$infedit' => L10n::t('Edit contact notes'),
|
||||
'$common_link' => 'common/loc/' . local_user() . '/' . $contact['id'],
|
||||
'$relation_text' => $relation_text,
|
||||
'$visit' => t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
|
||||
'$blockunblock' => t('Block/Unblock contact'),
|
||||
'$ignorecont' => t('Ignore contact'),
|
||||
'$lblcrepair' => t("Repair URL settings"),
|
||||
'$lblrecent' => t('View conversations'),
|
||||
'$visit' => L10n::t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
|
||||
'$blockunblock' => L10n::t('Block/Unblock contact'),
|
||||
'$ignorecont' => L10n::t('Ignore contact'),
|
||||
'$lblcrepair' => L10n::t("Repair URL settings"),
|
||||
'$lblrecent' => L10n::t('View conversations'),
|
||||
'$lblsuggest' => $lblsuggest,
|
||||
'$nettype' => $nettype,
|
||||
'$poll_interval' => $poll_interval,
|
||||
'$poll_enabled' => $poll_enabled,
|
||||
'$lastupdtext' => t('Last update:'),
|
||||
'$lastupdtext' => L10n::t('Last update:'),
|
||||
'$lost_contact' => $lost_contact,
|
||||
'$updpub' => t('Update public posts'),
|
||||
'$updpub' => L10n::t('Update public posts'),
|
||||
'$last_update' => $last_update,
|
||||
'$udnow' => t('Update now'),
|
||||
'$udnow' => L10n::t('Update now'),
|
||||
'$follow' => $follow,
|
||||
'$follow_text' => $follow_text,
|
||||
'$profile_select' => $profile_select,
|
||||
'$contact_id' => $contact['id'],
|
||||
'$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
|
||||
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
|
||||
'$block_text' => (($contact['blocked']) ? L10n::t('Unblock') : L10n::t('Block') ),
|
||||
'$ignore_text' => (($contact['readonly']) ? L10n::t('Unignore') : L10n::t('Ignore') ),
|
||||
'$insecure' => (($contact['network'] !== NETWORK_DFRN && $contact['network'] !== NETWORK_MAIL && $contact['network'] !== NETWORK_FACEBOOK && $contact['network'] !== NETWORK_DIASPORA) ? $insecure : ''),
|
||||
'$info' => $contact['info'],
|
||||
'$cinfo' => ['info', '', $contact['info'], ''],
|
||||
'$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
|
||||
'$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
|
||||
'$archived' => (($contact['archive']) ? t('Currently archived') : ''),
|
||||
'$pending' => (($contact['pending']) ? t('Awaiting connection acknowledge') : ''),
|
||||
'$hidden' => ['hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')],
|
||||
'$notify' => ['notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')],
|
||||
'$blocked' => (($contact['blocked']) ? L10n::t('Currently blocked') : ''),
|
||||
'$ignored' => (($contact['readonly']) ? L10n::t('Currently ignored') : ''),
|
||||
'$archived' => (($contact['archive']) ? L10n::t('Currently archived') : ''),
|
||||
'$pending' => (($contact['pending']) ? L10n::t('Awaiting connection acknowledge') : ''),
|
||||
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($contact['hidden'] == 1), L10n::t('Replies/likes to your public posts <strong>may</strong> still be visible')],
|
||||
'$notify' => ['notify', L10n::t('Notification for new posts'), ($contact['notify_new_posts'] == 1), L10n::t('Send a notification of every new post of this contact')],
|
||||
'$fetch_further_information' => $fetch_further_information,
|
||||
'$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'],
|
||||
'$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
|
||||
'$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', L10n::t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], L10n::t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
|
||||
'$photo' => $contact['photo'],
|
||||
'$name' => htmlentities($contact['name']),
|
||||
'$dir_icon' => $dir_icon,
|
||||
'$sparkle' => $sparkle,
|
||||
'$url' => $url,
|
||||
'$profileurllabel' => t('Profile URL'),
|
||||
'$profileurllabel' => L10n::t('Profile URL'),
|
||||
'$profileurl' => $contact['url'],
|
||||
'$account_type' => Contact::getAccountType($contact),
|
||||
'$location' => bbcode($contact["location"]),
|
||||
'$location_label' => t("Location:"),
|
||||
'$location_label' => L10n::t("Location:"),
|
||||
'$xmpp' => bbcode($contact["xmpp"]),
|
||||
'$xmpp_label' => t("XMPP:"),
|
||||
'$xmpp_label' => L10n::t("XMPP:"),
|
||||
'$about' => bbcode($contact["about"], false, false),
|
||||
'$about_label' => t("About:"),
|
||||
'$about_label' => L10n::t("About:"),
|
||||
'$keywords' => $contact["keywords"],
|
||||
'$keywords_label' => t("Tags:"),
|
||||
'$contact_action_button' => t("Actions"),
|
||||
'$keywords_label' => L10n::t("Tags:"),
|
||||
'$contact_action_button' => L10n::t("Actions"),
|
||||
'$contact_actions' => $contact_actions,
|
||||
'$contact_status' => t("Status"),
|
||||
'$contact_settings_label' => t('Contact Settings'),
|
||||
'$contact_profile_label' => t("Profile"),
|
||||
'$contact_status' => L10n::t("Status"),
|
||||
'$contact_settings_label' => L10n::t('Contact Settings'),
|
||||
'$contact_profile_label' => L10n::t("Profile"),
|
||||
]);
|
||||
|
||||
$arr = ['contact' => $contact, 'output' => $o];
|
||||
|
@ -698,58 +699,58 @@ function contacts_content(App $a)
|
|||
|
||||
$tabs = [
|
||||
[
|
||||
'label' => t('Suggestions'),
|
||||
'label' => L10n::t('Suggestions'),
|
||||
'url' => 'suggest',
|
||||
'sel' => '',
|
||||
'title' => t('Suggest potential friends'),
|
||||
'title' => L10n::t('Suggest potential friends'),
|
||||
'id' => 'suggestions-tab',
|
||||
'accesskey' => 'g',
|
||||
],
|
||||
[
|
||||
'label' => t('All Contacts'),
|
||||
'label' => L10n::t('All Contacts'),
|
||||
'url' => 'contacts/all',
|
||||
'sel' => ($all) ? 'active' : '',
|
||||
'title' => t('Show all contacts'),
|
||||
'title' => L10n::t('Show all contacts'),
|
||||
'id' => 'showall-tab',
|
||||
'accesskey' => 'l',
|
||||
],
|
||||
[
|
||||
'label' => t('Unblocked'),
|
||||
'label' => L10n::t('Unblocked'),
|
||||
'url' => 'contacts',
|
||||
'sel' => ((!$all) && (!$blocked) && (!$hidden) && (!$search) && (!$nets) && (!$ignored) && (!$archived)) ? 'active' : '',
|
||||
'title' => t('Only show unblocked contacts'),
|
||||
'title' => L10n::t('Only show unblocked contacts'),
|
||||
'id' => 'showunblocked-tab',
|
||||
'accesskey' => 'o',
|
||||
],
|
||||
[
|
||||
'label' => t('Blocked'),
|
||||
'label' => L10n::t('Blocked'),
|
||||
'url' => 'contacts/blocked',
|
||||
'sel' => ($blocked) ? 'active' : '',
|
||||
'title' => t('Only show blocked contacts'),
|
||||
'title' => L10n::t('Only show blocked contacts'),
|
||||
'id' => 'showblocked-tab',
|
||||
'accesskey' => 'b',
|
||||
],
|
||||
[
|
||||
'label' => t('Ignored'),
|
||||
'label' => L10n::t('Ignored'),
|
||||
'url' => 'contacts/ignored',
|
||||
'sel' => ($ignored) ? 'active' : '',
|
||||
'title' => t('Only show ignored contacts'),
|
||||
'title' => L10n::t('Only show ignored contacts'),
|
||||
'id' => 'showignored-tab',
|
||||
'accesskey' => 'i',
|
||||
],
|
||||
[
|
||||
'label' => t('Archived'),
|
||||
'label' => L10n::t('Archived'),
|
||||
'url' => 'contacts/archived',
|
||||
'sel' => ($archived) ? 'active' : '',
|
||||
'title' => t('Only show archived contacts'),
|
||||
'title' => L10n::t('Only show archived contacts'),
|
||||
'id' => 'showarchived-tab',
|
||||
'accesskey' => 'y',
|
||||
],
|
||||
[
|
||||
'label' => t('Hidden'),
|
||||
'label' => L10n::t('Hidden'),
|
||||
'url' => 'contacts/hidden',
|
||||
'sel' => ($hidden) ? 'active' : '',
|
||||
'title' => t('Only show hidden contacts'),
|
||||
'title' => L10n::t('Only show hidden contacts'),
|
||||
'id' => 'showhidden-tab',
|
||||
'accesskey' => 'h',
|
||||
],
|
||||
|
@ -801,25 +802,25 @@ function contacts_content(App $a)
|
|||
$tpl = get_markup_template("contacts-template.tpl");
|
||||
$o .= replace_macros($tpl, [
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$header' => t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
|
||||
'$header' => L10n::t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
|
||||
'$tabs' => $t,
|
||||
'$total' => $total,
|
||||
'$search' => $search_hdr,
|
||||
'$desc' => t('Search your contacts'),
|
||||
'$finding' => $searching ? t('Results for: %s', $search) : "",
|
||||
'$submit' => t('Find'),
|
||||
'$desc' => L10n::t('Search your contacts'),
|
||||
'$finding' => $searching ? L10n::t('Results for: %s', $search) : "",
|
||||
'$submit' => L10n::t('Find'),
|
||||
'$cmd' => $a->cmd,
|
||||
'$contacts' => $contacts,
|
||||
'$contact_drop_confirm' => t('Do you really want to delete this contact?'),
|
||||
'$contact_drop_confirm' => L10n::t('Do you really want to delete this contact?'),
|
||||
'multiselect' => 1,
|
||||
'$batch_actions' => [
|
||||
'contacts_batch_update' => t('Update'),
|
||||
'contacts_batch_block' => t('Block') . "/" . t("Unblock"),
|
||||
"contacts_batch_ignore" => t('Ignore') . "/" . t("Unignore"),
|
||||
"contacts_batch_archive" => t('Archive') . "/" . t("Unarchive"),
|
||||
"contacts_batch_drop" => t('Delete'),
|
||||
'contacts_batch_update' => L10n::t('Update'),
|
||||
'contacts_batch_block' => L10n::t('Block') . "/" . L10n::t("Unblock"),
|
||||
"contacts_batch_ignore" => L10n::t('Ignore') . "/" . L10n::t("Unignore"),
|
||||
"contacts_batch_archive" => L10n::t('Archive') . "/" . L10n::t("Unarchive"),
|
||||
"contacts_batch_drop" => L10n::t('Delete'),
|
||||
],
|
||||
'$h_batch_actions' => t('Batch Actions'),
|
||||
'$h_batch_actions' => L10n::t('Batch Actions'),
|
||||
'$paginate' => paginate($a),
|
||||
]);
|
||||
|
||||
|
@ -842,18 +843,18 @@ function contacts_tab($a, $contact_id, $active_tab)
|
|||
// tabs
|
||||
$tabs = [
|
||||
[
|
||||
'label' => t('Status'),
|
||||
'label' => L10n::t('Status'),
|
||||
'url' => "contacts/" . $contact_id . "/posts",
|
||||
'sel' => (($active_tab == 1) ? 'active' : ''),
|
||||
'title' => t('Status Messages and Posts'),
|
||||
'title' => L10n::t('Status Messages and Posts'),
|
||||
'id' => 'status-tab',
|
||||
'accesskey' => 'm',
|
||||
],
|
||||
[
|
||||
'label' => t('Profile'),
|
||||
'label' => L10n::t('Profile'),
|
||||
'url' => "contacts/" . $contact_id,
|
||||
'sel' => (($active_tab == 2) ? 'active' : ''),
|
||||
'title' => t('Profile Details'),
|
||||
'title' => L10n::t('Profile Details'),
|
||||
'id' => 'profile-tab',
|
||||
'accesskey' => 'o',
|
||||
]
|
||||
|
@ -862,10 +863,10 @@ function contacts_tab($a, $contact_id, $active_tab)
|
|||
// Show this tab only if there is visible friend list
|
||||
$x = GContact::countAllFriends(local_user(), $contact_id);
|
||||
if ($x) {
|
||||
$tabs[] = ['label' => t('Contacts'),
|
||||
$tabs[] = ['label' => L10n::t('Contacts'),
|
||||
'url' => "allfriends/" . $contact_id,
|
||||
'sel' => (($active_tab == 3) ? 'active' : ''),
|
||||
'title' => t('View all contacts'),
|
||||
'title' => L10n::t('View all contacts'),
|
||||
'id' => 'allfriends-tab',
|
||||
'accesskey' => 't'];
|
||||
}
|
||||
|
@ -873,19 +874,19 @@ function contacts_tab($a, $contact_id, $active_tab)
|
|||
// Show this tab only if there is visible common friend list
|
||||
$common = GContact::countCommonFriends(local_user(), $contact_id);
|
||||
if ($common) {
|
||||
$tabs[] = ['label' => t('Common Friends'),
|
||||
$tabs[] = ['label' => L10n::t('Common Friends'),
|
||||
'url' => "common/loc/" . local_user() . "/" . $contact_id,
|
||||
'sel' => (($active_tab == 4) ? 'active' : ''),
|
||||
'title' => t('View all common friends'),
|
||||
'title' => L10n::t('View all common friends'),
|
||||
'id' => 'common-loc-tab',
|
||||
'accesskey' => 'd'
|
||||
];
|
||||
}
|
||||
|
||||
$tabs[] = ['label' => t('Advanced'),
|
||||
$tabs[] = ['label' => L10n::t('Advanced'),
|
||||
'url' => 'crepair/' . $contact_id,
|
||||
'sel' => (($active_tab == 5) ? 'active' : ''),
|
||||
'title' => t('Advanced Contact Settings'),
|
||||
'title' => L10n::t('Advanced Contact Settings'),
|
||||
'id' => 'advanced-tab',
|
||||
'accesskey' => 'r'
|
||||
];
|
||||
|
@ -917,15 +918,15 @@ function _contact_detail_for_template($rr)
|
|||
switch ($rr['rel']) {
|
||||
case CONTACT_IS_FRIEND:
|
||||
$dir_icon = 'images/lrarrow.gif';
|
||||
$alt_text = t('Mutual Friendship');
|
||||
$alt_text = L10n::t('Mutual Friendship');
|
||||
break;
|
||||
case CONTACT_IS_FOLLOWER;
|
||||
$dir_icon = 'images/larrow.gif';
|
||||
$alt_text = t('is a fan of yours');
|
||||
$alt_text = L10n::t('is a fan of yours');
|
||||
break;
|
||||
case CONTACT_IS_SHARING;
|
||||
$dir_icon = 'images/rarrow.gif';
|
||||
$alt_text = t('you are a fan of');
|
||||
$alt_text = L10n::t('you are a fan of');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -939,8 +940,8 @@ function _contact_detail_for_template($rr)
|
|||
}
|
||||
|
||||
return [
|
||||
'img_hover' => t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
|
||||
'edit_hover' => t('Edit contact'),
|
||||
'img_hover' => L10n::t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
|
||||
'edit_hover' => L10n::t('Edit contact'),
|
||||
'photo_menu' => Contact::photoMenu($rr),
|
||||
'id' => $rr['id'],
|
||||
'alt_text' => $alt_text,
|
||||
|
@ -972,7 +973,7 @@ function contact_actions($contact)
|
|||
// Provide friend suggestion only for Friendica contacts
|
||||
if ($contact['network'] === NETWORK_DFRN) {
|
||||
$contact_actions['suggest'] = [
|
||||
'label' => t('Suggest friends'),
|
||||
'label' => L10n::t('Suggest friends'),
|
||||
'url' => 'fsuggest/' . $contact['id'],
|
||||
'title' => '',
|
||||
'sel' => '',
|
||||
|
@ -982,7 +983,7 @@ function contact_actions($contact)
|
|||
|
||||
if ($poll_enabled) {
|
||||
$contact_actions['update'] = [
|
||||
'label' => t('Update now'),
|
||||
'label' => L10n::t('Update now'),
|
||||
'url' => 'contacts/' . $contact['id'] . '/update',
|
||||
'title' => '',
|
||||
'sel' => '',
|
||||
|
@ -991,33 +992,33 @@ function contact_actions($contact)
|
|||
}
|
||||
|
||||
$contact_actions['block'] = [
|
||||
'label' => (intval($contact['blocked']) ? t('Unblock') : t('Block') ),
|
||||
'label' => (intval($contact['blocked']) ? L10n::t('Unblock') : L10n::t('Block') ),
|
||||
'url' => 'contacts/' . $contact['id'] . '/block',
|
||||
'title' => t('Toggle Blocked status'),
|
||||
'title' => L10n::t('Toggle Blocked status'),
|
||||
'sel' => (intval($contact['blocked']) ? 'active' : ''),
|
||||
'id' => 'toggle-block',
|
||||
];
|
||||
|
||||
$contact_actions['ignore'] = [
|
||||
'label' => (intval($contact['readonly']) ? t('Unignore') : t('Ignore') ),
|
||||
'label' => (intval($contact['readonly']) ? L10n::t('Unignore') : L10n::t('Ignore') ),
|
||||
'url' => 'contacts/' . $contact['id'] . '/ignore',
|
||||
'title' => t('Toggle Ignored status'),
|
||||
'title' => L10n::t('Toggle Ignored status'),
|
||||
'sel' => (intval($contact['readonly']) ? 'active' : ''),
|
||||
'id' => 'toggle-ignore',
|
||||
];
|
||||
|
||||
$contact_actions['archive'] = [
|
||||
'label' => (intval($contact['archive']) ? t('Unarchive') : t('Archive') ),
|
||||
'label' => (intval($contact['archive']) ? L10n::t('Unarchive') : L10n::t('Archive') ),
|
||||
'url' => 'contacts/' . $contact['id'] . '/archive',
|
||||
'title' => t('Toggle Archive status'),
|
||||
'title' => L10n::t('Toggle Archive status'),
|
||||
'sel' => (intval($contact['archive']) ? 'active' : ''),
|
||||
'id' => 'toggle-archive',
|
||||
];
|
||||
|
||||
$contact_actions['delete'] = [
|
||||
'label' => t('Delete'),
|
||||
'label' => L10n::t('Delete'),
|
||||
'url' => 'contacts/' . $contact['id'] . '/drop',
|
||||
'title' => t('Delete contact'),
|
||||
'title' => L10n::t('Delete contact'),
|
||||
'sel' => '',
|
||||
'id' => 'delete',
|
||||
];
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/credits.php
|
||||
* Show a credits page for all the developers who helped with the project
|
||||
* (only contributors to the git repositories for friendica core and the
|
||||
* addons repository will be listed though ATM)
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
function credits_content()
|
||||
{
|
||||
|
@ -14,8 +15,8 @@ function credits_content()
|
|||
$names = explode("\n", htmlspecialchars($credits_string));
|
||||
$tpl = get_markup_template('credits.tpl');
|
||||
return replace_macros($tpl, [
|
||||
'$title' => t('Credits'),
|
||||
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
|
||||
'$title' => L10n::t('Credits'),
|
||||
'$thanks' => L10n::t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
|
||||
'$names' => $names,
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Profile;
|
||||
|
@ -83,9 +84,9 @@ function crepair_post(App $a)
|
|||
}
|
||||
|
||||
if ($r) {
|
||||
info(t('Contact settings applied.') . EOL);
|
||||
info(L10n::t('Contact settings applied.') . EOL);
|
||||
} else {
|
||||
notice(t('Contact update failed.') . EOL);
|
||||
notice(L10n::t('Contact update failed.') . EOL);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -94,7 +95,7 @@ function crepair_post(App $a)
|
|||
function crepair_content(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -106,12 +107,12 @@ function crepair_content(App $a)
|
|||
}
|
||||
|
||||
if (!DBM::is_result($contact)) {
|
||||
notice(t('Contact not found.') . EOL);
|
||||
notice(L10n::t('Contact not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$warning = t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
|
||||
$info = t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
|
||||
$warning = L10n::t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
|
||||
$info = L10n::t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
|
||||
|
||||
$returnaddr = "contacts/$cid";
|
||||
|
||||
|
@ -125,9 +126,9 @@ function crepair_content(App $a)
|
|||
}
|
||||
|
||||
if ($contact['network'] == NETWORK_FEED) {
|
||||
$remote_self_options = ['0' => t('No mirroring'), '1' => t('Mirror as forwarded posting'), '2' => t('Mirror as my own posting')];
|
||||
$remote_self_options = ['0' => L10n::t('No mirroring'), '1' => L10n::t('Mirror as forwarded posting'), '2' => L10n::t('Mirror as my own posting')];
|
||||
} else {
|
||||
$remote_self_options = ['0' => t('No mirroring'), '2' => t('Mirror as my own posting')];
|
||||
$remote_self_options = ['0' => L10n::t('No mirroring'), '2' => L10n::t('Mirror as my own posting')];
|
||||
}
|
||||
|
||||
$update_profile = in_array($contact['network'], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]);
|
||||
|
@ -140,29 +141,29 @@ function crepair_content(App $a)
|
|||
'$warning' => $warning,
|
||||
'$info' => $info,
|
||||
'$returnaddr' => $returnaddr,
|
||||
'$return' => t('Return to contact editor'),
|
||||
'$return' => L10n::t('Return to contact editor'),
|
||||
'$update_profile' => $update_profile,
|
||||
'$udprofilenow' => t('Refetch contact data'),
|
||||
'$udprofilenow' => L10n::t('Refetch contact data'),
|
||||
'$contact_id' => $contact['id'],
|
||||
'$lbl_submit' => t('Submit'),
|
||||
'$label_remote_self' => t('Remote Self'),
|
||||
'$lbl_submit' => L10n::t('Submit'),
|
||||
'$label_remote_self' => L10n::t('Remote Self'),
|
||||
'$allow_remote_self' => $allow_remote_self,
|
||||
'$remote_self' => ['remote_self',
|
||||
t('Mirror postings from this contact'),
|
||||
L10n::t('Mirror postings from this contact'),
|
||||
$contact['remote_self'],
|
||||
t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
|
||||
L10n::t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
|
||||
$remote_self_options
|
||||
],
|
||||
|
||||
'$name' => ['name', t('Name') , htmlentities($contact['name'])],
|
||||
'$nick' => ['nick', t('Account Nickname'), htmlentities($contact['nick'])],
|
||||
'$attag' => ['attag', t('@Tagname - overrides Name/Nickname'), $contact['attag']],
|
||||
'$url' => ['url', t('Account URL'), $contact['url']],
|
||||
'$request' => ['request', t('Friend Request URL'), $contact['request']],
|
||||
'confirm' => ['confirm', t('Friend Confirm URL'), $contact['confirm']],
|
||||
'notify' => ['notify', t('Notification Endpoint URL'), $contact['notify']],
|
||||
'poll' => ['poll', t('Poll/Feed URL'), $contact['poll']],
|
||||
'photo' => ['photo', t('New photo from this URL'), ''],
|
||||
'$name' => ['name', L10n::t('Name') , htmlentities($contact['name'])],
|
||||
'$nick' => ['nick', L10n::t('Account Nickname'), htmlentities($contact['nick'])],
|
||||
'$attag' => ['attag', L10n::t('@Tagname - overrides Name/Nickname'), $contact['attag']],
|
||||
'$url' => ['url', L10n::t('Account URL'), $contact['url']],
|
||||
'$request' => ['request', L10n::t('Friend Request URL'), $contact['request']],
|
||||
'confirm' => ['confirm', L10n::t('Friend Confirm URL'), $contact['confirm']],
|
||||
'notify' => ['notify', L10n::t('Notification Endpoint URL'), $contact['notify']],
|
||||
'poll' => ['poll', L10n::t('Poll/Feed URL'), $contact['poll']],
|
||||
'photo' => ['photo', L10n::t('New photo from this URL'), ''],
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/delegate.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
|
@ -14,7 +17,7 @@ function delegate_init(App $a)
|
|||
function delegate_content(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -90,7 +93,7 @@ function delegate_content(App $a)
|
|||
dbesc(NETWORK_DFRN)
|
||||
);
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(t('No potential page delegates located.') . EOL);
|
||||
notice(L10n::t('No potential page delegates located.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,18 +119,18 @@ function delegate_content(App $a)
|
|||
settings_init($a);
|
||||
|
||||
$o = replace_macros(get_markup_template('delegate.tpl'), [
|
||||
'$header' => t('Delegate Page Management'),
|
||||
'$header' => L10n::t('Delegate Page Management'),
|
||||
'$base' => System::baseUrl(),
|
||||
'$desc' => t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'),
|
||||
'$head_managers' => t('Existing Page Managers'),
|
||||
'$desc' => L10n::t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'),
|
||||
'$head_managers' => L10n::t('Existing Page Managers'),
|
||||
'$managers' => $full_managers,
|
||||
'$head_delegates' => t('Existing Page Delegates'),
|
||||
'$head_delegates' => L10n::t('Existing Page Delegates'),
|
||||
'$delegates' => $delegates,
|
||||
'$head_potentials' => t('Potential Delegates'),
|
||||
'$head_potentials' => L10n::t('Potential Delegates'),
|
||||
'$potentials' => $potentials,
|
||||
'$remove' => t('Remove'),
|
||||
'$add' => t('Add'),
|
||||
'$none' => t('No entries.')
|
||||
'$remove' => L10n::t('Remove'),
|
||||
'$add' => L10n::t('Add'),
|
||||
'$none' => L10n::t('No entries.')
|
||||
]);
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/dfrn_confirm.php
|
||||
* @brief Module: dfrn_confirm
|
||||
|
@ -20,6 +19,7 @@
|
|||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -61,13 +61,13 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
if (!x($_POST, 'source_url')) {
|
||||
$uid = defaults($handsfree, 'uid', local_user());
|
||||
if (!$uid) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$user = dba::selectFirst('user', [], ['uid' => $uid]);
|
||||
if (!DBM::is_result($user)) {
|
||||
notice(t('Profile not found.') . EOL);
|
||||
notice(L10n::t('Profile not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,8 +124,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
);
|
||||
if (!DBM::is_result($r)) {
|
||||
logger('Contact not found in DB.');
|
||||
notice(t('Contact not found.') . EOL);
|
||||
notice(t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
|
||||
notice(L10n::t('Contact not found.') . EOL);
|
||||
notice(L10n::t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -235,19 +235,19 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
// We shouldn't proceed, because the xml parser might choke,
|
||||
// and $status is going to be zero, which indicates success.
|
||||
// We can hardly call this a success.
|
||||
notice(t('Response from remote site was not understood.') . EOL);
|
||||
notice(L10n::t('Response from remote site was not understood.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($leading_junk) && Config::get('system', 'debugging')) {
|
||||
// This might be more common. Mixed error text and some XML.
|
||||
// If we're configured for debugging, show the text. Proceed in either case.
|
||||
notice(t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);
|
||||
notice(L10n::t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);
|
||||
}
|
||||
|
||||
if (stristr($res, "<status") === false) {
|
||||
// wrong xml! stop here!
|
||||
notice(t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL);
|
||||
notice(L10n::t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -256,7 +256,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$message = unxmlify($xml->message); // human readable text of what may have gone wrong.
|
||||
switch ($status) {
|
||||
case 0:
|
||||
info(t("Confirmation completed successfully.") . EOL);
|
||||
info(L10n::t("Confirmation completed successfully.") . EOL);
|
||||
break;
|
||||
case 1:
|
||||
// birthday paradox - generate new dfrn-id and fall through.
|
||||
|
@ -268,15 +268,15 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
);
|
||||
|
||||
case 2:
|
||||
notice(t("Temporary failure. Please wait and try again.") . EOL);
|
||||
notice(L10n::t("Temporary failure. Please wait and try again.") . EOL);
|
||||
break;
|
||||
case 3:
|
||||
notice(t("Introduction failed or was revoked.") . EOL);
|
||||
notice(L10n::t("Introduction failed or was revoked.") . EOL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (strlen($message)) {
|
||||
notice(t('Remote site reported: ') . $message . EOL);
|
||||
notice(L10n::t('Remote site reported: ') . $message . EOL);
|
||||
}
|
||||
|
||||
if (($status == 0) && ($intro_id)) {
|
||||
|
@ -389,7 +389,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
|
||||
/// @TODO is DBM::is_result() working here?
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(t('Unable to set contact photo.') . EOL);
|
||||
notice(L10n::t('Unable to set contact photo.') . EOL);
|
||||
}
|
||||
|
||||
// reload contact info
|
||||
|
@ -424,7 +424,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
|
||||
$arr['verb'] = ACTIVITY_FRIEND;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
|
||||
$arr['body'] = t('%1$s is now friends with %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
$arr['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
|
||||
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
|
||||
|
@ -491,7 +491,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
// Find our user's account
|
||||
$user = dba::selectFirst('user', [], ['nickname' => $node]);
|
||||
if (!DBM::is_result($user)) {
|
||||
$message = t('No user record found for \'%s\' ', $node);
|
||||
$message = L10n::t('No user record found for \'%s\' ', $node);
|
||||
xml_status(3, $message); // failure
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
|
||||
|
||||
if (!strstr($my_prvkey, 'PRIVATE KEY')) {
|
||||
$message = t('Our site encryption key is apparently messed up.');
|
||||
$message = L10n::t('Our site encryption key is apparently messed up.');
|
||||
xml_status(3, $message);
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
|
||||
|
||||
if (!strlen($decrypted_source_url)) {
|
||||
$message = t('Empty site URL was provided or URL could not be decrypted by us.');
|
||||
$message = L10n::t('Empty site URL was provided or URL could not be decrypted by us.');
|
||||
xml_status(3, $message);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$contact = dba::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]);
|
||||
if (!DBM::is_result($contact)) {
|
||||
// this is either a bogus confirmation (?) or we deleted the original introduction.
|
||||
$message = t('Contact record was not found for you on our site.');
|
||||
$message = L10n::t('Contact record was not found for you on our site.');
|
||||
xml_status(3, $message);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$dfrn_record = $contact['id'];
|
||||
|
||||
if (!$foreign_pubkey) {
|
||||
$message = t('Site public key not available in contact record for URL %s.', $decrypted_source_url);
|
||||
$message = L10n::t('Site public key not available in contact record for URL %s.', $decrypted_source_url);
|
||||
xml_status(3, $message);
|
||||
}
|
||||
|
||||
|
@ -558,7 +558,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
}
|
||||
|
||||
if (dba::exists('contact', ['dfrn-id' => $decrypted_dfrn_id])) {
|
||||
$message = t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
|
||||
$message = L10n::t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
|
||||
xml_status(1, $message); // Birthday paradox - duplicate dfrn-id
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
intval($dfrn_record)
|
||||
);
|
||||
if (!DBM::is_result($r)) {
|
||||
$message = t('Unable to set your contact credentials on our system.');
|
||||
$message = L10n::t('Unable to set your contact credentials on our system.');
|
||||
xml_status(3, $message);
|
||||
}
|
||||
|
||||
|
@ -624,7 +624,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
intval($dfrn_record)
|
||||
);
|
||||
if (!DBM::is_result($r)) { // indicates schema is messed up or total db failure
|
||||
$message = t('Unable to update your contact profile details on our system');
|
||||
$message = L10n::t('Unable to update your contact profile details on our system');
|
||||
xml_status(3, $message);
|
||||
}
|
||||
|
||||
|
@ -654,7 +654,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
'to_email' => $combined['email'],
|
||||
'uid' => $combined['uid'],
|
||||
'link' => System::baseUrl() . '/contacts/' . $dfrn_record,
|
||||
'source_name' => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : t('[Name Withheld]')),
|
||||
'source_name' => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : L10n::t('[Name Withheld]')),
|
||||
'source_link' => $combined['url'],
|
||||
'source_photo' => $combined['photo'],
|
||||
'verb' => ($mutual?ACTIVITY_FRIEND:ACTIVITY_FOLLOW),
|
||||
|
@ -687,7 +687,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
|
||||
$arr['verb'] = ACTIVITY_JOIN;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_GROUP;
|
||||
$arr['body'] = t('%1$s has joined %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
$arr['body'] = L10n::t('%1$s has joined %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>'
|
||||
. '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n");
|
||||
|
|
|
@ -117,7 +117,7 @@ function dfrn_poll_init(App $a)
|
|||
$_SESSION['visitor_handle'] = $r[0]['addr'];
|
||||
$_SESSION['visitor_visiting'] = $r[0]['uid'];
|
||||
if (!$quiet) {
|
||||
info(sprintf(t('%1$s welcomes %2$s'), $r[0]['username'], $r[0]['name']) . EOL);
|
||||
info(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
|
||||
}
|
||||
|
||||
// Visitors get 1 day session.
|
||||
|
@ -537,7 +537,7 @@ function dfrn_poll_content(App $a)
|
|||
$_SESSION['visitor_home'] = $r[0]['url'];
|
||||
$_SESSION['visitor_visiting'] = $r[0]['uid'];
|
||||
if (!$quiet) {
|
||||
info(sprintf(t('%1$s welcomes %2$s'), $r[0]['username'], $r[0]['name']) . EOL);
|
||||
info(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
|
||||
}
|
||||
|
||||
// Visitors get 1 day session.
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -87,7 +88,7 @@ function dfrn_request_post(App $a)
|
|||
if (DBM::is_result($r)) {
|
||||
if (strlen($r[0]['dfrn-id'])) {
|
||||
// We don't need to be here. It has already happened.
|
||||
notice(t("This introduction has already been accepted.") . EOL);
|
||||
notice(L10n::t("This introduction has already been accepted.") . EOL);
|
||||
return;
|
||||
} else {
|
||||
$contact_record = $r[0];
|
||||
|
@ -105,18 +106,18 @@ function dfrn_request_post(App $a)
|
|||
$parms = Probe::profile($dfrn_url);
|
||||
|
||||
if (!count($parms)) {
|
||||
notice(t('Profile location is not valid or does not contain profile information.') . EOL);
|
||||
notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
|
||||
return;
|
||||
} else {
|
||||
if (!x($parms, 'fn')) {
|
||||
notice(t('Warning: profile location has no identifiable owner name.') . EOL);
|
||||
notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
|
||||
}
|
||||
if (!x($parms, 'photo')) {
|
||||
notice(t('Warning: profile location has no profile photo.') . EOL);
|
||||
notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
|
||||
}
|
||||
$invalid = Probe::validDfrn($parms);
|
||||
if ($invalid) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +156,7 @@ function dfrn_request_post(App $a)
|
|||
}
|
||||
|
||||
if ($r) {
|
||||
info(t("Introduction complete.") . EOL);
|
||||
info(L10n::t("Introduction complete.") . EOL);
|
||||
}
|
||||
|
||||
$r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `site-pubkey` = '%s' LIMIT 1",
|
||||
|
@ -192,7 +193,7 @@ function dfrn_request_post(App $a)
|
|||
}
|
||||
|
||||
// invalid/bogus request
|
||||
notice(t('Unrecoverable protocol error.') . EOL);
|
||||
notice(L10n::t('Unrecoverable protocol error.') . EOL);
|
||||
goaway(System::baseUrl());
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -219,7 +220,7 @@ function dfrn_request_post(App $a)
|
|||
*
|
||||
*/
|
||||
if (!(is_array($a->profile) && count($a->profile))) {
|
||||
notice(t('Profile unavailable.') . EOL);
|
||||
notice(L10n::t('Profile unavailable.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -241,9 +242,9 @@ function dfrn_request_post(App $a)
|
|||
intval($uid)
|
||||
);
|
||||
if (DBM::is_result($r) && count($r) > $maxreq) {
|
||||
notice(sprintf(t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
|
||||
notice(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;
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +274,7 @@ function dfrn_request_post(App $a)
|
|||
|
||||
$url = trim($_POST['dfrn_url']);
|
||||
if (!strlen($url)) {
|
||||
notice(t("Invalid locator") . EOL);
|
||||
notice(L10n::t("Invalid locator") . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -309,10 +310,10 @@ function dfrn_request_post(App $a)
|
|||
|
||||
if (DBM::is_result($ret)) {
|
||||
if (strlen($ret[0]['issued-id'])) {
|
||||
notice(t('You have already introduced yourself here.') . EOL);
|
||||
notice(L10n::t('You have already introduced yourself here.') . EOL);
|
||||
return;
|
||||
} elseif ($ret[0]['rel'] == CONTACT_IS_FRIEND) {
|
||||
notice(sprintf(t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL);
|
||||
notice(L10n::t('Apparently you are already friends with %s.', $a->profile['name']) . EOL);
|
||||
return;
|
||||
} else {
|
||||
$contact_record = $ret[0];
|
||||
|
@ -332,19 +333,19 @@ function dfrn_request_post(App $a)
|
|||
} else {
|
||||
$url = validate_url($url);
|
||||
if (!$url) {
|
||||
notice(t('Invalid profile URL.') . EOL);
|
||||
notice(L10n::t('Invalid profile URL.') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $a->cmd);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
if (!allowed_url($url)) {
|
||||
notice(t('Disallowed profile URL.') . EOL);
|
||||
notice(L10n::t('Disallowed profile URL.') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $a->cmd);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
if (blocked_url($url)) {
|
||||
notice(t('Blocked domain') . EOL);
|
||||
notice(L10n::t('Blocked domain') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $a->cmd);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -352,18 +353,18 @@ function dfrn_request_post(App $a)
|
|||
$parms = Probe::profile(($hcard) ? $hcard : $url);
|
||||
|
||||
if (!count($parms)) {
|
||||
notice(t('Profile location is not valid or does not contain profile information.') . EOL);
|
||||
notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
|
||||
goaway(System::baseUrl() . '/' . $a->cmd);
|
||||
} else {
|
||||
if (!x($parms, 'fn')) {
|
||||
notice(t('Warning: profile location has no identifiable owner name.') . EOL);
|
||||
notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
|
||||
}
|
||||
if (!x($parms, 'photo')) {
|
||||
notice(t('Warning: profile location has no profile photo.') . EOL);
|
||||
notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
|
||||
}
|
||||
$invalid = Probe::validDfrn($parms);
|
||||
if ($invalid) {
|
||||
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;
|
||||
}
|
||||
|
@ -412,7 +413,7 @@ function dfrn_request_post(App $a)
|
|||
}
|
||||
}
|
||||
if ($r === false) {
|
||||
notice(t('Failed to update contact record.') . EOL);
|
||||
notice(L10n::t('Failed to update contact record.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -432,7 +433,7 @@ function dfrn_request_post(App $a)
|
|||
|
||||
// This notice will only be seen by the requestor if the requestor and requestee are on the same server.
|
||||
if (!$failed) {
|
||||
info(t('Your introduction has been sent.') . EOL);
|
||||
info(L10n::t('Your introduction has been sent.') . EOL);
|
||||
}
|
||||
|
||||
// "Homecoming" - send the requestor back to their site to record the introduction.
|
||||
|
@ -470,7 +471,7 @@ function dfrn_request_post(App $a)
|
|||
// NOTREACHED
|
||||
// END $network != NETWORK_PHANTOM
|
||||
} else {
|
||||
notice(t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL);
|
||||
notice(L10n::t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL);
|
||||
return;
|
||||
}
|
||||
} return;
|
||||
|
@ -486,7 +487,7 @@ function dfrn_request_content(App $a)
|
|||
// to send us to the post section to record the introduction.
|
||||
if (x($_GET, 'dfrn_url')) {
|
||||
if (!local_user()) {
|
||||
info(t("Please login to confirm introduction.") . EOL);
|
||||
info(L10n::t("Please login to confirm introduction.") . EOL);
|
||||
/* setup the return URL to come back to this page if they use openid */
|
||||
return Login::form();
|
||||
}
|
||||
|
@ -494,7 +495,7 @@ function dfrn_request_content(App $a)
|
|||
// Edge case, but can easily happen in the wild. This person is authenticated,
|
||||
// but not as the person who needs to deal with this request.
|
||||
if ($a->user['nickname'] != $a->argv[1]) {
|
||||
notice(t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
|
||||
notice(L10n::t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
|
||||
return Login::form();
|
||||
}
|
||||
|
||||
|
@ -508,7 +509,7 @@ function dfrn_request_content(App $a)
|
|||
$_POST["confirm_key"] = $confirm_key;
|
||||
$_POST["localconfirm"] = 1;
|
||||
$_POST["hidden-contact"] = 0;
|
||||
$_POST["submit"] = t('Confirm');
|
||||
$_POST["submit"] = L10n::t('Confirm');
|
||||
|
||||
dfrn_request_post($a);
|
||||
|
||||
|
@ -520,12 +521,12 @@ function dfrn_request_content(App $a)
|
|||
$o = replace_macros($tpl, [
|
||||
'$dfrn_url' => $dfrn_url,
|
||||
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
|
||||
'$hidethem' => t('Hide this contact'),
|
||||
'$hidethem' => L10n::t('Hide this contact'),
|
||||
'$hidechecked' => '',
|
||||
'$confirm_key' => $confirm_key,
|
||||
'$welcome' => sprintf(t('Welcome home %s.'), $a->user['username']),
|
||||
'$please' => sprintf(t('Please confirm your introduction/connection request to %s.'), $dfrn_url),
|
||||
'$submit' => t('Confirm'),
|
||||
'$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']
|
||||
|
@ -561,7 +562,7 @@ function dfrn_request_content(App $a)
|
|||
'to_email' => $r[0]['email'],
|
||||
'uid' => $r[0]['uid'],
|
||||
'link' => System::baseUrl() . '/notifications/intros',
|
||||
'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
|
||||
'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : L10n::t('[Name Withheld]')),
|
||||
'source_link' => $r[0]['url'],
|
||||
'source_photo' => $r[0]['photo'],
|
||||
'verb' => ACTIVITY_REQ_FRIEND,
|
||||
|
@ -600,7 +601,7 @@ function dfrn_request_content(App $a)
|
|||
// Normal web request. Display our user's introduction form.
|
||||
if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
|
||||
if (!Config::get('system', 'local_block')) {
|
||||
notice(t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -635,28 +636,28 @@ function dfrn_request_content(App $a)
|
|||
$tpl = get_markup_template('auto_request.tpl');
|
||||
}
|
||||
|
||||
$page_desc = t("Please enter your 'Identity Address' from one of the following supported communications networks:");
|
||||
$page_desc = L10n::t("Please enter your 'Identity Address' from one of the following supported communications networks:");
|
||||
|
||||
$invite_desc = sprintf(
|
||||
t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.'),
|
||||
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
|
||||
|
|
|
@ -7,6 +7,7 @@ use Friendica\Content\Nav;
|
|||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Profile;
|
||||
|
@ -34,7 +35,7 @@ function directory_content(App $a) {
|
|||
|
||||
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user()) ||
|
||||
(Config::get('system','block_local_dir')) && (! local_user()) && (! remote_user())) {
|
||||
notice( t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,10 +125,10 @@ function directory_content(App $a) {
|
|||
}
|
||||
// if(strlen($rr['dob'])) {
|
||||
// if(($years = age($rr['dob'],$rr['timezone'],'')) != 0)
|
||||
// $details .= '<br />' . t('Age: ') . $years ;
|
||||
// $details .= '<br />' . L10n::t('Age: ') . $years ;
|
||||
// }
|
||||
// if(strlen($rr['gender']))
|
||||
// $details .= '<br />' . t('Gender: ') . $rr['gender'];
|
||||
// $details .= '<br />' . L10n::t('Gender: ') . $rr['gender'];
|
||||
|
||||
$profile = $rr;
|
||||
|
||||
|
@ -136,20 +137,20 @@ function directory_content(App $a) {
|
|||
|| (x($profile,'region') == 1)
|
||||
|| (x($profile,'postal-code') == 1)
|
||||
|| (x($profile,'country-name') == 1))
|
||||
$location = t('Location:');
|
||||
$location = L10n::t('Location:');
|
||||
|
||||
$gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
|
||||
$gender = ((x($profile,'gender') == 1) ? L10n::t('Gender:') : False);
|
||||
|
||||
$marital = ((x($profile,'marital') == 1) ? t('Status:') : False);
|
||||
$marital = ((x($profile,'marital') == 1) ? L10n::t('Status:') : False);
|
||||
|
||||
$homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
|
||||
$homepage = ((x($profile,'homepage') == 1) ? L10n::t('Homepage:') : False);
|
||||
|
||||
$about = ((x($profile,'about') == 1) ? t('About:') : False);
|
||||
$about = ((x($profile,'about') == 1) ? L10n::t('About:') : False);
|
||||
|
||||
$location_e = $location;
|
||||
|
||||
$photo_menu = [
|
||||
'profile' => [t("View Profile"), Profile::zrl($profile_link)]
|
||||
'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
|
||||
];
|
||||
|
||||
$entry = [
|
||||
|
@ -180,31 +181,30 @@ function directory_content(App $a) {
|
|||
unset($profile);
|
||||
unset($location);
|
||||
|
||||
if(! $arr['entry'])
|
||||
if (!$arr['entry']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$entries[] = $arr['entry'];
|
||||
|
||||
}
|
||||
|
||||
$tpl = get_markup_template('directory_header.tpl');
|
||||
|
||||
$o .= replace_macros($tpl, [
|
||||
'$search' => $search,
|
||||
'$globaldir' => t('Global Directory'),
|
||||
'$globaldir' => L10n::t('Global Directory'),
|
||||
'$gdirpath' => $gdirpath,
|
||||
'$desc' => t('Find on this site'),
|
||||
'$desc' => L10n::t('Find on this site'),
|
||||
'$contacts' => $entries,
|
||||
'$finding' => t('Results for:'),
|
||||
'$finding' => L10n::t('Results for:'),
|
||||
'$findterm' => (strlen($search) ? $search : ""),
|
||||
'$title' => t('Site Directory'),
|
||||
'$submit' => t('Find'),
|
||||
'$title' => L10n::t('Site Directory'),
|
||||
'$submit' => L10n::t('Find'),
|
||||
'$paginate' => paginate($a),
|
||||
]);
|
||||
|
||||
} else {
|
||||
info(L10n::t("No entries \x28some entries may be hidden\x29.") . EOL);
|
||||
}
|
||||
else
|
||||
info( t("No entries \x28some entries may be hidden\x29.") . EOL);
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ use Friendica\App;
|
|||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -19,7 +20,7 @@ require_once 'mod/contacts.php';
|
|||
function dirfind_init(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL );
|
||||
notice(L10n::t('Permission denied.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -43,7 +44,7 @@ function dirfind_content(App $a, $prefix = "") {
|
|||
|
||||
if (strpos($search,'@') === 0) {
|
||||
$search = substr($search,1);
|
||||
$header = sprintf( t('People Search - %s'), $search);
|
||||
$header = L10n::t('People Search - %s', $search);
|
||||
if ((valid_email($search) && validate_email($search)) ||
|
||||
(substr(normalise_link($search), 0, 7) == "http://")) {
|
||||
$user_data = Probe::uri($search);
|
||||
|
@ -54,7 +55,7 @@ function dirfind_content(App $a, $prefix = "") {
|
|||
if (strpos($search,'!') === 0) {
|
||||
$search = substr($search,1);
|
||||
$community = true;
|
||||
$header = sprintf( t('Forum Search - %s'), $search);
|
||||
$header = L10n::t('Forum Search - %s', $search);
|
||||
}
|
||||
|
||||
$o = '';
|
||||
|
@ -213,10 +214,10 @@ function dirfind_content(App $a, $prefix = "") {
|
|||
}
|
||||
} else {
|
||||
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
|
||||
$conntxt = t('Connect');
|
||||
$conntxt = L10n::t('Connect');
|
||||
$photo_menu = [
|
||||
'profile' => [t("View Profile"), Profile::zrl($jj->url)],
|
||||
'follow' => [t("Connect/Follow"), $connlnk]
|
||||
'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
|
||||
'follow' => [L10n::t("Connect/Follow"), $connlnk]
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -251,7 +252,7 @@ function dirfind_content(App $a, $prefix = "") {
|
|||
]);
|
||||
|
||||
} else {
|
||||
info( t('No matches') . EOL);
|
||||
info(L10n::t('No matches') . EOL);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -63,7 +64,7 @@ function display_init(App $a)
|
|||
|
||||
if (!DBM::is_result($r)) {
|
||||
$a->error = 404;
|
||||
notice(t('Item not found.') . EOL);
|
||||
notice(L10n::t('Item not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
} elseif (($a->argc == 3) && ($nick == 'feed-item')) {
|
||||
|
@ -194,7 +195,7 @@ function display_fetchauthor($a, $item) {
|
|||
|
||||
function display_content(App $a, $update = false, $update_uid = 0) {
|
||||
if (Config::get('system','block_public') && !local_user() && !remote_user()) {
|
||||
notice(t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -240,7 +241,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
|
||||
if (!$item_id) {
|
||||
$a->error = 404;
|
||||
notice(t('Item not found.').EOL);
|
||||
notice(L10n::t('Item not found.').EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -301,7 +302,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
$is_owner = (local_user() && (in_array($a->profile['profile_uid'], [local_user(), 0])) ? true : false);
|
||||
|
||||
if (x($a->profile, 'hidewall') && !$is_owner && !$remote_contact) {
|
||||
notice(t('Access to this profile has been restricted.') . EOL);
|
||||
notice(L10n::t('Access to this profile has been restricted.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -342,7 +343,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(t('Item not found.') . EOL);
|
||||
notice(L10n::t('Item not found.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,24 +6,25 @@ use Friendica\App;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once 'include/acl_selectors.php';
|
||||
|
||||
function editpost_content(App $a) {
|
||||
|
||||
$o = '';
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
||||
|
||||
if (! $post_id) {
|
||||
notice( t('Item not found') . EOL);
|
||||
notice(L10n::t('Item not found') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -33,18 +34,18 @@ function editpost_content(App $a) {
|
|||
);
|
||||
|
||||
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']
|
||||
]);
|
||||
|
@ -52,7 +53,7 @@ function editpost_content(App $a) {
|
|||
$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']
|
||||
]);
|
||||
|
@ -90,7 +91,7 @@ function editpost_content(App $a) {
|
|||
/* 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>';
|
||||
}*/
|
||||
|
||||
|
||||
|
@ -105,23 +106,23 @@ function editpost_content(App $a) {
|
|||
'$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,
|
||||
|
@ -129,32 +130,29 @@ function editpost_content(App $a) {
|
|||
'$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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -99,18 +100,18 @@ function events_post(App $a) {
|
|||
$onerror_url = System::baseUrl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish";
|
||||
|
||||
if (strcmp($finish, $start) < 0 && !$nofinish) {
|
||||
notice(t('Event can not end before it has started.') . EOL);
|
||||
notice(L10n::t('Event can not end before it has started.') . EOL);
|
||||
if (intval($_REQUEST['preview'])) {
|
||||
echo t('Event can not end before it has started.');
|
||||
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);
|
||||
|
@ -191,7 +192,7 @@ function events_post(App $a) {
|
|||
function events_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -388,20 +389,20 @@ function events_content(App $a) {
|
|||
$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')) {
|
||||
|
@ -505,34 +506,34 @@ function events_content(App $a) {
|
|||
'$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'),
|
||||
|
||||
]);
|
||||
|
||||
|
@ -552,9 +553,9 @@ function events_content(App $a) {
|
|||
}
|
||||
|
||||
if ($del == 0) {
|
||||
notice(t('Failed to remove event' ) . EOL);
|
||||
notice(L10n::t('Failed to remove event') . EOL);
|
||||
} else {
|
||||
info(t('Event removed') . EOL);
|
||||
info(L10n::t('Event removed') . EOL);
|
||||
}
|
||||
|
||||
goaway(System::baseUrl() . '/events');
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -24,33 +25,36 @@ function fbrowser_content(App $a) {
|
|||
|
||||
$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];
|
||||
}
|
||||
|
@ -61,10 +65,11 @@ function fbrowser_content(App $a) {
|
|||
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']];
|
||||
|
@ -73,10 +78,11 @@ function fbrowser_content(App $a) {
|
|||
// 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'],
|
||||
|
@ -94,11 +100,11 @@ function fbrowser_content(App $a) {
|
|||
'$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) {
|
||||
|
@ -106,9 +112,10 @@ function fbrowser_content(App $a) {
|
|||
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'];
|
||||
|
||||
|
@ -121,24 +128,22 @@ function fbrowser_content(App $a) {
|
|||
$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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ This file is part of the Diaspora protocol. It is used for fetching single publi
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Util\XML;
|
||||
|
@ -12,7 +13,7 @@ function fetch_init(App $a)
|
|||
{
|
||||
|
||||
if (($a->argc != 3) || (!in_array($a->argv[1], ["post", "status_message", "reshare"]))) {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
|
||||
|
@ -48,7 +49,7 @@ function fetch_init(App $a)
|
|||
}
|
||||
}
|
||||
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
|
||||
|
@ -61,7 +62,7 @@ function fetch_init(App $a)
|
|||
);
|
||||
|
||||
if (!$r) {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
$user = $r[0];
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
<?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();
|
||||
}
|
||||
|
@ -18,19 +21,19 @@ function filer_content(App $a) {
|
|||
|
||||
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;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Profile;
|
||||
|
@ -12,7 +13,7 @@ use Friendica\Network\Probe;
|
|||
function follow_post(App $a) {
|
||||
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -40,9 +41,9 @@ function follow_post(App $a) {
|
|||
goaway(System::baseUrl().'/contacts/'.$result['cid']);
|
||||
}
|
||||
|
||||
info(t('Contact added').EOL);
|
||||
info(L10n::t('Contact added').EOL);
|
||||
|
||||
if (strstr($return_url,'contacts')) {
|
||||
if (strstr($return_url, 'contacts')) {
|
||||
goaway(System::baseUrl().'/contacts/'.$contact_id);
|
||||
}
|
||||
|
||||
|
@ -53,7 +54,7 @@ function follow_post(App $a) {
|
|||
function follow_content(App $a) {
|
||||
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -61,7 +62,7 @@ function follow_content(App $a) {
|
|||
$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 ...
|
||||
|
@ -72,7 +73,7 @@ function follow_content(App $a) {
|
|||
dbesc(normalise_link($url)), dbesc($url), dbesc(NETWORK_STATUSNET));
|
||||
|
||||
if ($r) {
|
||||
notice(t('You already added this contact.').EOL);
|
||||
notice(L10n::t('You already added this contact.').EOL);
|
||||
$submit = "";
|
||||
//goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
|
@ -80,22 +81,22 @@ function follow_content(App $a) {
|
|||
|
||||
$ret = Probe::uri($url);
|
||||
|
||||
if (($ret["network"] == NETWORK_DIASPORA) && !Config::get('system','diaspora_enabled')) {
|
||||
notice(t("Diaspora support isn't enabled. Contact can't be added.") . EOL);
|
||||
if (($ret["network"] == NETWORK_DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
|
||||
notice(L10n::t("Diaspora support isn't enabled. Contact can't be added.") . EOL);
|
||||
$submit = "";
|
||||
//goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
if (($ret["network"] == NETWORK_OSTATUS) && Config::get('system','ostatus_disabled')) {
|
||||
notice(t("OStatus support is disabled. Contact can't be added.") . EOL);
|
||||
if (($ret["network"] == NETWORK_OSTATUS) && Config::get('system', 'ostatus_disabled')) {
|
||||
notice(L10n::t("OStatus support is disabled. Contact can't be added.") . EOL);
|
||||
$submit = "";
|
||||
//goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
if ($ret["network"] == NETWORK_PHANTOM) {
|
||||
notice(t("The network type couldn't be detected. Contact can't be added.") . EOL);
|
||||
notice(L10n::t("The network type couldn't be detected. Contact can't be added.") . EOL);
|
||||
$submit = "";
|
||||
//goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
|
@ -116,7 +117,7 @@ function follow_content(App $a) {
|
|||
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid));
|
||||
|
||||
if (!$r) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -141,38 +142,38 @@ function follow_content(App $a) {
|
|||
$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'] = "";
|
||||
|
@ -181,8 +182,8 @@ function follow_content(App $a) {
|
|||
|
||||
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"]);
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
<?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']!='') {
|
||||
|
@ -30,7 +34,7 @@ function friendica_init(App $a) {
|
|||
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'];
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +61,7 @@ function friendica_init(App $a) {
|
|||
'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'
|
||||
];
|
||||
|
||||
|
@ -66,36 +70,37 @@ function friendica_init(App $a) {
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -109,13 +114,13 @@ function friendica_content(App $a) {
|
|||
}
|
||||
$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;
|
||||
}
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
* @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;
|
||||
}
|
||||
|
@ -23,7 +24,7 @@ function fsuggest_post(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Contact not found.') . EOL);
|
||||
notice(L10n::t('Contact not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
$contact = $r[0];
|
||||
|
@ -34,13 +35,12 @@ function fsuggest_post(App $a) {
|
|||
|
||||
$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()),
|
||||
|
@ -66,22 +66,17 @@ function fsuggest_post(App $a) {
|
|||
Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', $fsuggest_id);
|
||||
}
|
||||
|
||||
info( t('Friend suggestion sent.') . EOL);
|
||||
info(L10n::t('Friend suggestion sent.') . EOL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fsuggest_content(App $a)
|
||||
{
|
||||
require_once 'include/acl_selectors.php';
|
||||
|
||||
if (! local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -97,14 +92,14 @@ function fsuggest_content(App $a)
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice(t('Contact not found.') . EOL);
|
||||
notice(L10n::t('Contact not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
$contact = $r[0];
|
||||
|
||||
$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" >';
|
||||
|
||||
|
@ -116,7 +111,7 @@ function fsuggest_content(App $a)
|
|||
);
|
||||
|
||||
|
||||
$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;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -22,7 +23,7 @@ function group_init(App $a) {
|
|||
function group_post(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -32,13 +33,13 @@ function group_post(App $a) {
|
|||
$name = notags(trim($_POST['groupname']));
|
||||
$r = Group::create(local_user(), $name);
|
||||
if ($r) {
|
||||
info(t('Group created.') . EOL);
|
||||
info(L10n::t('Group created.') . EOL);
|
||||
$r = Group::getIdByName(local_user(), $name);
|
||||
if ($r) {
|
||||
goaway(System::baseUrl() . '/group/' . $r);
|
||||
}
|
||||
} else {
|
||||
notice(t('Could not create group.') . EOL);
|
||||
notice(L10n::t('Could not create group.') . EOL);
|
||||
}
|
||||
goaway(System::baseUrl() . '/group');
|
||||
return; // NOTREACHED
|
||||
|
@ -52,7 +53,7 @@ function group_post(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice(t('Group not found.') . EOL);
|
||||
notice(L10n::t('Group not found.') . EOL);
|
||||
goaway(System::baseUrl() . '/contacts');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -66,7 +67,7 @@ function group_post(App $a) {
|
|||
);
|
||||
|
||||
if ($r) {
|
||||
info(t('Group name changed.') . EOL);
|
||||
info(L10n::t('Group name changed.') . EOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +80,7 @@ function group_content(App $a) {
|
|||
$change = false;
|
||||
|
||||
if (! local_user()) {
|
||||
notice(t('Permission denied') . EOL);
|
||||
notice(L10n::t('Permission denied') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -93,13 +94,13 @@ function group_content(App $a) {
|
|||
$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"),
|
||||
]);
|
||||
|
@ -123,9 +124,9 @@ function group_content(App $a) {
|
|||
}
|
||||
|
||||
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');
|
||||
|
@ -154,7 +155,7 @@ function group_content(App $a) {
|
|||
);
|
||||
|
||||
if (! DBM::is_result($r)) {
|
||||
notice(t('Group not found.') . EOL);
|
||||
notice(L10n::t('Group not found.') . EOL);
|
||||
goaway(System::baseUrl() . '/contacts');
|
||||
}
|
||||
|
||||
|
@ -189,18 +190,18 @@ function group_content(App $a) {
|
|||
$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')
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -210,10 +211,10 @@ function group_content(App $a) {
|
|||
}
|
||||
|
||||
$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' => [],
|
||||
];
|
||||
|
||||
|
@ -226,7 +227,7 @@ function group_content(App $a) {
|
|||
$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
|
||||
|
@ -250,7 +251,7 @@ function group_content(App $a) {
|
|||
$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
|
||||
|
@ -262,7 +263,7 @@ function group_content(App $a) {
|
|||
}
|
||||
|
||||
$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']);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\Profile;
|
||||
|
||||
|
@ -14,7 +15,7 @@ function hcard_init(App $a)
|
|||
if ($a->argc > 1) {
|
||||
$which = $a->argv[1];
|
||||
} else {
|
||||
notice(t('No profile') . EOL);
|
||||
notice(L10n::t('No profile') . EOL);
|
||||
$a->error = 404;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
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')) {
|
||||
|
@ -44,22 +45,22 @@ function help_content(App $a) {
|
|||
$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.')
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?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;
|
||||
|
||||
|
@ -33,7 +36,7 @@ function home_content(App $a) {
|
|||
}
|
||||
|
||||
$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";
|
||||
|
|
157
mod/install.php
157
mod/install.php
|
@ -3,6 +3,7 @@
|
|||
* @file mod/install.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Database\DBStructure;
|
||||
|
@ -107,29 +108,29 @@ function install_content(App $a) {
|
|||
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;
|
||||
}
|
||||
|
@ -141,7 +142,7 @@ function install_content(App $a) {
|
|||
return replace_macros($tpl, [
|
||||
'$title' => $install_title,
|
||||
'$pass' => '',
|
||||
'$status' => t('Database already in use.'),
|
||||
'$status' => L10n::t('Database already in use.'),
|
||||
'$text' => '',
|
||||
]);
|
||||
}
|
||||
|
@ -198,12 +199,12 @@ function install_content(App $a) {
|
|||
$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(),
|
||||
]);
|
||||
|
@ -222,28 +223,28 @@ function install_content(App $a) {
|
|||
$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;
|
||||
|
@ -259,12 +260,12 @@ function install_content(App $a) {
|
|||
$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,
|
||||
|
||||
|
@ -274,16 +275,16 @@ function install_content(App $a) {
|
|||
'$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;
|
||||
|
@ -318,17 +319,17 @@ function check_php(&$phpath, &$checks) {
|
|||
}
|
||||
$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";
|
||||
|
@ -337,10 +338,10 @@ function check_php(&$phpath, &$checks) {
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -351,10 +352,10 @@ function check_php(&$phpath, &$checks) {
|
|||
$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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -377,59 +378,59 @@ function check_keys(&$checks) {
|
|||
// 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);
|
||||
|
@ -439,7 +440,7 @@ function check_funcs(&$checks) {
|
|||
$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.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -451,13 +452,13 @@ function check_htconfig(&$checks) {
|
|||
(!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);
|
||||
|
||||
}
|
||||
|
||||
|
@ -467,13 +468,13 @@ function check_smarty3(&$checks) {
|
|||
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);
|
||||
|
||||
}
|
||||
|
||||
|
@ -489,9 +490,9 @@ function check_htaccess(&$checks) {
|
|||
|
||||
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?
|
||||
|
@ -510,18 +511,18 @@ function check_imagik(&$checks) {
|
|||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -544,10 +545,10 @@ function load_database() {
|
|||
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>";
|
||||
}
|
||||
|
|
|
@ -7,56 +7,56 @@
|
|||
*/
|
||||
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),
|
||||
|
@ -66,7 +66,7 @@ function invite_post(App $a) {
|
|||
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;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ function invite_post(App $a) {
|
|||
$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"
|
||||
|
@ -84,69 +84,68 @@ function invite_post(App $a) {
|
|||
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;
|
||||
|
|
17
mod/item.php
17
mod/item.php
|
@ -17,6 +17,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -111,7 +112,7 @@ function item_post(App $a) {
|
|||
}
|
||||
|
||||
if (!DBM::is_result($parent_item)) {
|
||||
notice(t('Unable to locate original post.') . EOL);
|
||||
notice(L10n::t('Unable to locate original post.') . EOL);
|
||||
if (x($_REQUEST, 'return')) {
|
||||
goaway($return_path);
|
||||
}
|
||||
|
@ -157,7 +158,7 @@ function item_post(App $a) {
|
|||
|
||||
// Now check that valid personal details have been provided
|
||||
if (!can_write_wall($profile_uid) && !$allow_comment) {
|
||||
notice(t('Permission denied.') . EOL) ;
|
||||
notice(L10n::t('Permission denied.') . EOL) ;
|
||||
if (x($_REQUEST, 'return')) {
|
||||
goaway($return_path);
|
||||
}
|
||||
|
@ -271,7 +272,7 @@ function item_post(App $a) {
|
|||
if ($preview) {
|
||||
killme();
|
||||
}
|
||||
info(t('Empty post discarded.') . EOL);
|
||||
info(L10n::t('Empty post discarded.') . EOL);
|
||||
if (x($_REQUEST, 'return')) {
|
||||
goaway($return_path);
|
||||
}
|
||||
|
@ -468,7 +469,7 @@ function item_post(App $a) {
|
|||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
@ -799,14 +800,14 @@ function item_post(App $a) {
|
|||
if (!strlen($addr)) {
|
||||
continue;
|
||||
}
|
||||
$disclaimer = '<hr />' . sprintf(t('This message was sent to you by %s, a member of the Friendica social network.'), $a->user['username'])
|
||||
$disclaimer = '<hr />' . 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);
|
||||
|
|
|
@ -1,51 +1,58 @@
|
|||
<?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;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?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) {
|
||||
|
@ -32,7 +35,7 @@ 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();
|
||||
}
|
||||
|
||||
|
@ -40,7 +43,7 @@ function lockview_content(App $a) {
|
|||
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();
|
||||
}
|
||||
|
||||
|
@ -49,7 +52,7 @@ function lockview_content(App $a) {
|
|||
$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)) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/lostpass.php
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\User;
|
||||
|
@ -13,7 +13,6 @@ require_once 'boot.php';
|
|||
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)
|
||||
{
|
||||
|
@ -25,7 +24,7 @@ function lostpass_post(App $a)
|
|||
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
|
||||
$user = dba::selectFirst('user', ['uid', 'username', 'email'], $condition);
|
||||
if (!DBM::is_result($user)) {
|
||||
notice(t('No valid account found.') . EOL);
|
||||
notice(L10n::t('No valid account found.') . EOL);
|
||||
goaway(System::baseUrl());
|
||||
}
|
||||
|
||||
|
@ -37,13 +36,13 @@ function lostpass_post(App $a)
|
|||
];
|
||||
$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
|
||||
|
@ -54,7 +53,7 @@ function lostpass_post(App $a)
|
|||
|
||||
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
|
||||
|
@ -70,7 +69,7 @@ function lostpass_post(App $a)
|
|||
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
|
||||
]);
|
||||
|
@ -86,7 +85,7 @@ function lostpass_content(App $a)
|
|||
|
||||
$user = dba::selectFirst('user', ['uid', 'username', 'email', 'pwdreset_time'], ['pwdreset' => $pwdreset_token]);
|
||||
if (!DBM::is_result($user)) {
|
||||
notice(t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
||||
notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
||||
|
||||
return lostpass_form();
|
||||
}
|
||||
|
@ -99,7 +98,7 @@ function lostpass_content(App $a)
|
|||
];
|
||||
dba::update('user', $fields, ['uid' => $user['uid']]);
|
||||
|
||||
notice(t('Request has expired, please make a new one.'));
|
||||
notice(L10n::t('Request has expired, please make a new one.'));
|
||||
|
||||
return lostpass_form();
|
||||
}
|
||||
|
@ -114,10 +113,10 @@ function 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;
|
||||
|
@ -132,12 +131,12 @@ function lostpass_generate_password($user)
|
|||
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()
|
||||
]);
|
||||
|
@ -145,13 +144,13 @@ function lostpass_generate_password($user)
|
|||
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
|
||||
|
@ -164,7 +163,7 @@ function lostpass_generate_password($user)
|
|||
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
|
||||
]);
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?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://') {
|
||||
|
@ -18,7 +21,7 @@ function maintenance_content(App $a) {
|
|||
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
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/manage.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once("include/text.php");
|
||||
require_once "include/text.php";
|
||||
|
||||
function manage_post(App $a) {
|
||||
|
||||
|
@ -103,7 +106,7 @@ function manage_post(App $a) {
|
|||
function manage_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -152,11 +155,11 @@ function manage_content(App $a) {
|
|||
}
|
||||
|
||||
$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;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -43,7 +44,7 @@ function match_content(App $a)
|
|||
return;
|
||||
}
|
||||
if (! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
|
||||
notice(t('No keywords to match. Please add keywords to your default profile.') . EOL);
|
||||
notice(L10n::t('No keywords to match. Please add keywords to your default profile.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -84,8 +85,8 @@ function match_content(App $a)
|
|||
$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());
|
||||
|
@ -99,8 +100,8 @@ function match_content(App $a)
|
|||
'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,
|
||||
|
@ -115,12 +116,12 @@ function match_content(App $a)
|
|||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Content\Smilies;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -22,7 +23,7 @@ function message_init(App $a)
|
|||
}
|
||||
|
||||
$new = [
|
||||
'label' => t('New Message'),
|
||||
'label' => L10n::t('New Message'),
|
||||
'url' => 'message/new',
|
||||
'sel' => $a->argc > 1 && $a->argv[1] == 'new',
|
||||
'accesskey' => 'm',
|
||||
|
@ -51,7 +52,7 @@ function message_init(App $a)
|
|||
function message_post(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,20 +66,20 @@ function message_post(App $a)
|
|||
|
||||
switch ($ret) {
|
||||
case -1:
|
||||
notice(t('No recipient selected.') . EOL);
|
||||
notice(L10n::t('No recipient selected.') . EOL);
|
||||
$norecip = true;
|
||||
break;
|
||||
case -2:
|
||||
notice(t('Unable to locate contact information.') . EOL);
|
||||
notice(L10n::t('Unable to locate contact information.') . EOL);
|
||||
break;
|
||||
case -3:
|
||||
notice(t('Message could not be sent.') . EOL);
|
||||
notice(L10n::t('Message could not be sent.') . EOL);
|
||||
break;
|
||||
case -4:
|
||||
notice(t('Message collection failure.') . EOL);
|
||||
notice(L10n::t('Message collection failure.') . EOL);
|
||||
break;
|
||||
default:
|
||||
info(t('Message sent.') . EOL);
|
||||
info(L10n::t('Message sent.') . EOL);
|
||||
}
|
||||
|
||||
// fake it to go back to the input form if no recipient listed
|
||||
|
@ -96,7 +97,7 @@ function message_content(App $a)
|
|||
Nav::setSelected('messages');
|
||||
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -104,7 +105,7 @@ function message_content(App $a)
|
|||
|
||||
$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')) {
|
||||
|
@ -128,12 +129,12 @@ function message_content(App $a)
|
|||
//$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
|
||||
|
@ -148,7 +149,7 @@ function message_content(App $a)
|
|||
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']);
|
||||
|
@ -177,7 +178,7 @@ function message_content(App $a)
|
|||
//}
|
||||
|
||||
if ($r) {
|
||||
info(t('Conversation removed.') . EOL);
|
||||
info(L10n::t('Conversation removed.') . EOL);
|
||||
}
|
||||
}
|
||||
//goaway(System::baseUrl(true) . '/message' );
|
||||
|
@ -192,14 +193,14 @@ function message_content(App $a)
|
|||
$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;
|
||||
|
@ -242,23 +243,23 @@ function message_content(App $a)
|
|||
|
||||
$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;
|
||||
}
|
||||
|
@ -284,7 +285,7 @@ function message_content(App $a)
|
|||
$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;
|
||||
}
|
||||
|
||||
|
@ -323,7 +324,7 @@ function message_content(App $a)
|
|||
);
|
||||
}
|
||||
if (!count($messages)) {
|
||||
notice(t('Message not available.') . EOL);
|
||||
notice(L10n::t('Message not available.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -338,14 +339,14 @@ function message_content(App $a)
|
|||
$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 = [];
|
||||
|
@ -392,7 +393,7 @@ function message_content(App $a)
|
|||
'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']),
|
||||
|
@ -409,26 +410,26 @@ function message_content(App $a)
|
|||
'$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;
|
||||
|
@ -466,11 +467,11 @@ function render_messages(array $msg, $t)
|
|||
|
||||
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>');
|
||||
|
@ -492,13 +493,13 @@ function render_messages(array $msg, $t)
|
|||
'$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']),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use Friendica\Content\ForumManager;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
|
@ -25,7 +26,7 @@ require_once 'include/acl_selectors.php';
|
|||
function network_init(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,15 +188,15 @@ function saved_searches($search)
|
|||
'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,
|
||||
]);
|
||||
|
@ -540,9 +541,10 @@ function networkThreadedView(App $a, $update = 0)
|
|||
|
||||
if ($gid) {
|
||||
if (($t = Contact::getOStatusCountByGroupId($gid)) && !PConfig::get(local_user(), 'system', 'nowarn_insecure')) {
|
||||
notice(tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
|
||||
"Warning: This group contains %s members from a network that doesn't allow non public messages.", $t) . EOL);
|
||||
notice(t("Messages in this group won't be send to these receivers.") . EOL);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -610,7 +612,7 @@ function networkThreadedView(App $a, $update = 0)
|
|||
if ($update) {
|
||||
killme();
|
||||
}
|
||||
notice(t('No such group') . EOL);
|
||||
notice(L10n::t('No such group') . EOL);
|
||||
goaway('network/0');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -631,11 +633,11 @@ function networkThreadedView(App $a, $update = 0)
|
|||
$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',
|
||||
|
@ -660,12 +662,11 @@ function networkThreadedView(App $a, $update = 0)
|
|||
'id' => 'network',
|
||||
]) . $o;
|
||||
|
||||
if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(), 'system',
|
||||
'nowarn_insecure')) {
|
||||
notice(t('Private messages to this person are at risk of public disclosure.') . EOL);
|
||||
if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(),'system','nowarn_insecure')) {
|
||||
notice(L10n::t('Private messages to this person are at risk of public disclosure.') . EOL);
|
||||
}
|
||||
} else {
|
||||
notice(t('Invalid contact.') . EOL);
|
||||
notice(L10n::t('Invalid contact.') . EOL);
|
||||
goaway('network');
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -908,18 +909,18 @@ function network_tabs(App $a)
|
|||
// 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',
|
||||
],
|
||||
|
@ -927,10 +928,10 @@ function network_tabs(App $a)
|
|||
|
||||
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',
|
||||
];
|
||||
|
@ -938,10 +939,10 @@ function network_tabs(App $a)
|
|||
|
||||
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',
|
||||
];
|
||||
|
@ -949,10 +950,10 @@ function network_tabs(App $a)
|
|||
|
||||
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',
|
||||
];
|
||||
|
@ -960,10 +961,10 @@ function network_tabs(App $a)
|
|||
|
||||
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',
|
||||
];
|
||||
|
|
|
@ -1,54 +1,57 @@
|
|||
<?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>';
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Group;
|
||||
|
@ -24,7 +25,7 @@ function nogroup_init(App $a)
|
|||
function nogroup_content(App $a)
|
||||
{
|
||||
if (! local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -38,8 +39,8 @@ function nogroup_content(App $a)
|
|||
$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),
|
||||
|
@ -59,7 +60,7 @@ function nogroup_content(App $a)
|
|||
$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)]
|
||||
);
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
@ -20,21 +21,20 @@ function notes_init(App $a) {
|
|||
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 = [];
|
||||
|
||||
|
||||
|
@ -50,8 +50,8 @@ function notes_content(App $a, $update = false) {
|
|||
$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;
|
||||
|
@ -66,12 +66,11 @@ function notes_content(App $a, $update = 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
|
||||
|
@ -85,9 +84,9 @@ function notes_content(App $a, $update = false) {
|
|||
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)) {
|
||||
|
@ -100,7 +99,8 @@ function notes_content(App $a, $update = false) {
|
|||
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'])
|
||||
|
@ -111,27 +111,29 @@ function notes_content(App $a, $update = false) {
|
|||
$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;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
<?php
|
||||
|
||||
/* GNU Social -> friendica items permanent-url compatibility */
|
||||
/**
|
||||
* @file mod/notice.php
|
||||
* GNU Social -> friendica items permanent-url compatibility
|
||||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
function notice_init(App $a) {
|
||||
|
||||
function notice_init(App $a)
|
||||
{
|
||||
$id = $a->argv[1];
|
||||
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
|
||||
if (DBM::is_result($r)) {
|
||||
|
@ -16,7 +19,7 @@ function notice_init(App $a) {
|
|||
goaway($url);
|
||||
} else {
|
||||
$a->error = 404;
|
||||
notice(t('Item not found.') . EOL);
|
||||
notice(L10n::t('Item not found.') . EOL);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\NotificationsManager;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -35,7 +36,7 @@ function notifications_post(App $a) {
|
|||
$contact_id = $r[0]['contact-id'];
|
||||
}
|
||||
else {
|
||||
notice( t('Invalid request identifier.') . EOL);
|
||||
notice(L10n::t('Invalid request identifier.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -44,7 +45,7 @@ function notifications_post(App $a) {
|
|||
|
||||
$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)
|
||||
);
|
||||
|
@ -60,7 +61,7 @@ function notifications_post(App $a) {
|
|||
}
|
||||
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');
|
||||
|
@ -71,7 +72,7 @@ function notifications_post(App $a) {
|
|||
function notifications_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -96,7 +97,7 @@ function notifications_content(App $a) {
|
|||
// 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'));
|
||||
|
||||
|
@ -105,25 +106,25 @@ function notifications_content(App $a) {
|
|||
// 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);
|
||||
|
||||
}
|
||||
|
@ -152,7 +153,7 @@ function notifications_content(App $a) {
|
|||
// 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
|
||||
|
@ -164,23 +165,23 @@ function notifications_content(App $a) {
|
|||
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;
|
||||
|
||||
|
@ -195,16 +196,16 @@ function notifications_content(App $a) {
|
|||
|
||||
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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,8 +216,8 @@ function notifications_content(App $a) {
|
|||
'$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"];
|
||||
|
@ -227,14 +228,14 @@ function notifications_content(App $a) {
|
|||
$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'],
|
||||
|
@ -244,26 +245,26 @@ function notifications_content(App $a) {
|
|||
'$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,
|
||||
|
||||
]);
|
||||
|
@ -272,7 +273,7 @@ function notifications_content(App $a) {
|
|||
}
|
||||
|
||||
if($notifs['total'] == 0)
|
||||
info( t('No introductions.') . EOL);
|
||||
info(L10n::t('No introductions.') . EOL);
|
||||
|
||||
// Normal notifications (no introductions)
|
||||
} else {
|
||||
|
@ -310,16 +311,17 @@ function notifications_content(App $a) {
|
|||
|
||||
// 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, [
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
<?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;
|
||||
}
|
||||
|
@ -35,16 +39,16 @@ function notify_init(App $a) {
|
|||
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();
|
||||
}
|
||||
|
@ -59,7 +63,7 @@ function notify_content(App $a) {
|
|||
$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'])),
|
||||
|
@ -67,16 +71,14 @@ function notify_content(App $a) {
|
|||
]);
|
||||
}
|
||||
} 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;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/oexchange.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Module\Login;
|
||||
|
||||
|
@ -23,7 +26,7 @@ function oexchange_content(App $a) {
|
|||
}
|
||||
|
||||
if (($a->argc > 1) && $a->argv[1] === 'done') {
|
||||
info( t('Post successful.') . EOL);
|
||||
info(L10n::t('Post successful.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/openid.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
|
@ -24,7 +27,7 @@ function openid_content(App $a) {
|
|||
$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());
|
||||
}
|
||||
|
||||
|
@ -61,7 +64,7 @@ function openid_content(App $a) {
|
|||
// New registration?
|
||||
|
||||
if ($a->config['register_policy'] == REGISTER_CLOSED) {
|
||||
notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL);
|
||||
notice(L10n::t('Account not found and OpenID registration is not permitted on this site.') . EOL);
|
||||
goaway(System::baseUrl());
|
||||
}
|
||||
|
||||
|
@ -111,7 +114,7 @@ function openid_content(App $a) {
|
|||
// NOTREACHED
|
||||
}
|
||||
}
|
||||
notice( t('Login failed.') . EOL);
|
||||
notice(L10n::t('Login failed.') . EOL);
|
||||
goaway(System::baseUrl());
|
||||
// NOTREACHED
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* @file mod/ostatus_subscribe.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -11,12 +12,12 @@ use Friendica\Network\Probe;
|
|||
function ostatus_subscribe_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
$o = "<h2>".t("Subscribing to OStatus contacts")."</h2>";
|
||||
$o = "<h2>".L10n::t("Subscribing to OStatus contacts")."</h2>";
|
||||
|
||||
$uid = local_user();
|
||||
|
||||
|
@ -27,13 +28,13 @@ function ostatus_subscribe_content(App $a) {
|
|||
if (PConfig::get($uid, "ostatus", "legacy_friends") == "") {
|
||||
|
||||
if ($_REQUEST["url"] == "") {
|
||||
return $o.t("No contact provided.");
|
||||
return $o.L10n::t("No contact provided.");
|
||||
}
|
||||
|
||||
$contact = Probe::uri($_REQUEST["url"]);
|
||||
|
||||
if (!$contact) {
|
||||
return $o.t("Couldn't fetch information for contact.");
|
||||
return $o.L10n::t("Couldn't fetch information for contact.");
|
||||
}
|
||||
|
||||
$api = $contact["baseurl"]."/api/";
|
||||
|
@ -42,7 +43,7 @@ function ostatus_subscribe_content(App $a) {
|
|||
$data = z_fetch_url($api."statuses/friends.json?screen_name=".$contact["nick"]);
|
||||
|
||||
if (!$data["success"]) {
|
||||
return $o.t("Couldn't fetch friends for contact.");
|
||||
return $o.L10n::t("Couldn't fetch friends for contact.");
|
||||
}
|
||||
|
||||
PConfig::set($uid, "ostatus", "legacy_friends", $data["body"]);
|
||||
|
@ -56,7 +57,7 @@ function ostatus_subscribe_content(App $a) {
|
|||
$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;
|
||||
}
|
||||
|
||||
|
@ -70,17 +71,17 @@ function ostatus_subscribe_content(App $a) {
|
|||
if ($data["network"] == NETWORK_OSTATUS) {
|
||||
$result = Contact::createFromProbe($uid, $url, true, NETWORK_OSTATUS);
|
||||
if ($result["success"]) {
|
||||
$o .= " - ".t("success");
|
||||
$o .= " - ".L10n::t("success");
|
||||
} else {
|
||||
$o .= " - ".t("failed");
|
||||
$o .= " - ".L10n::t("failed");
|
||||
}
|
||||
} else {
|
||||
$o .= " - ".t("ignored");
|
||||
$o .= " - ".L10n::t("ignored");
|
||||
}
|
||||
|
||||
$o .= "</p>";
|
||||
|
||||
$o .= "<p>".t("Keep this window open until done.")."</p>";
|
||||
$o .= "<p>".L10n::t("Keep this window open until done.")."</p>";
|
||||
|
||||
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.System::baseUrl().'/ostatus_subscribe?counter='.$counter.'">';
|
||||
|
||||
|
|
|
@ -4,20 +4,21 @@ This file is part of the Diaspora protocol. It is used for fetching single publi
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
|
||||
function p_init($a){
|
||||
if ($a->argc != 2) {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 510 '.t('Not Extended'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 510 '.L10n::t('Not Extended'));
|
||||
killme();
|
||||
}
|
||||
|
||||
$guid = $a->argv[1];
|
||||
|
||||
if (strtolower(substr($guid, -4)) != ".xml") {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
|
||||
|
@ -44,7 +45,7 @@ function p_init($a){
|
|||
}
|
||||
}
|
||||
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
|
||||
|
@ -53,7 +54,7 @@ function p_init($a){
|
|||
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
|
||||
WHERE `user`.`uid` = %d", intval($item[0]["uid"]));
|
||||
if (!DBM::is_result($r)) {
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
|
||||
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
|
||||
killme();
|
||||
}
|
||||
$user = $r[0];
|
||||
|
|
203
mod/photos.php
203
mod/photos.php
|
@ -6,6 +6,7 @@ use Friendica\App;
|
|||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -81,7 +82,7 @@ function photos_init(App $a) {
|
|||
$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'],
|
||||
|
@ -101,11 +102,11 @@ function photos_init(App $a) {
|
|||
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
|
||||
]);
|
||||
}
|
||||
|
@ -119,7 +120,7 @@ function photos_init(App $a) {
|
|||
|
||||
$tpl = get_markup_template("photos_head.tpl");
|
||||
$a->page['htmlhead'] .= replace_macros($tpl,[
|
||||
'$ispublic' => t('everybody')
|
||||
'$ispublic' => L10n::t('everybody')
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -167,7 +168,7 @@ function photos_post(App $a)
|
|||
}
|
||||
|
||||
if (!$can_post) {
|
||||
notice( t('Permission denied.') . EOL );
|
||||
notice(L10n::t('Permission denied.') . EOL );
|
||||
killme();
|
||||
}
|
||||
|
||||
|
@ -177,7 +178,7 @@ function photos_post(App $a)
|
|||
);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
notice( t('Contact information unavailable') . EOL);
|
||||
notice(L10n::t('Contact information unavailable') . EOL);
|
||||
logger('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
|
||||
killme();
|
||||
}
|
||||
|
@ -187,7 +188,7 @@ function photos_post(App $a)
|
|||
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
|
||||
}
|
||||
|
@ -197,7 +198,7 @@ function photos_post(App $a)
|
|||
intval($page_owner_uid)
|
||||
);
|
||||
if (!DBM::is_result($r)) {
|
||||
notice( t('Album not found.') . EOL);
|
||||
notice(L10n::t('Album not found.') . EOL);
|
||||
goaway($_SESSION['photo_return']);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -227,7 +228,7 @@ function photos_post(App $a)
|
|||
* 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;
|
||||
|
@ -236,12 +237,12 @@ function photos_post(App $a)
|
|||
];
|
||||
$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;
|
||||
|
@ -316,7 +317,7 @@ function photos_post(App $a)
|
|||
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
|
||||
|
||||
|
@ -325,12 +326,12 @@ function photos_post(App $a)
|
|||
$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;
|
||||
|
@ -694,7 +695,7 @@ function photos_post(App $a)
|
|||
$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>';
|
||||
|
@ -749,7 +750,7 @@ function photos_post(App $a)
|
|||
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;
|
||||
|
@ -790,21 +791,21 @@ function photos_post(App $a)
|
|||
if ($error !== UPLOAD_ERR_OK) {
|
||||
switch ($error) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
notice(t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
|
||||
notice(L10n::t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
notice(t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
|
||||
notice(L10n::t('Image exceeds size limit of %s', formatBytes(defaults($_REQUEST, 'MAX_FILE_SIZE', 0))) . EOL);
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
notice(t('Image upload didn\'t complete, please try again') . EOL);
|
||||
notice(L10n::t('Image upload didn\'t complete, please try again') . EOL);
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
notice(t('Image file is missing') . EOL);
|
||||
notice(L10n::t('Image file is missing') . EOL);
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
notice(t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
|
||||
notice(L10n::t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
|
||||
break;
|
||||
}
|
||||
@unlink($src);
|
||||
|
@ -822,7 +823,7 @@ function photos_post(App $a)
|
|||
$maximagesize = Config::get('system', 'maximagesize');
|
||||
|
||||
if ($maximagesize && ($filesize > $maximagesize)) {
|
||||
notice(t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
|
||||
notice(L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)) . EOL);
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
Addon::callHooks('photo_post_end', $foo);
|
||||
|
@ -830,7 +831,7 @@ function photos_post(App $a)
|
|||
}
|
||||
|
||||
if (!$filesize) {
|
||||
notice(t('Image file is empty.') . EOL);
|
||||
notice(L10n::t('Image file is empty.') . EOL);
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
Addon::callHooks('photo_post_end', $foo);
|
||||
|
@ -845,7 +846,7 @@ function photos_post(App $a)
|
|||
|
||||
if (!$Image->isValid()) {
|
||||
logger('mod/photos.php: photos_post(): unable to process image' , LOGGER_DEBUG);
|
||||
notice(t('Unable to process image.') . EOL);
|
||||
notice(L10n::t('Unable to process image.') . EOL);
|
||||
@unlink($src);
|
||||
$foo = 0;
|
||||
Addon::callHooks('photo_post_end',$foo);
|
||||
|
@ -873,8 +874,8 @@ function photos_post(App $a)
|
|||
$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();
|
||||
}
|
||||
|
||||
|
@ -959,7 +960,7 @@ function photos_content(App $a)
|
|||
// photos/name/image/xxxxx/edit
|
||||
|
||||
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
|
||||
notice( t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -968,7 +969,7 @@ function photos_content(App $a)
|
|||
require_once 'include/conversation.php';
|
||||
|
||||
if (!x($a->data,'user')) {
|
||||
notice( t('No photos selected') . EOL );
|
||||
notice(L10n::t('No photos selected') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1064,7 +1065,7 @@ function photos_content(App $a)
|
|||
}
|
||||
|
||||
if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
|
||||
notice( t('Access to this item is restricted.') . EOL);
|
||||
notice(L10n::t('Access to this item is restricted.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1079,7 +1080,7 @@ function photos_content(App $a)
|
|||
// Display upload form
|
||||
if ($datatype === 'upload') {
|
||||
if (!$can_post) {
|
||||
notice(t('Permission denied.'));
|
||||
notice(L10n::t('Permission denied.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1090,7 +1091,7 @@ function photos_content(App $a)
|
|||
$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" ' : '');
|
||||
|
@ -1108,7 +1109,7 @@ function photos_content(App $a)
|
|||
|
||||
$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 = '';
|
||||
|
@ -1118,15 +1119,15 @@ function photos_content(App $a)
|
|||
$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 : ''),
|
||||
|
@ -1134,8 +1135,8 @@ function photos_content(App $a)
|
|||
'$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,
|
||||
]);
|
||||
|
||||
|
@ -1177,32 +1178,32 @@ function photos_content(App $a)
|
|||
|
||||
// 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 = [];
|
||||
|
@ -1223,7 +1224,7 @@ function photos_content(App $a)
|
|||
'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,
|
||||
|
@ -1238,7 +1239,7 @@ function photos_content(App $a)
|
|||
'$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),
|
||||
|
@ -1264,9 +1265,9 @@ function photos_content(App $a)
|
|||
dbesc($datum)
|
||||
);
|
||||
if (DBM::is_result($ph)) {
|
||||
notice(t('Permission denied. Access to this item may be restricted.'));
|
||||
notice(L10n::t('Permission denied. Access to this item may be restricted.'));
|
||||
} else {
|
||||
notice(t('Photo not available') . EOL );
|
||||
notice(L10n::t('Photo not available') . EOL );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1329,14 +1330,14 @@ function photos_content(App $a)
|
|||
|
||||
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);
|
||||
|
||||
|
||||
|
@ -1355,7 +1356,7 @@ function photos_content(App $a)
|
|||
|
||||
$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'],
|
||||
|
@ -1446,10 +1447,10 @@ function photos_content(App $a)
|
|||
}
|
||||
$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]');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1464,25 +1465,25 @@ function photos_content(App $a)
|
|||
|
||||
$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,
|
||||
]);
|
||||
}
|
||||
|
@ -1503,9 +1504,9 @@ function photos_content(App $a)
|
|||
$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,
|
||||
]);
|
||||
}
|
||||
|
@ -1520,12 +1521,12 @@ function photos_content(App $a)
|
|||
'$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)
|
||||
]);
|
||||
|
@ -1533,8 +1534,8 @@ function photos_content(App $a)
|
|||
}
|
||||
|
||||
$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
|
||||
|
@ -1559,12 +1560,12 @@ function photos_content(App $a)
|
|||
'$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)
|
||||
]);
|
||||
|
@ -1601,8 +1602,8 @@ function photos_content(App $a)
|
|||
$drop = [
|
||||
'dropping' => $dropping,
|
||||
'pagedrop' => false,
|
||||
'select' => t('Select'),
|
||||
'delete' => t('Delete'),
|
||||
'select' => L10n::t('Select'),
|
||||
'delete' => L10n::t('Delete'),
|
||||
];
|
||||
|
||||
$name_e = $profile_name;
|
||||
|
@ -1632,12 +1633,12 @@ function photos_content(App $a)
|
|||
'$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)
|
||||
]);
|
||||
|
@ -1666,7 +1667,7 @@ function photos_content(App $a)
|
|||
'$tags' => $tags,
|
||||
'$edit' => $edit,
|
||||
'$map' => $map,
|
||||
'$map_text' => t('Map'),
|
||||
'$map_text' => L10n::t('Map'),
|
||||
'$likebuttons' => $likebuttons,
|
||||
'$like' => $like,
|
||||
'$dislike' => $dislike,
|
||||
|
@ -1691,7 +1692,7 @@ function photos_content(App $a)
|
|||
$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));
|
||||
|
@ -1705,7 +1706,7 @@ function photos_content(App $a)
|
|||
$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'])
|
||||
);
|
||||
|
@ -1716,7 +1717,7 @@ function photos_content(App $a)
|
|||
$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;
|
||||
|
@ -1730,13 +1731,13 @@ function photos_content(App $a)
|
|||
'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'),
|
||||
],
|
||||
|
||||
];
|
||||
|
@ -1745,9 +1746,9 @@ function photos_content(App $a)
|
|||
|
||||
$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),
|
||||
]);
|
||||
|
|
|
@ -7,6 +7,7 @@ use Friendica\Content\Feature;
|
|||
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;
|
||||
|
@ -286,7 +287,7 @@ function ping_init(App $a)
|
|||
'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;
|
||||
}
|
||||
|
@ -301,7 +302,7 @@ function ping_init(App $a)
|
|||
'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;
|
||||
}
|
||||
|
@ -316,7 +317,7 @@ function ping_init(App $a)
|
|||
'photo' => $reg['micro'],
|
||||
'date' => $reg['created'],
|
||||
'seen' => false,
|
||||
'message' => t('{0} requested registration'),
|
||||
'message' => L10n::t('{0} requested registration'),
|
||||
];
|
||||
$notifs[] = $notif;
|
||||
}
|
||||
|
|
24
mod/poke.php
24
mod/poke.php
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
|
||||
* This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
|
||||
|
@ -16,13 +15,14 @@
|
|||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
require_once 'include/security.php';
|
||||
require_once 'include/bbcode.php';
|
||||
require_once 'include/items.php';
|
||||
|
||||
function poke_init(App $a) {
|
||||
|
||||
|
@ -124,7 +124,7 @@ 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");
|
||||
|
@ -155,7 +155,7 @@ function poke_init(App $a) {
|
|||
function poke_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -197,14 +197,14 @@ function poke_content(App $a) {
|
|||
$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
|
||||
]);
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
<?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();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ use Friendica\Content\Widget;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -29,7 +30,7 @@ function profile_init(App $a)
|
|||
goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']);
|
||||
} else {
|
||||
logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG);
|
||||
notice(t('Requested profile is not available.') . EOL);
|
||||
notice(L10n::t('Requested profile is not available.') . EOL);
|
||||
$a->error = 404;
|
||||
return;
|
||||
}
|
||||
|
@ -70,9 +71,9 @@ function profile_init(App $a)
|
|||
}
|
||||
|
||||
$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);
|
||||
|
@ -167,7 +168,7 @@ function profile_content(App $a, $update = 0)
|
|||
$last_updated_key = "profile:" . $a->profile['profile_uid'] . ":" . local_user() . ":" . remote_user();
|
||||
|
||||
if (x($a->profile, 'hidewall') && !$is_owner && !$remote_contact) {
|
||||
notice(t('Access to this profile has been restricted.') . EOL);
|
||||
notice(L10n::t('Access to this profile has been restricted.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -188,7 +189,7 @@ function profile_content(App $a, $update = 0)
|
|||
$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;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -23,7 +24,7 @@ function profile_photo_init(App $a)
|
|||
function profile_photo_post(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice ( t('Permission denied.') . EOL );
|
||||
notice(L10n::t('Permission denied.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -48,7 +49,7 @@ function profile_photo_post(App $a) {
|
|||
// phase 2 - we have finished cropping
|
||||
|
||||
if($a->argc != 2) {
|
||||
notice( t('Image uploaded but image cropping failed.') . EOL );
|
||||
notice(L10n::t('Image uploaded but image cropping failed.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -78,26 +79,26 @@ function profile_photo_post(App $a) {
|
|||
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
|
||||
|
@ -131,7 +132,7 @@ function profile_photo_post(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
info( t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
|
||||
info(L10n::t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
|
||||
// Update global directory in background
|
||||
$url = System::baseUrl() . '/profile/' . $a->user['nickname'];
|
||||
if ($url && strlen(Config::get('system','directory'))) {
|
||||
|
@ -140,7 +141,7 @@ function profile_photo_post(App $a) {
|
|||
|
||||
Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
|
||||
} else {
|
||||
notice( t('Unable to process image') . EOL);
|
||||
notice(L10n::t('Unable to process image') . EOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,7 +160,7 @@ function profile_photo_post(App $a) {
|
|||
$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;
|
||||
}
|
||||
|
@ -168,7 +169,7 @@ function profile_photo_post(App $a) {
|
|||
$ph = new Image($imagedata, $filetype);
|
||||
|
||||
if (! $ph->isValid()) {
|
||||
notice(t('Unable to process image.') . EOL);
|
||||
notice(L10n::t('Unable to process image.') . EOL);
|
||||
@unlink($src);
|
||||
return;
|
||||
}
|
||||
|
@ -182,7 +183,7 @@ function profile_photo_post(App $a) {
|
|||
function profile_photo_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL );
|
||||
notice(L10n::t('Permission denied.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -193,7 +194,7 @@ function profile_photo_content(App $a) {
|
|||
|
||||
if( $a->argv[1]=='use'){
|
||||
if ($a->argc<3){
|
||||
notice( t('Permission denied.') . EOL );
|
||||
notice(L10n::t('Permission denied.') . EOL );
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -206,7 +207,7 @@ function profile_photo_content(App $a) {
|
|||
dbesc($resource_id)
|
||||
);
|
||||
if (!DBM::is_result($r)){
|
||||
notice( t('Permission denied.') . EOL );
|
||||
notice(L10n::t('Permission denied.') . EOL );
|
||||
return;
|
||||
}
|
||||
$havescale = false;
|
||||
|
@ -217,7 +218,7 @@ function profile_photo_content(App $a) {
|
|||
|
||||
// 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()));
|
||||
|
||||
|
@ -256,13 +257,13 @@ function profile_photo_content(App $a) {
|
|||
|
||||
$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;
|
||||
|
@ -276,10 +277,10 @@ function profile_photo_content(App $a) {
|
|||
'$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;
|
||||
}
|
||||
|
@ -311,20 +312,20 @@ function profile_photo_crop_ui_head(App $a, Image $Image) {
|
|||
|
||||
$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;
|
||||
}
|
||||
|
|
203
mod/profiles.php
203
mod/profiles.php
|
@ -8,6 +8,7 @@ use Friendica\Content\Feature;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -30,7 +31,7 @@ function profiles_init(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
notice(L10n::t('Profile not found.') . EOL);
|
||||
goaway('profiles');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -49,7 +50,7 @@ function profiles_init(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
info(t('Profile deleted.').EOL);
|
||||
info(L10n::t('Profile deleted.').EOL);
|
||||
}
|
||||
|
||||
goaway('profiles');
|
||||
|
@ -65,7 +66,7 @@ function profiles_init(App $a) {
|
|||
|
||||
$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()));
|
||||
|
@ -84,7 +85,7 @@ function profiles_init(App $a) {
|
|||
dbesc($name)
|
||||
);
|
||||
|
||||
info( t('New profile created.') . EOL);
|
||||
info(L10n::t('New profile created.') . EOL);
|
||||
if (DBM::is_result($r3) && count($r3) == 1) {
|
||||
goaway('profiles/' . $r3[0]['id']);
|
||||
}
|
||||
|
@ -101,13 +102,13 @@ function profiles_init(App $a) {
|
|||
|
||||
$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;
|
||||
}
|
||||
|
@ -123,7 +124,7 @@ function profiles_init(App $a) {
|
|||
intval(local_user()),
|
||||
dbesc($name)
|
||||
);
|
||||
info( t('New profile created.') . EOL);
|
||||
info(L10n::t('New profile created.') . EOL);
|
||||
if ((DBM::is_result($r3)) && (count($r3) == 1)) {
|
||||
goaway('profiles/'.$r3[0]['id']);
|
||||
}
|
||||
|
@ -140,7 +141,7 @@ function profiles_init(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
notice(L10n::t('Profile not found.') . EOL);
|
||||
killme();
|
||||
return;
|
||||
}
|
||||
|
@ -173,7 +174,7 @@ function profile_clean_keywords($keywords) {
|
|||
function profiles_post(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,7 +188,7 @@ function profiles_post(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($orig)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
notice(L10n::t('Profile not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -197,7 +198,7 @@ function profiles_post(App $a) {
|
|||
|
||||
$profile_name = notags(trim($_POST['profile_name']));
|
||||
if (! strlen($profile_name)) {
|
||||
notice( t('Profile Name is required.') . EOL);
|
||||
notice(L10n::t('Profile Name is required.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -337,61 +338,61 @@ function profiles_post(App $a) {
|
|||
$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;
|
||||
|
@ -476,7 +477,7 @@ function profiles_post(App $a) {
|
|||
);
|
||||
|
||||
if ($r) {
|
||||
info(t('Profile updated.') . EOL);
|
||||
info(L10n::t('Profile updated.') . EOL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -568,7 +569,7 @@ function profile_activity($changed, $value) {
|
|||
foreach ($changed as $ch) {
|
||||
if (strlen($changes)) {
|
||||
if ($z == ($t - 1)) {
|
||||
$changes .= t(' and ');
|
||||
$changes .= L10n::t(' and ');
|
||||
} else {
|
||||
$changes .= ', ';
|
||||
}
|
||||
|
@ -577,13 +578,13 @@ function profile_activity($changed, $value) {
|
|||
$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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -610,7 +611,7 @@ function profile_activity($changed, $value) {
|
|||
function profiles_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -622,7 +623,7 @@ function profiles_content(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Profile not found.') . EOL);
|
||||
notice(L10n::t('Profile not found.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -637,14 +638,14 @@ function profiles_content(App $a) {
|
|||
$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\" " : "")
|
||||
]);
|
||||
|
@ -662,10 +663,10 @@ function profiles_content(App $a) {
|
|||
|
||||
'$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'),
|
||||
|
@ -674,73 +675,73 @@ function profiles_content(App $a) {
|
|||
'$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'),
|
||||
'$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' => 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_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' => 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'),
|
||||
'$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];
|
||||
|
@ -771,18 +772,18 @@ function profiles_content(App $a) {
|
|||
$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
|
||||
]);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Profile;
|
||||
|
@ -24,13 +25,13 @@ function profperm_init(App $a)
|
|||
function profperm_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied') . EOL);
|
||||
notice(L10n::t('Permission denied') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($a->argc < 2) {
|
||||
notice( t('Invalid profile identifier.') . EOL );
|
||||
notice(L10n::t('Invalid profile identifier.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -59,7 +60,7 @@ function profperm_content(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
if (! DBM::is_result($r)) {
|
||||
notice( t('Invalid profile identifier.') . EOL );
|
||||
notice(L10n::t('Invalid profile identifier.') . EOL );
|
||||
return;
|
||||
}
|
||||
$profile = $r[0];
|
||||
|
@ -105,11 +106,11 @@ function profperm_content(App $a) {
|
|||
$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>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -118,7 +119,7 @@ function profperm_content(App $a) {
|
|||
$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">';
|
||||
|
||||
|
@ -134,7 +135,7 @@ function profperm_content(App $a) {
|
|||
$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">';
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?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;
|
||||
|
@ -45,7 +48,7 @@ function register_post(App $a)
|
|||
default:
|
||||
case REGISTER_CLOSED:
|
||||
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
$blocked = 1;
|
||||
|
@ -58,7 +61,7 @@ function register_post(App $a)
|
|||
|
||||
$arr['blocked'] = $blocked;
|
||||
$arr['verified'] = $verified;
|
||||
$arr['language'] = get_browser_language();
|
||||
$arr['language'] = L10n::getBrowserLanguage();
|
||||
|
||||
try {
|
||||
$result = User::create($arr);
|
||||
|
@ -90,23 +93,23 @@ function register_post(App $a)
|
|||
$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());
|
||||
}
|
||||
|
||||
|
@ -153,7 +156,7 @@ function register_post(App $a)
|
|||
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());
|
||||
}
|
||||
|
||||
|
@ -182,7 +185,7 @@ function register_content(App $a)
|
|||
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
|
||||
if ($r && $r[0]['total'] >= $max_dailies) {
|
||||
logger('max daily registrations exceeded.');
|
||||
notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
|
||||
notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -211,13 +214,13 @@ function register_content(App $a)
|
|||
$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" />';
|
||||
|
@ -225,11 +228,11 @@ function register_content(App $a)
|
|||
$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'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -250,34 +253,34 @@ function register_content(App $a)
|
|||
'$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;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?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;
|
||||
|
@ -50,7 +53,7 @@ function user_allow($hash)
|
|||
}
|
||||
}
|
||||
|
||||
push_lang($register[0]['language']);
|
||||
L10n::pushLang($register[0]['language']);
|
||||
|
||||
User::sendRegisterOpenEmail(
|
||||
$user[0]['email'],
|
||||
|
@ -59,10 +62,10 @@ function user_allow($hash)
|
|||
$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;
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +90,7 @@ function user_deny($hash)
|
|||
dba::delete('user', ['uid' => $register[0]['uid']]);
|
||||
dba::delete('register', ['hash' => $register[0]['hash']]);
|
||||
|
||||
notice(sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
|
||||
notice(L10n::t('Registration revoked for %s', $user[0]['username']) . EOL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -96,13 +99,13 @@ function regmod_content(App $a)
|
|||
global $lang;
|
||||
|
||||
if (!local_user()) {
|
||||
info(t('Please login.') . EOL);
|
||||
info(L10n::t('Please login.') . EOL);
|
||||
$o .= '<br /><br />' . Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
|
||||
return $o;
|
||||
}
|
||||
|
||||
if ((!is_site_admin()) || (x($_SESSION, 'submanage') && intval($_SESSION['submanage']))) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/removeme.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\User;
|
||||
|
||||
|
@ -49,10 +52,10 @@ function removeme_content(App $a)
|
|||
$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;
|
||||
|
|
|
@ -3,18 +3,19 @@
|
|||
* @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();
|
||||
|
||||
|
@ -30,7 +31,7 @@ function repair_ostatus_content(App $a) {
|
|||
intval(CONTACT_IS_SHARING));
|
||||
|
||||
if (!$r)
|
||||
return($o.t("Error"));
|
||||
return($o.L10n::t("Error"));
|
||||
|
||||
$total = $r[0]["total"];
|
||||
|
||||
|
@ -44,15 +45,15 @@ function repair_ostatus_content(App $a) {
|
|||
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.'">';
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ use Friendica\Content\Feature;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once "include/bbcode.php";
|
||||
|
@ -32,7 +33,7 @@ function search_saved_searches() {
|
|||
'id' => $rr['id'],
|
||||
'term' => $rr['term'],
|
||||
'encodedterm' => urlencode($rr['term']),
|
||||
'delete' => t('Remove term'),
|
||||
'delete' => L10n::t('Remove term'),
|
||||
'selected' => ($search==$rr['term']),
|
||||
];
|
||||
}
|
||||
|
@ -41,7 +42,7 @@ function search_saved_searches() {
|
|||
$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,
|
||||
|
@ -93,16 +94,16 @@ function search_post(App $a) {
|
|||
function search_content(App $a) {
|
||||
|
||||
if (Config::get('system','block_public') && !local_user() && !remote_user()) {
|
||||
notice(t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -124,8 +125,8 @@ function search_content(App $a) {
|
|||
$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);
|
||||
|
@ -150,7 +151,7 @@ function search_content(App $a) {
|
|||
// 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)
|
||||
]);
|
||||
|
@ -220,15 +221,16 @@ function search_content(App $a) {
|
|||
}
|
||||
|
||||
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
|
||||
|
|
409
mod/settings.php
409
mod/settings.php
|
@ -8,6 +8,7 @@ use Friendica\Content\Feature;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -34,20 +35,20 @@ function get_theme_config_file($theme)
|
|||
function settings_init(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
// 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',
|
||||
|
@ -56,7 +57,7 @@ function settings_init(App $a)
|
|||
|
||||
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',
|
||||
|
@ -64,49 +65,49 @@ function settings_init(App $a)
|
|||
}
|
||||
|
||||
$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',
|
||||
|
@ -115,7 +116,7 @@ function settings_init(App $a)
|
|||
|
||||
$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,
|
||||
]);
|
||||
|
@ -133,7 +134,7 @@ function settings_post(App $a)
|
|||
}
|
||||
|
||||
if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -160,9 +161,9 @@ function settings_post(App $a)
|
|||
$icon = defaults($_POST, 'icon' , '');
|
||||
|
||||
if ($name == "" || $key == "" || $secret == "") {
|
||||
notice(t("Missing some important data!"));
|
||||
notice(L10n::t("Missing some important data!"));
|
||||
} else {
|
||||
if ($_POST['submit']==t("Update")) {
|
||||
if ($_POST['submit'] == L10n::t("Update")) {
|
||||
q("UPDATE clients SET
|
||||
client_id='%s',
|
||||
pw='%s',
|
||||
|
@ -271,12 +272,12 @@ function settings_post(App $a)
|
|||
unset($dcrpass);
|
||||
if (!$mbox) {
|
||||
$failed = true;
|
||||
notice(t('Failed to connect with email account using the settings provided.') . EOL);
|
||||
notice(L10n::t('Failed to connect with email account using the settings provided.') . EOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$failed) {
|
||||
info(t('Email settings updated.') . EOL);
|
||||
info(L10n::t('Email settings updated.') . EOL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -292,7 +293,7 @@ function settings_post(App $a)
|
|||
PConfig::set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
|
||||
}
|
||||
}
|
||||
info(t('Features updated') . EOL);
|
||||
info(L10n::t('Features updated') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -364,7 +365,7 @@ function settings_post(App $a)
|
|||
|
||||
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');
|
||||
}
|
||||
|
||||
|
@ -376,27 +377,27 @@ function settings_post(App $a)
|
|||
|
||||
$err = false;
|
||||
if ($newpass != $confirm) {
|
||||
notice(t('Passwords do not match. Password unchanged.') . EOL);
|
||||
notice(L10n::t('Passwords do not match. Password unchanged.') . EOL);
|
||||
$err = true;
|
||||
}
|
||||
|
||||
if (!x($newpass) || !x($confirm)) {
|
||||
notice(t('Empty passwords are not allowed. Password unchanged.') . EOL);
|
||||
notice(L10n::t('Empty passwords are not allowed. Password unchanged.') . EOL);
|
||||
$err = true;
|
||||
}
|
||||
|
||||
// check if the old password was supplied correctly before changing it to the new value
|
||||
if (!User::authenticate(intval(local_user()), $_POST['opassword'])) {
|
||||
notice(t('Wrong password.') . EOL);
|
||||
notice(L10n::t('Wrong password.') . EOL);
|
||||
$err = true;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -486,10 +487,10 @@ function settings_post(App $a)
|
|||
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.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -497,19 +498,19 @@ function settings_post(App $a)
|
|||
$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'];
|
||||
}
|
||||
}
|
||||
|
@ -563,10 +564,10 @@ function settings_post(App $a)
|
|||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -606,7 +607,7 @@ function settings_post(App $a)
|
|||
intval(local_user())
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
info(t('Settings updated.') . EOL);
|
||||
info(L10n::t('Settings updated.') . EOL);
|
||||
}
|
||||
|
||||
// clear session language
|
||||
|
@ -658,12 +659,12 @@ function settings_content(App $a)
|
|||
Nav::setSelected('settings');
|
||||
|
||||
if (!local_user()) {
|
||||
//notice(t('Permission denied.') . EOL);
|
||||
//notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -672,14 +673,14 @@ function settings_content(App $a)
|
|||
$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;
|
||||
}
|
||||
|
@ -690,7 +691,7 @@ function settings_content(App $a)
|
|||
local_user());
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(t("You can't edit this application."));
|
||||
notice(L10n::t("You can't edit this application."));
|
||||
return;
|
||||
}
|
||||
$app = $r[0];
|
||||
|
@ -698,14 +699,14 @@ function settings_content(App $a)
|
|||
$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;
|
||||
}
|
||||
|
@ -733,13 +734,13 @@ function settings_content(App $a)
|
|||
$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;
|
||||
|
@ -750,7 +751,7 @@ function settings_content(App $a)
|
|||
|
||||
$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);
|
||||
|
@ -759,7 +760,7 @@ function settings_content(App $a)
|
|||
$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;
|
||||
|
@ -773,16 +774,16 @@ function settings_content(App $a)
|
|||
$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;
|
||||
}
|
||||
|
@ -802,8 +803,8 @@ function settings_content(App $a)
|
|||
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 = "";
|
||||
|
@ -834,41 +835,41 @@ function settings_content(App $a)
|
|||
|
||||
$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);
|
||||
|
@ -901,7 +902,7 @@ function settings_content(App $a)
|
|||
|
||||
|
||||
$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');
|
||||
|
@ -910,9 +911,9 @@ function settings_content(App $a)
|
|||
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;
|
||||
|
@ -939,7 +940,7 @@ function settings_content(App $a)
|
|||
|
||||
$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);
|
||||
|
@ -955,37 +956,37 @@ function settings_content(App $a)
|
|||
|
||||
$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.')],
|
||||
'$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' => t('General Theme Settings'),
|
||||
'$d_ctset' => t('Custom Theme Settings'),
|
||||
'$d_cset' => t('Content Settings'),
|
||||
'stitle' => t('Theme settings'),
|
||||
'$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;
|
||||
|
@ -1000,7 +1001,7 @@ function settings_content(App $a)
|
|||
|
||||
$profile = dba::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
|
||||
if (!DBM::is_result($profile)) {
|
||||
notice(t('Unable to find your profile. Please contact your admin.') . EOL);
|
||||
notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1042,49 +1043,49 @@ function settings_content(App $a)
|
|||
$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)],
|
||||
|
||||
|
||||
|
@ -1095,7 +1096,7 @@ function settings_content(App $a)
|
|||
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");
|
||||
|
@ -1103,64 +1104,64 @@ function settings_content(App $a)
|
|||
$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']);
|
||||
|
@ -1186,55 +1187,55 @@ function settings_content(App $a)
|
|||
}
|
||||
|
||||
/* 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,
|
||||
|
||||
|
@ -1246,41 +1247,41 @@ function settings_content(App $a)
|
|||
'$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")],
|
||||
'$cntunkmail' => ['cntunkmail', L10n::t('Maximum private messages per day from unknown people:'), $cntunkmail , L10n::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, ''],
|
||||
'$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', t('Activate desktop notifications') , false, t('Show desktop popup on new notifications')],
|
||||
'$desktop_notifications' => ['desktop_notifications', L10n::t('Activate desktop notifications') , false, L10n::t('Show desktop popup on new notifications')],
|
||||
|
||||
'$email_textonly' => ['email_textonly', t('Text-only notification emails'),
|
||||
'$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"),
|
||||
|
||||
]);
|
||||
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
<?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) {
|
||||
|
||||
|
@ -89,7 +92,7 @@ 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'];
|
||||
|
@ -105,7 +108,7 @@ function subthread_content(App $a) {
|
|||
<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;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -32,12 +33,12 @@ function suggest_init(App $a) {
|
|||
|
||||
$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;
|
||||
|
@ -56,7 +57,7 @@ function suggest_content(App $a) {
|
|||
|
||||
$o = '';
|
||||
if (! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -69,7 +70,7 @@ function suggest_content(App $a) {
|
|||
$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;
|
||||
}
|
||||
|
||||
|
@ -78,9 +79,9 @@ function suggest_content(App $a) {
|
|||
$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);
|
||||
|
@ -97,10 +98,10 @@ function suggest_content(App $a) {
|
|||
'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,
|
||||
];
|
||||
|
@ -110,7 +111,7 @@ function suggest_content(App $a) {
|
|||
$tpl = get_markup_template('viewcontact_template.tpl');
|
||||
|
||||
$o .= replace_macros($tpl,[
|
||||
'$title' => t('Friend Suggestions'),
|
||||
'$title' => L10n::t('Friend Suggestions'),
|
||||
'$contacts' => $entries,
|
||||
]);
|
||||
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
<?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) {
|
||||
|
||||
|
@ -64,7 +67,7 @@ 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="'
|
||||
|
@ -97,7 +100,7 @@ EOT;
|
|||
</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;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/tagrm.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
require_once 'include/bbcode.php';
|
||||
|
||||
function tagrm_post(App $a) {
|
||||
|
||||
|
@ -12,7 +15,7 @@ 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']);
|
||||
}
|
||||
|
||||
|
@ -44,7 +47,7 @@ function tagrm_post(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
info( t('Tag removed') . EOL );
|
||||
info(L10n::t('Tag removed') . EOL );
|
||||
goaway(System::baseUrl() . '/' . $_SESSION['photo_return']);
|
||||
|
||||
// NOTREACHED
|
||||
|
@ -83,9 +86,9 @@ function tagrm_content(App $a) {
|
|||
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 . '" />';
|
||||
|
@ -96,8 +99,8 @@ function tagrm_content(App $a) {
|
|||
}
|
||||
|
||||
$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;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file mod/uexport.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
|
@ -38,15 +41,15 @@ function uexport_content(App $a) {
|
|||
* 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
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -6,9 +6,11 @@
|
|||
|
||||
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;
|
||||
|
@ -23,7 +25,7 @@ function uimport_post(App $a) {
|
|||
default:
|
||||
case REGISTER_CLOSED:
|
||||
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
$blocked = 1;
|
||||
|
@ -50,7 +52,7 @@ function uimport_content(App $a) {
|
|||
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
|
||||
if ($r && $r[0]['total'] >= $max_dailies) {
|
||||
logger('max daily registrations exceeded.');
|
||||
notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
|
||||
notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -65,13 +67,13 @@ function uimport_content(App $a) {
|
|||
|
||||
$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"')],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* @file mod/unfollow.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -11,7 +12,7 @@ use Friendica\Model\Profile;
|
|||
function unfollow_post(App $a)
|
||||
{
|
||||
if (!local_user()) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -30,30 +31,30 @@ function unfollow_post(App $a)
|
|||
$contact = dba::selectFirst('contact', [], $condition);
|
||||
|
||||
if (!DBM::is_result($contact)) {
|
||||
notice(t("Contact wasn't found or can't be unfollowed."));
|
||||
notice(L10n::t("Contact wasn't found or can't be unfollowed."));
|
||||
} else {
|
||||
if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA])) {
|
||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||
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
|
||||
}
|
||||
|
@ -61,7 +62,7 @@ function unfollow_content(App $a) {
|
|||
$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),
|
||||
|
@ -69,13 +70,13 @@ function unfollow_content(App $a) {
|
|||
$contact = dba::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
|
||||
|
||||
if (!DBM::is_result($contact)) {
|
||||
notice(t("You aren't a friend of this contact.").EOL);
|
||||
notice(L10n::t("You aren't a friend of this contact.").EOL);
|
||||
$submit = "";
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
if (!in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
|
||||
notice(t("Unfollowing is currently not supported by your network.").EOL);
|
||||
notice(L10n::t("Unfollowing is currently not supported by your network.").EOL);
|
||||
$submit = "";
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -86,7 +87,7 @@ function unfollow_content(App $a) {
|
|||
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid));
|
||||
|
||||
if (!$r) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
@ -96,9 +97,9 @@ function unfollow_content(App $a) {
|
|||
// 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' => "",
|
||||
|
@ -109,16 +110,16 @@ function unfollow_content(App $a) {
|
|||
'$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' => "",
|
||||
|
@ -128,7 +129,7 @@ function unfollow_content(App $a) {
|
|||
$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"]);
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
// See update_profile.php for documentation
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
require_once("mod/community.php");
|
||||
require_once 'mod/community.php';
|
||||
|
||||
function update_community_content(App $a) {
|
||||
header("Content-type: text/html");
|
||||
|
@ -23,7 +24,7 @@ function update_community_content(App $a) {
|
|||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
$replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
|
||||
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?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";
|
||||
|
@ -21,7 +24,7 @@ function update_display_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";
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?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";
|
||||
|
@ -26,7 +29,7 @@ function update_network_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";
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
require_once("mod/notes.php");
|
||||
|
@ -36,7 +37,7 @@ function update_notes_content(App $a) {
|
|||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
$replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
|
||||
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
|
||||
require_once("mod/profile.php");
|
||||
require_once 'mod/profile.php';
|
||||
|
||||
function update_profile_content(App $a) {
|
||||
|
||||
|
@ -35,7 +36,7 @@ function update_profile_content(App $a) {
|
|||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
$replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
|
||||
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
$pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
use Friendica\App;
|
||||
use Friendica\Content\Nav;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
|
@ -71,7 +72,7 @@ function videos_init(App $a) {
|
|||
|
||||
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) {
|
||||
|
@ -79,14 +80,14 @@ function videos_init(App $a) {
|
|||
// 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>';
|
||||
|
@ -133,15 +134,15 @@ function videos_post(App $a) {
|
|||
$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
|
||||
|
@ -207,7 +208,7 @@ function videos_content(App $a) {
|
|||
|
||||
|
||||
if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
|
||||
notice( t('Public access denied.') . EOL);
|
||||
notice(L10n::t('Public access denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -217,7 +218,7 @@ function videos_content(App $a) {
|
|||
require_once('include/conversation.php');
|
||||
|
||||
if(! x($a->data,'user')) {
|
||||
notice( t('No videos selected') . EOL );
|
||||
notice(L10n::t('No videos selected') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -319,7 +320,7 @@ function videos_content(App $a) {
|
|||
}
|
||||
|
||||
if($a->data['user']['hidewall'] && (local_user() != $owner_uid) && (! $remote_contact)) {
|
||||
notice( t('Access to this item is restricted.') . EOL);
|
||||
notice(L10n::t('Access to this item is restricted.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -390,14 +391,14 @@ function videos_content(App $a) {
|
|||
$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'),
|
||||
],
|
||||
|
||||
];
|
||||
|
@ -406,9 +407,9 @@ function videos_content(App $a) {
|
|||
|
||||
$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)
|
||||
]);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue