Finish t() for src

Update t() calls in src folder
This commit is contained in:
Adam Magness 2018-01-22 09:54:13 -05:00
parent 407b2397cb
commit 07d306aa37
19 changed files with 392 additions and 384 deletions

View file

@ -1,9 +1,12 @@
<?php <?php
/**
* @file src/App.php
*/
namespace Friendica; namespace Friendica;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
@ -512,9 +515,9 @@ class App
'$baseurl' => $this->get_baseurl(), '$baseurl' => $this->get_baseurl(),
'$local_user' => local_user(), '$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$delitem' => t('Delete this item?'), '$delitem' => L10n::t('Delete this item?'),
'$showmore' => t('show more'), '$showmore' => L10n::t('show more'),
'$showfewer' => t('show fewer'), '$showfewer' => L10n::t('show fewer'),
'$update_interval' => $interval, '$update_interval' => $interval,
'$shortcut_icon' => $shortcut_icon, '$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon, '$touch_icon' => $touch_icon,

View file

@ -5,6 +5,7 @@
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora; use Friendica\Protocol\Diaspora;
use dba; use dba;
@ -51,12 +52,12 @@ class ContactSelector
$o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n"; $o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n";
$rep = [ $rep = [
0 => t('Frequently'), 0 => L10n::t('Frequently'),
1 => t('Hourly'), 1 => L10n::t('Hourly'),
2 => t('Twice daily'), 2 => L10n::t('Twice daily'),
3 => t('Daily'), 3 => L10n::t('Daily'),
4 => t('Weekly'), 4 => L10n::t('Weekly'),
5 => t('Monthly') 5 => L10n::t('Monthly')
]; ];
foreach ($rep as $k => $v) { foreach ($rep as $k => $v) {
@ -75,23 +76,23 @@ class ContactSelector
public static function networkToName($s, $profile = "") public static function networkToName($s, $profile = "")
{ {
$nets = [ $nets = [
NETWORK_DFRN => t('Friendica'), NETWORK_DFRN => L10n::t('Friendica'),
NETWORK_OSTATUS => t('OStatus'), NETWORK_OSTATUS => L10n::t('OStatus'),
NETWORK_FEED => t('RSS/Atom'), NETWORK_FEED => L10n::t('RSS/Atom'),
NETWORK_MAIL => t('Email'), NETWORK_MAIL => L10n::t('Email'),
NETWORK_DIASPORA => t('Diaspora'), NETWORK_DIASPORA => L10n::t('Diaspora'),
NETWORK_FACEBOOK => t('Facebook'), NETWORK_FACEBOOK => L10n::t('Facebook'),
NETWORK_ZOT => t('Zot!'), NETWORK_ZOT => L10n::t('Zot!'),
NETWORK_LINKEDIN => t('LinkedIn'), NETWORK_LINKEDIN => L10n::t('LinkedIn'),
NETWORK_XMPP => t('XMPP/IM'), NETWORK_XMPP => L10n::t('XMPP/IM'),
NETWORK_MYSPACE => t('MySpace'), NETWORK_MYSPACE => L10n::t('MySpace'),
NETWORK_GPLUS => t('Google+'), NETWORK_GPLUS => L10n::t('Google+'),
NETWORK_PUMPIO => t('pump.io'), NETWORK_PUMPIO => L10n::t('pump.io'),
NETWORK_TWITTER => t('Twitter'), NETWORK_TWITTER => L10n::t('Twitter'),
NETWORK_DIASPORA2 => t('Diaspora Connector'), NETWORK_DIASPORA2 => L10n::t('Diaspora Connector'),
NETWORK_STATUSNET => t('GNU Social Connector'), NETWORK_STATUSNET => L10n::t('GNU Social Connector'),
NETWORK_PNUT => t('pnut'), NETWORK_PNUT => L10n::t('pnut'),
NETWORK_APPNET => t('App.net') NETWORK_APPNET => L10n::t('App.net')
]; ];
Addon::callHooks('network_to_name', $nets); Addon::callHooks('network_to_name', $nets);
@ -121,7 +122,7 @@ class ContactSelector
public static function gender($current = "", $suffix = "") public static function gender($current = "", $suffix = "")
{ {
$o = ''; $o = '';
$select = ['', t('Male'), t('Female'), t('Currently Male'), t('Currently Female'), t('Mostly Male'), t('Mostly Female'), t('Transgender'), t('Intersex'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Non-specific'), t('Other'), t('Undecided')]; $select = ['', L10n::t('Male'), L10n::t('Female'), L10n::t('Currently Male'), L10n::t('Currently Female'), L10n::t('Mostly Male'), L10n::t('Mostly Female'), L10n::t('Transgender'), L10n::t('Intersex'), L10n::t('Transsexual'), L10n::t('Hermaphrodite'), L10n::t('Neuter'), L10n::t('Non-specific'), L10n::t('Other'), L10n::t('Undecided')];
Addon::callHooks('gender_selector', $select); Addon::callHooks('gender_selector', $select);
@ -143,7 +144,7 @@ class ContactSelector
public static function sexualPreference($current = "", $suffix = "") public static function sexualPreference($current = "", $suffix = "")
{ {
$o = ''; $o = '';
$select = ['', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual')]; $select = ['', L10n::t('Males'), L10n::t('Females'), L10n::t('Gay'), L10n::t('Lesbian'), L10n::t('No Preference'), L10n::t('Bisexual'), L10n::t('Autosexual'), L10n::t('Abstinent'), L10n::t('Virgin'), L10n::t('Deviant'), L10n::t('Fetish'), L10n::t('Oodles'), L10n::t('Nonsexual')];
Addon::callHooks('sexpref_selector', $select); Addon::callHooks('sexpref_selector', $select);
@ -165,7 +166,7 @@ class ContactSelector
public static function maritalStatus($current = "") public static function maritalStatus($current = "")
{ {
$o = ''; $o = '';
$select = ['', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Has crush'), t('Infatuated'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Imaginarily married'), t('Partners'), t('Cohabiting'), t('Common law'), t('Happy'), t('Not looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Imaginarily divorced'), t('Widowed'), t('Uncertain'), t('It\'s complicated'), t('Don\'t care'), t('Ask me')]; $select = ['', L10n::t('Single'), L10n::t('Lonely'), L10n::t('Available'), L10n::t('Unavailable'), L10n::t('Has crush'), L10n::t('Infatuated'), L10n::t('Dating'), L10n::t('Unfaithful'), L10n::t('Sex Addict'), L10n::t('Friends'), L10n::t('Friends/Benefits'), L10n::t('Casual'), L10n::t('Engaged'), L10n::t('Married'), L10n::t('Imaginarily married'), L10n::t('Partners'), L10n::t('Cohabiting'), L10n::t('Common law'), L10n::t('Happy'), L10n::t('Not looking'), L10n::t('Swinger'), L10n::t('Betrayed'), L10n::t('Separated'), L10n::t('Unstable'), L10n::t('Divorced'), L10n::t('Imaginarily divorced'), L10n::t('Widowed'), L10n::t('Uncertain'), L10n::t('It\'s complicated'), L10n::t('Don\'t care'), L10n::t('Ask me')];
Addon::callHooks('marital_selector', $select); Addon::callHooks('marital_selector', $select);

View file

@ -7,6 +7,7 @@ namespace Friendica\Content;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
class Feature class Feature
@ -75,56 +76,56 @@ class Feature
// General // General
'general' => [ 'general' => [
t('General Features'), L10n::t('General Features'),
//array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')), //array('expire', L10n::t('Content Expiration'), L10n::t('Remove old posts/comments after a period of time')),
['multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)], ['multi_profiles', L10n::t('Multiple Profiles'), L10n::t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
['photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)], ['photo_location', L10n::t('Photo Location'), L10n::t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)],
['export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)], ['export_calendar', L10n::t('Export Public Calendar'), L10n::t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
], ],
// Post composition // Post composition
'composition' => [ 'composition' => [
t('Post Composition Features'), L10n::t('Post Composition Features'),
['preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)], ['preview', L10n::t('Post Preview'), L10n::t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
['aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)], ['aclautomention', L10n::t('Auto-mention Forums'), L10n::t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
], ],
// Network sidebar widgets // Network sidebar widgets
'widgets' => [ 'widgets' => [
t('Network Sidebar Widgets'), L10n::t('Network Sidebar Widgets'),
['archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)], ['archives', L10n::t('Search by Date'), L10n::t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
['forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)], ['forumlist_widget', L10n::t('List Forums'), L10n::t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
['groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)], ['groups', L10n::t('Group Filter'), L10n::t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
['networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)], ['networks', L10n::t('Network Filter'), L10n::t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)],
['savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)], ['savedsearch', L10n::t('Saved Searches'), L10n::t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
], ],
// Network tabs // Network tabs
'net_tabs' => [ 'net_tabs' => [
t('Network Tabs'), L10n::t('Network Tabs'),
['personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)], ['personal_tab', L10n::t('Network Personal Tab'), L10n::t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
['new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)], ['new_tab', L10n::t('Network New Tab'), L10n::t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)],
['link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)], ['link_tab', L10n::t('Network Shared Links Tab'), L10n::t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
], ],
// Item tools // Item tools
'tools' => [ 'tools' => [
t('Post/Comment Tools'), L10n::t('Post/Comment Tools'),
['multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)], ['multi_delete', L10n::t('Multiple Deletion'), L10n::t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
['edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)], ['edit_posts', L10n::t('Edit Sent Posts'), L10n::t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
['commtag', t('Tagging'), t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)], ['commtag', L10n::t('Tagging'), L10n::t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
['categories', t('Post Categories'), t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)], ['categories', L10n::t('Post Categories'), L10n::t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
['filing', t('Saved Folders'), t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)], ['filing', L10n::t('Saved Folders'), L10n::t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
['dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)], ['dislike', L10n::t('Dislike Posts'), L10n::t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
['star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)], ['star_posts', L10n::t('Star Posts'), L10n::t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
['ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)], ['ignore_posts', L10n::t('Mute Post Notifications'), L10n::t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
], ],
// Advanced Profile Settings // Advanced Profile Settings
'advanced_profile' => [ 'advanced_profile' => [
t('Advanced Profile Settings'), L10n::t('Advanced Profile Settings'),
['forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)], ['forumlist_profile', L10n::t('List Forums'), L10n::t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
['tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)], ['tagadelic', L10n::t('Tag Cloud'), L10n::t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
], ],
]; ];

View file

@ -7,6 +7,7 @@ namespace Friendica\Content;
use Friendica\App; use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use dba; use dba;
@ -121,12 +122,12 @@ class ForumManager
$o .= replace_macros( $o .= replace_macros(
$tpl, $tpl,
[ [
'$title' => t('Forums'), '$title' => L10n::t('Forums'),
'$forums' => $entries, '$forums' => $entries,
'$link_desc' => t('External link to forum'), '$link_desc' => L10n::t('External link to forum'),
'$total' => $total, '$total' => $total,
'$visible_forums' => $visible_forums, '$visible_forums' => $visible_forums,
'$showmore' => t('show more')] '$showmore' => L10n::t('show more')]
); );
} }

View file

@ -8,6 +8,7 @@ use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -50,12 +51,12 @@ class Nav
'$sitelocation' => $nav_info['sitelocation'], '$sitelocation' => $nav_info['sitelocation'],
'$nav' => $nav_info['nav'], '$nav' => $nav_info['nav'],
'$banner' => $nav_info['banner'], '$banner' => $nav_info['banner'],
'$emptynotifications' => t('Nothing new here'), '$emptynotifications' => L10n::t('Nothing new here'),
'$userinfo' => $nav_info['userinfo'], '$userinfo' => $nav_info['userinfo'],
'$sel' => $a->nav_sel, '$sel' => $a->nav_sel,
'$apps' => $a->apps, '$apps' => $a->apps,
'$clear_notifs' => t('Clear notifications'), '$clear_notifs' => L10n::t('Clear notifications'),
'$search_hint' => t('@name, !forum, #tags, content') '$search_hint' => L10n::t('@name, !forum, #tags, content')
]); ]);
Addon::callHooks('page_header', $a->page['nav']); Addon::callHooks('page_header', $a->page['nav']);
@ -94,15 +95,15 @@ class Nav
$userinfo = null; $userinfo = null;
if (local_user()) { if (local_user()) {
$nav['logout'] = ['logout', t('Logout'), '', t('End this session')]; $nav['logout'] = ['logout', L10n::t('Logout'), '', L10n::t('End this session')];
// user menu // user menu
$nav['usermenu'][] = ['profile/' . $a->user['nickname'], t('Status'), '', t('Your posts and conversations')]; $nav['usermenu'][] = ['profile/' . $a->user['nickname'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
$nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), '', t('Your profile page')]; $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
$nav['usermenu'][] = ['photos/' . $a->user['nickname'], t('Photos'), '', t('Your photos')]; $nav['usermenu'][] = ['photos/' . $a->user['nickname'], L10n::t('Photos'), '', L10n::t('Your photos')];
$nav['usermenu'][] = ['videos/' . $a->user['nickname'], t('Videos'), '', t('Your videos')]; $nav['usermenu'][] = ['videos/' . $a->user['nickname'], L10n::t('Videos'), '', L10n::t('Your videos')];
$nav['usermenu'][] = ['events/', t('Events'), '', t('Your events')]; $nav['usermenu'][] = ['events/', L10n::t('Events'), '', L10n::t('Your events')];
$nav['usermenu'][] = ['notes/', t('Personal notes'), '', t('Your personal notes')]; $nav['usermenu'][] = ['notes/', L10n::t('Personal notes'), '', L10n::t('Your personal notes')];
// user info // user info
$contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]); $contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
@ -111,7 +112,7 @@ class Nav
'name' => $a->user['username'], 'name' => $a->user['username'],
]; ];
} else { } else {
$nav['login'] = ['login', t('Login'), ($a->module == 'login' ? 'selected' : ''), t('Sign in')]; $nav['login'] = ['login', L10n::t('Login'), ($a->module == 'login' ? 'selected' : ''), L10n::t('Sign in')];
} }
// "Home" should also take you home from an authenticated remote profile connection // "Home" should also take you home from an authenticated remote profile connection
@ -121,34 +122,34 @@ class Nav
} }
if (($a->module != 'home') && (! (local_user()))) { if (($a->module != 'home') && (! (local_user()))) {
$nav['home'] = [$homelink, t('Home'), '', t('Home Page')]; $nav['home'] = [$homelink, L10n::t('Home'), '', L10n::t('Home Page')];
} }
if (($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) { if (($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) {
$nav['register'] = ['register', t('Register'), '', t('Create an account')]; $nav['register'] = ['register', L10n::t('Register'), '', L10n::t('Create an account')];
} }
$help_url = 'help'; $help_url = 'help';
if (!Config::get('system', 'hide_help')) { if (!Config::get('system', 'hide_help')) {
$nav['help'] = [$help_url, t('Help'), '', t('Help and documentation')]; $nav['help'] = [$help_url, L10n::t('Help'), '', L10n::t('Help and documentation')];
} }
if (count($a->apps) > 0) { if (count($a->apps) > 0) {
$nav['apps'] = ['apps', t('Apps'), '', t('Addon applications, utilities, games')]; $nav['apps'] = ['apps', L10n::t('Apps'), '', L10n::t('Addon applications, utilities, games')];
} }
if (local_user() || !Config::get('system', 'local_search')) { if (local_user() || !Config::get('system', 'local_search')) {
$nav['search'] = ['search', t('Search'), '', t('Search site content')]; $nav['search'] = ['search', L10n::t('Search'), '', L10n::t('Search site content')];
$nav['searchoption'] = [ $nav['searchoption'] = [
t('Full Text'), L10n::t('Full Text'),
t('Tags'), L10n::t('Tags'),
t('Contacts') L10n::t('Contacts')
]; ];
if (Config::get('system', 'poco_local_search')) { if (Config::get('system', 'poco_local_search')) {
$nav['searchoption'][] = t('Forums'); $nav['searchoption'][] = L10n::t('Forums');
} }
} }
@ -162,62 +163,62 @@ class Nav
} }
if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) { if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) {
$nav['community'] = ['community', t('Community'), '', t('Conversations on this and other servers')]; $nav['community'] = ['community', L10n::t('Community'), '', L10n::t('Conversations on this and other servers')];
} }
if (local_user()) { if (local_user()) {
$nav['events'] = ['events', t('Events'), '', t('Events and Calendar')]; $nav['events'] = ['events', L10n::t('Events'), '', L10n::t('Events and Calendar')];
} }
$nav['directory'] = [$gdirpath, t('Directory'), '', t('People directory')]; $nav['directory'] = [$gdirpath, L10n::t('Directory'), '', L10n::t('People directory')];
$nav['about'] = ['friendica', t('Information'), '', t('Information about this friendica instance')]; $nav['about'] = ['friendica', L10n::t('Information'), '', L10n::t('Information about this friendica instance')];
// The following nav links are only show to logged in users // The following nav links are only show to logged in users
if (local_user()) { if (local_user()) {
$nav['network'] = ['network', t('Network'), '', t('Conversations from your friends')]; $nav['network'] = ['network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
$nav['net_reset'] = ['network/0?f=&order=comment&nets=all', t('Network Reset'), '', t('Load Network page with no filters')]; $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', L10n::t('Network Reset'), '', L10n::t('Load Network page with no filters')];
$nav['home'] = ['profile/' . $a->user['nickname'], t('Home'), '', t('Your posts and conversations')]; $nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')];
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_PRVGROUP])) { if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_PRVGROUP])) {
// only show friend requests for normal pages. Other page types have automatic friendship. // only show friend requests for normal pages. Other page types have automatic friendship.
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_PRVGROUP])) { if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_PRVGROUP])) {
$nav['introductions'] = ['notifications/intros', t('Introductions'), '', t('Friend Requests')]; $nav['introductions'] = ['notifications/intros', L10n::t('Introductions'), '', L10n::t('Friend Requests')];
} }
if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) { if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
$nav['notifications'] = ['notifications', t('Notifications'), '', t('Notifications')]; $nav['notifications'] = ['notifications', L10n::t('Notifications'), '', L10n::t('Notifications')];
$nav['notifications']['all'] = ['notifications/system', t('See all notifications'), '', '']; $nav['notifications']['all'] = ['notifications/system', L10n::t('See all notifications'), '', ''];
$nav['notifications']['mark'] = ['', t('Mark as seen'), '', t('Mark all system notifications seen')]; $nav['notifications']['mark'] = ['', L10n::t('Mark as seen'), '', L10n::t('Mark all system notifications seen')];
} }
} }
$nav['messages'] = ['message', t('Messages'), '', t('Private mail')]; $nav['messages'] = ['message', L10n::t('Messages'), '', L10n::t('Private mail')];
$nav['messages']['inbox'] = ['message', t('Inbox'), '', t('Inbox')]; $nav['messages']['inbox'] = ['message', L10n::t('Inbox'), '', L10n::t('Inbox')];
$nav['messages']['outbox'] = ['message/sent', t('Outbox'), '', t('Outbox')]; $nav['messages']['outbox'] = ['message/sent', L10n::t('Outbox'), '', L10n::t('Outbox')];
$nav['messages']['new'] = ['message/new', t('New Message'), '', t('New Message')]; $nav['messages']['new'] = ['message/new', L10n::t('New Message'), '', L10n::t('New Message')];
if (is_array($a->identities) && count($a->identities) > 1) { if (is_array($a->identities) && count($a->identities) > 1) {
$nav['manage'] = ['manage', t('Manage'), '', t('Manage other pages')]; $nav['manage'] = ['manage', L10n::t('Manage'), '', L10n::t('Manage other pages')];
} }
$nav['delegations'] = ['delegate', t('Delegations'), '', t('Delegate Page Management')]; $nav['delegations'] = ['delegate', L10n::t('Delegations'), '', L10n::t('Delegate Page Management')];
$nav['settings'] = ['settings', t('Settings'), '', t('Account settings')]; $nav['settings'] = ['settings', L10n::t('Settings'), '', L10n::t('Account settings')];
if (Feature::isEnabled(local_user(), 'multi_profiles')) { if (Feature::isEnabled(local_user(), 'multi_profiles')) {
$nav['profiles'] = ['profiles', t('Profiles'), '', t('Manage/Edit Profiles')]; $nav['profiles'] = ['profiles', L10n::t('Profiles'), '', L10n::t('Manage/Edit Profiles')];
} }
$nav['contacts'] = ['contacts', t('Contacts'), '', t('Manage/edit friends and contacts')]; $nav['contacts'] = ['contacts', L10n::t('Contacts'), '', L10n::t('Manage/edit friends and contacts')];
} }
// Show the link to the admin configuration page if user is admin // Show the link to the admin configuration page if user is admin
if (is_site_admin()) { if (is_site_admin()) {
$nav['admin'] = ['admin/', t('Admin'), '', t('Site setup and configuration')]; $nav['admin'] = ['admin/', L10n::t('Admin'), '', L10n::t('Site setup and configuration')];
} }
$nav['navigation'] = ['navigation/', t('Navigation'), '', t('Site map')]; $nav['navigation'] = ['navigation/', L10n::t('Navigation'), '', L10n::t('Site map')];
// Provide a banner/logo/whatever // Provide a banner/logo/whatever
$banner = Config::get('system', 'banner'); $banner = Config::get('system', 'banner');

View file

@ -1,13 +1,12 @@
<?php <?php
/** /**
* @file src/Content/OEmbed.php * @file src/Content/OEmbed.php
*/ */
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -247,7 +246,7 @@ class OEmbed
{ {
$stopoembed = Config::get("system", "no_oembed"); $stopoembed = Config::get("system", "no_oembed");
if ($stopoembed == true) { if ($stopoembed == true) {
return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text); return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . L10n::t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text);
} }
return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", ['self', 'replaceCallback'], $text); return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", ['self', 'replaceCallback'], $text);
} }
@ -367,7 +366,7 @@ class OEmbed
$width = '100%'; $width = '100%';
$src = System::baseUrl() . '/oembed/' . base64url_encode($src); $src = System::baseUrl() . '/oembed/' . base64url_encode($src);
return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . t('Embedded content') . '</iframe>'; return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . L10n::t('Embedded content') . '</iframe>';
} }
/** /**

View file

@ -29,11 +29,11 @@ class Widget
public static function follow($value = "") public static function follow($value = "")
{ {
return replace_macros(get_markup_template('follow.tpl'), array( return replace_macros(get_markup_template('follow.tpl'), array(
'$connect' => t('Add New Contact'), '$connect' => L10n::t('Add New Contact'),
'$desc' => t('Enter address or web location'), '$desc' => L10n::t('Enter address or web location'),
'$hint' => t('Example: bob@example.com, http://example.com/barbara'), '$hint' => L10n::t('Example: bob@example.com, http://example.com/barbara'),
'$value' => $value, '$value' => $value,
'$follow' => t('Connect') '$follow' => L10n::t('Connect')
)); ));
} }
@ -55,16 +55,16 @@ class Widget
} }
return replace_macros(get_markup_template('peoplefind.tpl'), array( return replace_macros(get_markup_template('peoplefind.tpl'), array(
'$findpeople' => t('Find People'), '$findpeople' => L10n::t('Find People'),
'$desc' => t('Enter name or interest'), '$desc' => L10n::t('Enter name or interest'),
'$label' => t('Connect/Follow'), '$label' => L10n::t('Connect/Follow'),
'$hint' => t('Examples: Robert Morgenstein, Fishing'), '$hint' => L10n::t('Examples: Robert Morgenstein, Fishing'),
'$findthem' => t('Find'), '$findthem' => L10n::t('Find'),
'$suggest' => t('Friend Suggestions'), '$suggest' => L10n::t('Friend Suggestions'),
'$similar' => t('Similar Interests'), '$similar' => L10n::t('Similar Interests'),
'$random' => t('Random Profile'), '$random' => L10n::t('Random Profile'),
'$inv' => t('Invite Friends'), '$inv' => L10n::t('Invite Friends'),
'$directory' => t('View Global Directory'), '$directory' => L10n::t('View Global Directory'),
'$global_dir' => $global_dir '$global_dir' => $global_dir
)); ));
} }
@ -155,10 +155,10 @@ class Widget
} }
return replace_macros(get_markup_template('nets.tpl'), array( return replace_macros(get_markup_template('nets.tpl'), array(
'$title' => t('Networks'), '$title' => L10n::t('Networks'),
'$desc' => '', '$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''), '$sel_all' => (($selected == '') ? 'selected' : ''),
'$all' => t('All Networks'), '$all' => L10n::t('All Networks'),
'$nets' => $nets, '$nets' => $nets,
'$base' => $baseurl, '$base' => $baseurl,
)); ));
@ -196,10 +196,10 @@ class Widget
} }
return replace_macros(get_markup_template('fileas_widget.tpl'), array( return replace_macros(get_markup_template('fileas_widget.tpl'), array(
'$title' => t('Saved Folders'), '$title' => L10n::t('Saved Folders'),
'$desc' => '', '$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''), '$sel_all' => (($selected == '') ? 'selected' : ''),
'$all' => t('Everything'), '$all' => L10n::t('Everything'),
'$terms' => $terms, '$terms' => $terms,
'$base' => $baseurl, '$base' => $baseurl,
)); ));
@ -236,10 +236,10 @@ class Widget
} }
return replace_macros(get_markup_template('categories_widget.tpl'), array( return replace_macros(get_markup_template('categories_widget.tpl'), array(
'$title' => t('Categories'), '$title' => L10n::t('Categories'),
'$desc' => '', '$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''), '$sel_all' => (($selected == '') ? 'selected' : ''),
'$all' => t('Everything'), '$all' => L10n::t('Everything'),
'$terms' => $terms, '$terms' => $terms,
'$base' => $baseurl, '$base' => $baseurl,
)); ));
@ -308,7 +308,7 @@ class Widget
'$uid' => $profile_uid, '$uid' => $profile_uid,
'$cid' => (($cid) ? $cid : '0'), '$cid' => (($cid) ? $cid : '0'),
'$linkmore' => (($t > 5) ? 'true' : ''), '$linkmore' => (($t > 5) ? 'true' : ''),
'$more' => t('show more'), '$more' => L10n::t('show more'),
'$items' => $r) '$items' => $r)
); );
} }

View file

@ -1,14 +1,13 @@
<?php <?php
/** /**
* @file src/Core/NotificationsManager.php * @file src/Core/NotificationsManager.php
* @brief Methods for read and write notifications from/to database * @brief Methods for read and write notifications from/to database
* or for formatting notifications * or for formatting notifications
*/ */
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -167,35 +166,35 @@ class NotificationsManager extends BaseObject
{ {
$tabs = [ $tabs = [
[ [
'label' => t('System'), 'label' => L10n::t('System'),
'url' => 'notifications/system', 'url' => 'notifications/system',
'sel' => ((self::getApp()->argv[1] == 'system') ? 'active' : ''), 'sel' => ((self::getApp()->argv[1] == 'system') ? 'active' : ''),
'id' => 'system-tab', 'id' => 'system-tab',
'accesskey' => 'y', 'accesskey' => 'y',
], ],
[ [
'label' => t('Network'), 'label' => L10n::t('Network'),
'url' => 'notifications/network', 'url' => 'notifications/network',
'sel' => ((self::getApp()->argv[1] == 'network') ? 'active' : ''), 'sel' => ((self::getApp()->argv[1] == 'network') ? 'active' : ''),
'id' => 'network-tab', 'id' => 'network-tab',
'accesskey' => 'w', 'accesskey' => 'w',
], ],
[ [
'label' => t('Personal'), 'label' => L10n::t('Personal'),
'url' => 'notifications/personal', 'url' => 'notifications/personal',
'sel' => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''), 'sel' => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''),
'id' => 'personal-tab', 'id' => 'personal-tab',
'accesskey' => 'r', 'accesskey' => 'r',
], ],
[ [
'label' => t('Home'), 'label' => L10n::t('Home'),
'url' => 'notifications/home', 'url' => 'notifications/home',
'sel' => ((self::getApp()->argv[1] == 'home') ? 'active' : ''), 'sel' => ((self::getApp()->argv[1] == 'home') ? 'active' : ''),
'id' => 'home-tab', 'id' => 'home-tab',
'accesskey' => 'h', 'accesskey' => 'h',
], ],
[ [
'label' => t('Introductions'), 'label' => L10n::t('Introductions'),
'url' => 'notifications/intros', 'url' => 'notifications/intros',
'sel' => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''), 'sel' => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''),
'id' => 'intro-tab', 'id' => 'intro-tab',
@ -252,7 +251,7 @@ class NotificationsManager extends BaseObject
$default_item_link = System::baseUrl(true) . '/display/' . $it['pguid']; $default_item_link = System::baseUrl(true) . '/display/' . $it['pguid'];
$default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO); $default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
$default_item_url = $it['author-link']; $default_item_url = $it['author-link'];
$default_item_text = sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']); $default_item_text = sprintf(L10n::t("%s commented on %s's post"), $it['author-name'], $it['pname']);
$default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r'); $default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
$default_item_ago = relative_date($it['created']); $default_item_ago = relative_date($it['created']);
break; break;
@ -263,8 +262,8 @@ class NotificationsManager extends BaseObject
$default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO); $default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
$default_item_url = $it['author-link']; $default_item_url = $it['author-link'];
$default_item_text = (($it['id'] == $it['parent']) $default_item_text = (($it['id'] == $it['parent'])
? sprintf(t("%s created a new post"), $it['author-name']) ? sprintf(L10n::t("%s created a new post"), $it['author-name'])
: sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname'])); : sprintf(L10n::t("%s commented on %s's post"), $it['author-name'], $it['pname']));
$default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r'); $default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
$default_item_ago = relative_date($it['created']); $default_item_ago = relative_date($it['created']);
} }
@ -277,7 +276,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'], 'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO), 'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'], 'url' => $it['author-link'],
'text' => sprintf(t("%s liked %s's post"), $it['author-name'], $it['pname']), 'text' => sprintf(L10n::t("%s liked %s's post"), $it['author-name'], $it['pname']),
'when' => $default_item_when, 'when' => $default_item_when,
'ago' => $default_item_ago, 'ago' => $default_item_ago,
'seen' => $it['seen'] 'seen' => $it['seen']
@ -290,7 +289,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'], 'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO), 'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'], 'url' => $it['author-link'],
'text' => sprintf(t("%s disliked %s's post"), $it['author-name'], $it['pname']), 'text' => sprintf(L10n::t("%s disliked %s's post"), $it['author-name'], $it['pname']),
'when' => $default_item_when, 'when' => $default_item_when,
'ago' => $default_item_ago, 'ago' => $default_item_ago,
'seen' => $it['seen'] 'seen' => $it['seen']
@ -303,7 +302,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'], 'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO), 'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'], 'url' => $it['author-link'],
'text' => sprintf(t("%s is attending %s's event"), $it['author-name'], $it['pname']), 'text' => sprintf(L10n::t("%s is attending %s's event"), $it['author-name'], $it['pname']),
'when' => $default_item_when, 'when' => $default_item_when,
'ago' => $default_item_ago, 'ago' => $default_item_ago,
'seen' => $it['seen'] 'seen' => $it['seen']
@ -316,7 +315,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'], 'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO), 'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'], 'url' => $it['author-link'],
'text' => sprintf(t("%s is not attending %s's event"), $it['author-name'], $it['pname']), 'text' => sprintf(L10n::t("%s is not attending %s's event"), $it['author-name'], $it['pname']),
'when' => $default_item_when, 'when' => $default_item_when,
'ago' => $default_item_ago, 'ago' => $default_item_ago,
'seen' => $it['seen'] 'seen' => $it['seen']
@ -329,7 +328,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'], 'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO), 'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'], 'url' => $it['author-link'],
'text' => sprintf(t("%s may attend %s's event"), $it['author-name'], $it['pname']), 'text' => sprintf(L10n::t("%s may attend %s's event"), $it['author-name'], $it['pname']),
'when' => $default_item_when, 'when' => $default_item_when,
'ago' => $default_item_ago, 'ago' => $default_item_ago,
'seen' => $it['seen'] 'seen' => $it['seen']
@ -346,7 +345,7 @@ class NotificationsManager extends BaseObject
'link' => System::baseUrl(true) . '/display/' . $it['pguid'], 'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO), 'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'url' => $it['author-link'], 'url' => $it['author-link'],
'text' => sprintf(t("%s is now friends with %s"), $it['author-name'], $it['fname']), 'text' => sprintf(L10n::t("%s is now friends with %s"), $it['author-name'], $it['fname']),
'when' => $default_item_when, 'when' => $default_item_when,
'ago' => $default_item_ago, 'ago' => $default_item_ago,
'seen' => $it['seen'] 'seen' => $it['seen']
@ -809,7 +808,7 @@ class NotificationsManager extends BaseObject
$intro = [ $intro = [
'label' => 'friend_suggestion', 'label' => 'friend_suggestion',
'notify_type' => t('Friend Suggestion'), 'notify_type' => L10n::t('Friend Suggestion'),
'intro_id' => $it['intro_id'], 'intro_id' => $it['intro_id'],
'madeby' => $it['name'], 'madeby' => $it['name'],
'contact_id' => $it['contact-id'], 'contact_id' => $it['contact-id'],
@ -835,7 +834,7 @@ class NotificationsManager extends BaseObject
} }
$intro = [ $intro = [
'label' => (($it['network'] !== NETWORK_OSTATUS) ? 'friend_request' : 'follower'), 'label' => (($it['network'] !== NETWORK_OSTATUS) ? 'friend_request' : 'follower'),
'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')), 'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? L10n::t('Friend/Connect Request') : L10n::t('New Follower')),
'dfrn_id' => $it['issued-id'], 'dfrn_id' => $it['issued-id'],
'uid' => $_SESSION['uid'], 'uid' => $_SESSION['uid'],
'intro_id' => $it['intro_id'], 'intro_id' => $it['intro_id'],

View file

@ -9,17 +9,18 @@ use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use dba; use dba;
require_once "boot.php"; require_once 'boot.php';
require_once 'include/dba.php'; require_once 'include/dba.php';
require_once 'include/enotify.php'; require_once 'include/enotify.php';
require_once "include/text.php"; require_once 'include/text.php';
/** /**
* @brief This class contain functions for the database management * @brief This class contain functions for the database management
* *
* This class contains functions that doesn't need to know if pdo, mysqli or whatever is used. * This class contains functions that doesn't need to know if pdo, mysqli or whatever is used.
*/ */
class DBStructure { class DBStructure
{
/* /*
* Converts all tables from MyISAM to InnoDB * Converts all tables from MyISAM to InnoDB
*/ */
@ -28,7 +29,7 @@ class DBStructure {
dbesc(dba::database_name())); dbesc(dba::database_name()));
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
echo t('There are no tables on MyISAM.')."\n"; echo L10n::t('There are no tables on MyISAM.')."\n";
return; return;
} }
@ -71,12 +72,12 @@ class DBStructure {
$lang = (($admin['language'])?$admin['language']:'en'); $lang = (($admin['language'])?$admin['language']:'en');
L10n::pushLang($lang); L10n::pushLang($lang);
$preamble = deindent(t(" $preamble = deindent(L10n::t("
The friendica developers released update %s recently, The friendica developers released update %s recently,
but when I tried to install it, something went terribly wrong. but when I tried to install it, something went terribly wrong.
This needs to be fixed soon and I can't do it alone. Please contact a This needs to be fixed soon and I can't do it alone. Please contact a
friendica developer if you can not help me on your own. My database might be invalid.")); friendica developer if you can not help me on your own. My database might be invalid."));
$body = t("The error message is\n[pre]%s[/pre]"); $body = L10n::t("The error message is\n[pre]%s[/pre]");
$preamble = sprintf($preamble, $update_id); $preamble = sprintf($preamble, $update_id);
$body = sprintf($body, $error_message); $body = sprintf($body, $error_message);
@ -187,10 +188,10 @@ class DBStructure {
* @return string Error message * @return string Error message
*/ */
private static function printUpdateError($message) { private static function printUpdateError($message) {
echo sprintf(t("\nError %d occurred during database update:\n%s\n"), echo sprintf(L10n::t("\nError %d occurred during database update:\n%s\n"),
dba::errorNo(), dba::errorMessage()); dba::errorNo(), dba::errorMessage());
return t('Errors encountered performing database changes: ').$message.EOL; return L10n::t('Errors encountered performing database changes: ').$message.EOL;
} }
/** /**
@ -205,7 +206,7 @@ class DBStructure {
public static function update($verbose, $action, array $tables = null, array $definition = null) { public static function update($verbose, $action, array $tables = null, array $definition = null) {
if ($action) { if ($action) {
Config::set('system', 'maintenance', 1); Config::set('system', 'maintenance', 1);
Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e'))); Config::set('system', 'maintenance_reason', sprintf(L10n::t(': Database update'), DBM::date().' '.date('e')));
} }
$errors = ''; $errors = '';
@ -455,7 +456,7 @@ class DBStructure {
} }
if ($action) { if ($action) {
Config::set('system', 'maintenance_reason', sprintf(t('%s: updating %s table.'), DBM::date().' '.date('e'), $name)); Config::set('system', 'maintenance_reason', sprintf(L10n::t('%s: updating %s table.'), DBM::date().' '.date('e'), $name));
// Ensure index conversion to unique removes duplicates // Ensure index conversion to unique removes duplicates
if ($is_unique && ($temp_name != $name)) { if ($is_unique && ($temp_name != $name)) {

View file

@ -7,6 +7,7 @@ namespace Friendica\Model;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -491,7 +492,7 @@ class Contact extends BaseObject
if ($contact['uid'] != $uid) { if ($contact['uid'] != $uid) {
if ($uid == 0) { if ($uid == 0) {
$profile_link = Profile::zrl($contact['url']); $profile_link = Profile::zrl($contact['url']);
$menu = ['profile' => [t('View Profile'), $profile_link, true]]; $menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]];
return $menu; return $menu;
} }
@ -504,8 +505,8 @@ class Contact extends BaseObject
$profile_link = Profile::zrl($contact['url']); $profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url']; $connlnk = 'follow/?url=' . $contact['url'];
$menu = [ $menu = [
'profile' => [t('View Profile'), $profile_link, true], 'profile' => [L10n::t('View Profile'), $profile_link, true],
'follow' => [t('Connect/Follow'), $connlnk, true] 'follow' => [L10n::t('Connect/Follow'), $connlnk, true]
]; ];
return $menu; return $menu;
@ -548,14 +549,14 @@ class Contact extends BaseObject
* "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ] * "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ]
*/ */
$menu = [ $menu = [
'status' => [t("View Status") , $status_link , true], 'status' => [L10n::t("View Status") , $status_link , true],
'profile' => [t("View Profile") , $profile_link , true], 'profile' => [L10n::t("View Profile") , $profile_link , true],
'photos' => [t("View Photos") , $photos_link , true], 'photos' => [L10n::t("View Photos") , $photos_link , true],
'network' => [t("Network Posts"), $posts_link , false], 'network' => [L10n::t("Network Posts"), $posts_link , false],
'edit' => [t("View Contact") , $contact_url , false], 'edit' => [L10n::t("View Contact") , $contact_url , false],
'drop' => [t("Drop Contact") , $contact_drop_link, false], 'drop' => [L10n::t("Drop Contact") , $contact_drop_link, false],
'pm' => [t("Send PM") , $pm_url , false], 'pm' => [L10n::t("Send PM") , $pm_url , false],
'poke' => [t("Poke") , $poke_link , false], 'poke' => [L10n::t("Poke") , $poke_link , false],
]; ];
$args = ['contact' => $contact, 'menu' => &$menu]; $args = ['contact' => $contact, 'menu' => &$menu];
@ -956,13 +957,13 @@ class Contact extends BaseObject
switch ($type) { switch ($type) {
case ACCOUNT_TYPE_ORGANISATION: case ACCOUNT_TYPE_ORGANISATION:
$account_type = t("Organisation"); $account_type = L10n::t("Organisation");
break; break;
case ACCOUNT_TYPE_NEWS: case ACCOUNT_TYPE_NEWS:
$account_type = t('News'); $account_type = L10n::t('News');
break; break;
case ACCOUNT_TYPE_COMMUNITY: case ACCOUNT_TYPE_COMMUNITY:
$account_type = t("Forum"); $account_type = L10n::t("Forum");
break; break;
default: default:
$account_type = ""; $account_type = "";
@ -1131,17 +1132,17 @@ class Contact extends BaseObject
$url = str_replace('/#!/', '/', $url); $url = str_replace('/#!/', '/', $url);
if (!allowed_url($url)) { if (!allowed_url($url)) {
$result['message'] = t('Disallowed profile URL.'); $result['message'] = L10n::t('Disallowed profile URL.');
return $result; return $result;
} }
if (blocked_url($url)) { if (blocked_url($url)) {
$result['message'] = t('Blocked domain'); $result['message'] = L10n::t('Blocked domain');
return $result; return $result;
} }
if (!$url) { if (!$url) {
$result['message'] = t('Connect URL missing.'); $result['message'] = L10n::t('Connect URL missing.');
return $result; return $result;
} }
@ -1173,8 +1174,8 @@ class Contact extends BaseObject
// NOTREACHED // NOTREACHED
} }
} elseif (Config::get('system', 'dfrn_only')) { } elseif (Config::get('system', 'dfrn_only')) {
$result['message'] = t('This site is not configured to allow communications with other networks.') . EOL; $result['message'] = L10n::t('This site is not configured to allow communications with other networks.') . EOL;
$result['message'] != t('No compatible communication protocols or feeds were discovered.') . EOL; $result['message'] != L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
return $result; return $result;
} }
@ -1186,30 +1187,30 @@ class Contact extends BaseObject
// do we have enough information? // do we have enough information?
if (!((x($ret, 'name')) && (x($ret, 'poll')) && ((x($ret, 'url')) || (x($ret, 'addr'))))) { if (!((x($ret, 'name')) && (x($ret, 'poll')) && ((x($ret, 'url')) || (x($ret, 'addr'))))) {
$result['message'] .= t('The profile address specified does not provide adequate information.') . EOL; $result['message'] .= L10n::t('The profile address specified does not provide adequate information.') . EOL;
if (!x($ret, 'poll')) { if (!x($ret, 'poll')) {
$result['message'] .= t('No compatible communication protocols or feeds were discovered.') . EOL; $result['message'] .= L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
} }
if (!x($ret, 'name')) { if (!x($ret, 'name')) {
$result['message'] .= t('An author or name was not found.') . EOL; $result['message'] .= L10n::t('An author or name was not found.') . EOL;
} }
if (!x($ret, 'url')) { if (!x($ret, 'url')) {
$result['message'] .= t('No browser URL could be matched to this address.') . EOL; $result['message'] .= L10n::t('No browser URL could be matched to this address.') . EOL;
} }
if (strpos($url, '@') !== false) { if (strpos($url, '@') !== false) {
$result['message'] .= t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL; $result['message'] .= L10n::t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
$result['message'] .= t('Use mailto: in front of address to force email check.') . EOL; $result['message'] .= L10n::t('Use mailto: in front of address to force email check.') . EOL;
} }
return $result; return $result;
} }
if ($ret['network'] === NETWORK_OSTATUS && Config::get('system', 'ostatus_disabled')) { if ($ret['network'] === NETWORK_OSTATUS && Config::get('system', 'ostatus_disabled')) {
$result['message'] .= t('The profile address specified belongs to a network which has been disabled on this site.') . EOL; $result['message'] .= L10n::t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
$ret['notify'] = ''; $ret['notify'] = '';
} }
if (!$ret['notify']) { if (!$ret['notify']) {
$result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL; $result['message'] .= L10n::t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
} }
$writeable = ((($ret['network'] === NETWORK_OSTATUS) && ($ret['notify'])) ? 1 : 0); $writeable = ((($ret['network'] === NETWORK_OSTATUS) && ($ret['notify'])) ? 1 : 0);
@ -1279,7 +1280,7 @@ class Contact extends BaseObject
$contact = dba::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]); $contact = dba::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
if (!DBM::is_result($contact)) { if (!DBM::is_result($contact)) {
$result['message'] .= t('Unable to retrieve contact information.') . EOL; $result['message'] .= L10n::t('Unable to retrieve contact information.') . EOL;
return $result; return $result;
} }

View file

@ -2,7 +2,6 @@
/** /**
* @file src/Model/Group.php * @file src/Model/Group.php
*/ */
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -327,7 +326,7 @@ class Group extends BaseObject
logger('groups: ' . print_r($display_groups, true)); logger('groups: ' . print_r($display_groups, true));
if ($label == '') { if ($label == '') {
$label = t('Default privacy group for new contacts'); $label = L10n::t('Default privacy group for new contacts');
} }
$o = replace_macros(get_markup_template('group_selection.tpl'), [ $o = replace_macros(get_markup_template('group_selection.tpl'), [
@ -360,7 +359,7 @@ class Group extends BaseObject
$display_groups = [ $display_groups = [
[ [
'text' => t('Everybody'), 'text' => L10n::t('Everybody'),
'id' => 0, 'id' => 0,
'selected' => (($group_id == 0) ? 'group-selected' : ''), 'selected' => (($group_id == 0) ? 'group-selected' : ''),
'href' => $every, 'href' => $every,
@ -380,7 +379,7 @@ class Group extends BaseObject
if ($editmode == 'full') { if ($editmode == 'full') {
$groupedit = [ $groupedit = [
'href' => 'group/' . $group['id'], 'href' => 'group/' . $group['id'],
'title' => t('edit'), 'title' => L10n::t('edit'),
]; ];
} else { } else {
$groupedit = null; $groupedit = null;
@ -399,16 +398,16 @@ class Group extends BaseObject
$tpl = get_markup_template('group_side.tpl'); $tpl = get_markup_template('group_side.tpl');
$o = replace_macros($tpl, [ $o = replace_macros($tpl, [
'$add' => t('add'), '$add' => L10n::t('add'),
'$title' => t('Groups'), '$title' => L10n::t('Groups'),
'$groups' => $display_groups, '$groups' => $display_groups,
'newgroup' => $editmode == 'extended' || $editmode == 'full' ? 1 : '', 'newgroup' => $editmode == 'extended' || $editmode == 'full' ? 1 : '',
'grouppage' => 'group/', 'grouppage' => 'group/',
'$edittext' => t('Edit group'), '$edittext' => L10n::t('Edit group'),
'$ungrouped' => $every === 'contacts' ? t('Contacts not in any group') : '', '$ungrouped' => $every === 'contacts' ? L10n::t('Contacts not in any group') : '',
'$createtext' => t('Create a new group'), '$createtext' => L10n::t('Create a new group'),
'$creategroup' => t('Group Name: '), '$creategroup' => L10n::t('Group Name: '),
'$editgroupstext' => t('Edit groups'), '$editgroupstext' => L10n::t('Edit groups'),
'$form_security_token' => get_form_security_token('group_edit'), '$form_security_token' => get_form_security_token('group_edit'),
]); ]);

View file

@ -5,6 +5,7 @@
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\App; use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -35,7 +36,7 @@ class Mail
} }
if (!strlen($subject)) { if (!strlen($subject)) {
$subject = t('[no subject]'); $subject = L10n::t('[no subject]');
} }
$me = dba::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]); $me = dba::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
@ -168,7 +169,7 @@ class Mail
} }
if (!strlen($subject)) { if (!strlen($subject)) {
$subject = t('[no subject]'); $subject = L10n::t('[no subject]');
} }
$guid = get_guid(32); $guid = get_guid(32);

View file

@ -2,7 +2,6 @@
/** /**
* @file src/Model/Profile.php * @file src/Model/Profile.php
*/ */
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\App; use Friendica\App;
@ -163,7 +162,7 @@ class Profile
$a->page['aside'] .= replace_macros( $a->page['aside'] .= replace_macros(
get_markup_template('profile_edlink.tpl'), get_markup_template('profile_edlink.tpl'),
[ [
'$editprofile' => t('Edit profile'), '$editprofile' => L10n::t('Edit profile'),
'$profid' => $a->profile['id'] '$profid' => $a->profile['id']
] ]
); );
@ -292,7 +291,7 @@ class Profile
// don't show connect link to yourself // don't show connect link to yourself
$connect = $profile['uid'] != local_user() ? t('Connect') : false; $connect = $profile['uid'] != local_user() ? L10n::t('Connect') : false;
// don't show connect link to authenticated visitors either // don't show connect link to authenticated visitors either
if (remote_user() && count($_SESSION['remote'])) { if (remote_user() && count($_SESSION['remote'])) {
@ -331,13 +330,13 @@ class Profile
} }
if ($connect && ($profile['network'] == NETWORK_DFRN) && !isset($remoteconnect)) { if ($connect && ($profile['network'] == NETWORK_DFRN) && !isset($remoteconnect)) {
$subscribe_feed = t('Atom feed'); $subscribe_feed = L10n::t('Atom feed');
} else { } else {
$subscribe_feed = false; $subscribe_feed = false;
} }
if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) { if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
$wallmessage = t('Message'); $wallmessage = L10n::t('Message');
$wallmessage_link = 'wallmessage/' . $profile['nickname']; $wallmessage_link = 'wallmessage/' . $profile['nickname'];
if (remote_user()) { if (remote_user()) {
@ -367,15 +366,15 @@ class Profile
// show edit profile to yourself // show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) { if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) {
$profile['edit'] = [System::baseUrl() . '/profiles', t('Profiles'), '', t('Manage/edit profiles')]; $profile['edit'] = [System::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
$r = q( $r = q(
"SELECT * FROM `profile` WHERE `uid` = %d", "SELECT * FROM `profile` WHERE `uid` = %d",
local_user() local_user()
); );
$profile['menu'] = [ $profile['menu'] = [
'chg_photo' => t('Change profile photo'), 'chg_photo' => L10n::t('Change profile photo'),
'cr_new' => t('Create New Profile'), 'cr_new' => L10n::t('Create New Profile'),
'entries' => [], 'entries' => [],
]; ];
@ -384,19 +383,19 @@ class Profile
$profile['menu']['entries'][] = [ $profile['menu']['entries'][] = [
'photo' => $rr['thumb'], 'photo' => $rr['thumb'],
'id' => $rr['id'], 'id' => $rr['id'],
'alt' => t('Profile Image'), 'alt' => L10n::t('Profile Image'),
'profile_name' => $rr['profile-name'], 'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'], 'isdefault' => $rr['is-default'],
'visibile_to_everybody' => t('visible to everybody'), 'visibile_to_everybody' => L10n::t('visible to everybody'),
'edit_visibility' => t('Edit visibility'), 'edit_visibility' => L10n::t('Edit visibility'),
]; ];
} }
} }
} }
if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) { if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) {
$profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], t('Edit profile'), '', t('Edit profile')]; $profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
$profile['menu'] = [ $profile['menu'] = [
'chg_photo' => t('Change profile photo'), 'chg_photo' => L10n::t('Change profile photo'),
'cr_new' => null, 'cr_new' => null,
'entries' => [], 'entries' => [],
]; ];
@ -412,14 +411,14 @@ class Profile
|| x($profile, 'postal-code') || x($profile, 'postal-code')
|| x($profile, 'country-name') || x($profile, 'country-name')
) { ) {
$location = t('Location:'); $location = L10n::t('Location:');
} }
$gender = x($profile, 'gender') ? t('Gender:') : false; $gender = x($profile, 'gender') ? L10n::t('Gender:') : false;
$marital = x($profile, 'marital') ? t('Status:') : false; $marital = x($profile, 'marital') ? L10n::t('Status:') : false;
$homepage = x($profile, 'homepage') ? t('Homepage:') : false; $homepage = x($profile, 'homepage') ? L10n::t('Homepage:') : false;
$about = x($profile, 'about') ? t('About:') : false; $about = x($profile, 'about') ? L10n::t('About:') : false;
$xmpp = x($profile, 'xmpp') ? t('XMPP:') : false; $xmpp = x($profile, 'xmpp') ? L10n::t('XMPP:') : false;
if ((x($profile, 'hidewall') || $block) && !local_user() && !remote_user()) { if ((x($profile, 'hidewall') || $block) && !local_user() && !remote_user()) {
$location = $gender = $marital = $homepage = $about = false; $location = $gender = $marital = $homepage = $about = false;
@ -513,7 +512,7 @@ class Profile
'$marital' => $marital, '$marital' => $marital,
'$homepage' => $homepage, '$homepage' => $homepage,
'$about' => $about, '$about' => $about,
'$network' => t('Network:'), '$network' => L10n::t('Network:'),
'$contacts' => $contacts, '$contacts' => $contacts,
'$updated' => $updated, '$updated' => $updated,
'$diaspora' => $diaspora, '$diaspora' => $diaspora,
@ -543,8 +542,8 @@ class Profile
* return $o; * return $o;
*/ */
$bd_format = t('g A l F d'); // 8 AM Friday January 18 $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
$bd_short = t('F d'); $bd_short = L10n::t('F d');
$cachekey = 'get_birthdays:' . local_user(); $cachekey = 'get_birthdays:' . local_user();
$r = Cache::get($cachekey); $r = Cache::get($cachekey);
@ -599,7 +598,7 @@ class Profile
$rr['link'] = $url; $rr['link'] = $url;
$rr['title'] = $rr['name']; $rr['title'] = $rr['name'];
$rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . t('[today]') : ''); $rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = null; $rr['startime'] = null;
$rr['today'] = $today; $rr['today'] = $today;
} }
@ -610,8 +609,8 @@ class Profile
'$baseurl' => System::baseUrl(), '$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday, '$classtoday' => $classtoday,
'$count' => $total, '$count' => $total,
'$event_reminders' => t('Birthday Reminders'), '$event_reminders' => L10n::t('Birthday Reminders'),
'$event_title' => t('Birthdays this week:'), '$event_title' => L10n::t('Birthdays this week:'),
'$events' => $r, '$events' => $r,
'$lbr' => '{', // raw brackets mess up if/endif macro processing '$lbr' => '{', // raw brackets mess up if/endif macro processing
'$rbr' => '}' '$rbr' => '}'
@ -635,7 +634,7 @@ class Profile
* return $o; * return $o;
*/ */
$bd_format = t('g A l F d'); // 8 AM Friday January 18 $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
$classtoday = ''; $classtoday = '';
$s = dba::p( $s = dba::p(
@ -670,7 +669,7 @@ class Profile
$description = substr(strip_tags(bbcode($rr['desc'])), 0, 32) . '... '; $description = substr(strip_tags(bbcode($rr['desc'])), 0, 32) . '... ';
if (!$description) { if (!$description) {
$description = t('[No description]'); $description = L10n::t('[No description]');
} }
$strt = datetime_convert('UTC', $rr['convert'] ? $a->timezone : 'UTC', $rr['start']); $strt = datetime_convert('UTC', $rr['convert'] ? $a->timezone : 'UTC', $rr['start']);
@ -683,7 +682,7 @@ class Profile
$rr['title'] = $title; $rr['title'] = $title;
$rr['description'] = $description; $rr['description'] = $description;
$rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : ''); $rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = $strt; $rr['startime'] = $strt;
$rr['today'] = $today; $rr['today'] = $today;
@ -697,8 +696,8 @@ class Profile
'$baseurl' => System::baseUrl(), '$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday, '$classtoday' => $classtoday,
'$count' => count($r), '$count' => count($r),
'$event_reminders' => t('Event Reminders'), '$event_reminders' => L10n::t('Event Reminders'),
'$event_title' => t('Events this week:'), '$event_title' => L10n::t('Events this week:'),
'$events' => $r, '$events' => $r,
]); ]);
} }
@ -710,7 +709,7 @@ class Profile
$o .= replace_macros( $o .= replace_macros(
get_markup_template('section_title.tpl'), get_markup_template('section_title.tpl'),
['$title' => t('Profile')] ['$title' => L10n::t('Profile')]
); );
if ($a->profile['name']) { if ($a->profile['name']) {
@ -718,32 +717,32 @@ class Profile
$profile = []; $profile = [];
$profile['fullname'] = [t('Full Name:'), $a->profile['name']]; $profile['fullname'] = [L10n::t('Full Name:'), $a->profile['name']];
if ($a->profile['gender']) { if ($a->profile['gender']) {
$profile['gender'] = [t('Gender:'), $a->profile['gender']]; $profile['gender'] = [L10n::t('Gender:'), $a->profile['gender']];
} }
if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) { if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
$year_bd_format = t('j F, Y'); $year_bd_format = L10n::t('j F, Y');
$short_bd_format = t('j F'); $short_bd_format = L10n::t('j F');
$val = intval($a->profile['dob']) ? $val = intval($a->profile['dob']) ?
day_translate(datetime_convert('UTC', 'UTC', $a->profile['dob'] . ' 00:00 +00:00', $year_bd_format)) day_translate(datetime_convert('UTC', 'UTC', $a->profile['dob'] . ' 00:00 +00:00', $year_bd_format))
: day_translate(datetime_convert('UTC', 'UTC', '2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format)); : day_translate(datetime_convert('UTC', 'UTC', '2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format));
$profile['birthday'] = [t('Birthday:'), $val]; $profile['birthday'] = [L10n::t('Birthday:'), $val];
} }
if (!empty($a->profile['dob']) if (!empty($a->profile['dob'])
&& $a->profile['dob'] > '0001-01-01' && $a->profile['dob'] > '0001-01-01'
&& $age = age($a->profile['dob'], $a->profile['timezone'], '') && $age = age($a->profile['dob'], $a->profile['timezone'], '')
) { ) {
$profile['age'] = [t('Age:'), $age]; $profile['age'] = [L10n::t('Age:'), $age];
} }
if ($a->profile['marital']) { if ($a->profile['marital']) {
$profile['marital'] = [t('Status:'), $a->profile['marital']]; $profile['marital'] = [L10n::t('Status:'), $a->profile['marital']];
} }
/// @TODO Maybe use x() here, plus below? /// @TODO Maybe use x() here, plus below?
@ -752,94 +751,94 @@ class Profile
} }
if (strlen($a->profile['howlong']) && $a->profile['howlong'] >= NULL_DATE) { if (strlen($a->profile['howlong']) && $a->profile['howlong'] >= NULL_DATE) {
$profile['howlong'] = relative_date($a->profile['howlong'], t('for %1$d %2$s')); $profile['howlong'] = relative_date($a->profile['howlong'], L10n::t('for %1$d %2$s'));
} }
if ($a->profile['sexual']) { if ($a->profile['sexual']) {
$profile['sexual'] = [t('Sexual Preference:'), $a->profile['sexual']]; $profile['sexual'] = [L10n::t('Sexual Preference:'), $a->profile['sexual']];
} }
if ($a->profile['homepage']) { if ($a->profile['homepage']) {
$profile['homepage'] = [t('Homepage:'), linkify($a->profile['homepage'])]; $profile['homepage'] = [L10n::t('Homepage:'), linkify($a->profile['homepage'])];
} }
if ($a->profile['hometown']) { if ($a->profile['hometown']) {
$profile['hometown'] = [t('Hometown:'), linkify($a->profile['hometown'])]; $profile['hometown'] = [L10n::t('Hometown:'), linkify($a->profile['hometown'])];
} }
if ($a->profile['pub_keywords']) { if ($a->profile['pub_keywords']) {
$profile['pub_keywords'] = [t('Tags:'), $a->profile['pub_keywords']]; $profile['pub_keywords'] = [L10n::t('Tags:'), $a->profile['pub_keywords']];
} }
if ($a->profile['politic']) { if ($a->profile['politic']) {
$profile['politic'] = [t('Political Views:'), $a->profile['politic']]; $profile['politic'] = [L10n::t('Political Views:'), $a->profile['politic']];
} }
if ($a->profile['religion']) { if ($a->profile['religion']) {
$profile['religion'] = [t('Religion:'), $a->profile['religion']]; $profile['religion'] = [L10n::t('Religion:'), $a->profile['religion']];
} }
if ($txt = prepare_text($a->profile['about'])) { if ($txt = prepare_text($a->profile['about'])) {
$profile['about'] = [t('About:'), $txt]; $profile['about'] = [L10n::t('About:'), $txt];
} }
if ($txt = prepare_text($a->profile['interest'])) { if ($txt = prepare_text($a->profile['interest'])) {
$profile['interest'] = [t('Hobbies/Interests:'), $txt]; $profile['interest'] = [L10n::t('Hobbies/Interests:'), $txt];
} }
if ($txt = prepare_text($a->profile['likes'])) { if ($txt = prepare_text($a->profile['likes'])) {
$profile['likes'] = [t('Likes:'), $txt]; $profile['likes'] = [L10n::t('Likes:'), $txt];
} }
if ($txt = prepare_text($a->profile['dislikes'])) { if ($txt = prepare_text($a->profile['dislikes'])) {
$profile['dislikes'] = [t('Dislikes:'), $txt]; $profile['dislikes'] = [L10n::t('Dislikes:'), $txt];
} }
if ($txt = prepare_text($a->profile['contact'])) { if ($txt = prepare_text($a->profile['contact'])) {
$profile['contact'] = [t('Contact information and Social Networks:'), $txt]; $profile['contact'] = [L10n::t('Contact information and Social Networks:'), $txt];
} }
if ($txt = prepare_text($a->profile['music'])) { if ($txt = prepare_text($a->profile['music'])) {
$profile['music'] = [t('Musical interests:'), $txt]; $profile['music'] = [L10n::t('Musical interests:'), $txt];
} }
if ($txt = prepare_text($a->profile['book'])) { if ($txt = prepare_text($a->profile['book'])) {
$profile['book'] = [t('Books, literature:'), $txt]; $profile['book'] = [L10n::t('Books, literature:'), $txt];
} }
if ($txt = prepare_text($a->profile['tv'])) { if ($txt = prepare_text($a->profile['tv'])) {
$profile['tv'] = [t('Television:'), $txt]; $profile['tv'] = [L10n::t('Television:'), $txt];
} }
if ($txt = prepare_text($a->profile['film'])) { if ($txt = prepare_text($a->profile['film'])) {
$profile['film'] = [t('Film/dance/culture/entertainment:'), $txt]; $profile['film'] = [L10n::t('Film/dance/culture/entertainment:'), $txt];
} }
if ($txt = prepare_text($a->profile['romance'])) { if ($txt = prepare_text($a->profile['romance'])) {
$profile['romance'] = [t('Love/Romance:'), $txt]; $profile['romance'] = [L10n::t('Love/Romance:'), $txt];
} }
if ($txt = prepare_text($a->profile['work'])) { if ($txt = prepare_text($a->profile['work'])) {
$profile['work'] = [t('Work/employment:'), $txt]; $profile['work'] = [L10n::t('Work/employment:'), $txt];
} }
if ($txt = prepare_text($a->profile['education'])) { if ($txt = prepare_text($a->profile['education'])) {
$profile['education'] = [t('School/education:'), $txt]; $profile['education'] = [L10n::t('School/education:'), $txt];
} }
//show subcribed forum if it is enabled in the usersettings //show subcribed forum if it is enabled in the usersettings
if (Feature::isEnabled($uid, 'forumlist_profile')) { if (Feature::isEnabled($uid, 'forumlist_profile')) {
$profile['forumlist'] = [t('Forums:'), ForumManager::profileAdvanced($uid)]; $profile['forumlist'] = [L10n::t('Forums:'), ForumManager::profileAdvanced($uid)];
} }
if ($a->profile['uid'] == local_user()) { if ($a->profile['uid'] == local_user()) {
$profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], t('Edit profile'), '', t('Edit profile')]; $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
} }
return replace_macros($tpl, [ return replace_macros($tpl, [
'$title' => t('Profile'), '$title' => L10n::t('Profile'),
'$basic' => t('Basic'), '$basic' => L10n::t('Basic'),
'$advanced' => t('Advanced'), '$advanced' => L10n::t('Advanced'),
'$profile' => $profile '$profile' => $profile
]); ]);
} }
@ -862,34 +861,34 @@ class Profile
$tabs = [ $tabs = [
[ [
'label' => t('Status'), 'label' => L10n::t('Status'),
'url' => $url, 'url' => $url,
'sel' => !$tab && $a->argv[0] == 'profile' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'profile' ? 'active' : '',
'title' => t('Status Messages and Posts'), 'title' => L10n::t('Status Messages and Posts'),
'id' => 'status-tab', 'id' => 'status-tab',
'accesskey' => 'm', 'accesskey' => 'm',
], ],
[ [
'label' => t('Profile'), 'label' => L10n::t('Profile'),
'url' => $url . '/?tab=profile', 'url' => $url . '/?tab=profile',
'sel' => $tab == 'profile' ? 'active' : '', 'sel' => $tab == 'profile' ? 'active' : '',
'title' => t('Profile Details'), 'title' => L10n::t('Profile Details'),
'id' => 'profile-tab', 'id' => 'profile-tab',
'accesskey' => 'r', 'accesskey' => 'r',
], ],
[ [
'label' => t('Photos'), 'label' => L10n::t('Photos'),
'url' => System::baseUrl() . '/photos/' . $nickname, 'url' => System::baseUrl() . '/photos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'photos' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'photos' ? 'active' : '',
'title' => t('Photo Albums'), 'title' => L10n::t('Photo Albums'),
'id' => 'photo-tab', 'id' => 'photo-tab',
'accesskey' => 'h', 'accesskey' => 'h',
], ],
[ [
'label' => t('Videos'), 'label' => L10n::t('Videos'),
'url' => System::baseUrl() . '/videos/' . $nickname, 'url' => System::baseUrl() . '/videos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'videos' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'videos' ? 'active' : '',
'title' => t('Videos'), 'title' => L10n::t('Videos'),
'id' => 'video-tab', 'id' => 'video-tab',
'accesskey' => 'v', 'accesskey' => 'v',
], ],
@ -898,10 +897,10 @@ class Profile
// the calendar link for the full featured events calendar // the calendar link for the full featured events calendar
if ($is_owner && $a->theme_events_in_profile) { if ($is_owner && $a->theme_events_in_profile) {
$tabs[] = [ $tabs[] = [
'label' => t('Events'), 'label' => L10n::t('Events'),
'url' => System::baseUrl() . '/events', 'url' => System::baseUrl() . '/events',
'sel' => !$tab && $a->argv[0] == 'events' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'events' ? 'active' : '',
'title' => t('Events and Calendar'), 'title' => L10n::t('Events and Calendar'),
'id' => 'events-tab', 'id' => 'events-tab',
'accesskey' => 'e', 'accesskey' => 'e',
]; ];
@ -909,10 +908,10 @@ class Profile
// with the public events of the calendar owner // with the public events of the calendar owner
} elseif (!$is_owner) { } elseif (!$is_owner) {
$tabs[] = [ $tabs[] = [
'label' => t('Events'), 'label' => L10n::t('Events'),
'url' => System::baseUrl() . '/cal/' . $nickname, 'url' => System::baseUrl() . '/cal/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'cal' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'cal' ? 'active' : '',
'title' => t('Events and Calendar'), 'title' => L10n::t('Events and Calendar'),
'id' => 'events-tab', 'id' => 'events-tab',
'accesskey' => 'e', 'accesskey' => 'e',
]; ];
@ -920,10 +919,10 @@ class Profile
if ($is_owner) { if ($is_owner) {
$tabs[] = [ $tabs[] = [
'label' => t('Personal Notes'), 'label' => L10n::t('Personal Notes'),
'url' => System::baseUrl() . '/notes', 'url' => System::baseUrl() . '/notes',
'sel' => !$tab && $a->argv[0] == 'notes' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'notes' ? 'active' : '',
'title' => t('Only You Can See This'), 'title' => L10n::t('Only You Can See This'),
'id' => 'notes-tab', 'id' => 'notes-tab',
'accesskey' => 't', 'accesskey' => 't',
]; ];
@ -931,10 +930,10 @@ class Profile
if ((!$is_owner) && ((count($a->profile)) || (!$a->profile['hide-friends']))) { if ((!$is_owner) && ((count($a->profile)) || (!$a->profile['hide-friends']))) {
$tabs[] = [ $tabs[] = [
'label' => t('Contacts'), 'label' => L10n::t('Contacts'),
'url' => System::baseUrl() . '/viewcontacts/' . $nickname, 'url' => System::baseUrl() . '/viewcontacts/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'viewcontacts' ? 'active' : '', 'sel' => !$tab && $a->argv[0] == 'viewcontacts' ? 'active' : '',
'title' => t('Contacts'), 'title' => L10n::t('Contacts'),
'id' => 'viewcontacts-tab', 'id' => 'viewcontacts-tab',
'accesskey' => 'k', 'accesskey' => 'k',
]; ];

View file

@ -1,15 +1,14 @@
<?php <?php
/** /**
* @file src/Model/User.php * @file src/Model/User.php
* @brief This file includes the User class with user related database functions * @brief This file includes the User class with user related database functions
*/ */
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
@ -266,25 +265,25 @@ class User
$netpublish = strlen(Config::get('system', 'directory')) ? $publish : 0; $netpublish = strlen(Config::get('system', 'directory')) ? $publish : 0;
if ($password1 != $confirm) { if ($password1 != $confirm) {
throw new Exception(t('Passwords do not match. Password unchanged.')); throw new Exception(L10n::t('Passwords do not match. Password unchanged.'));
} elseif ($password1 != '') { } elseif ($password1 != '') {
$password = $password1; $password = $password1;
} }
if ($using_invites) { if ($using_invites) {
if (!$invite_id) { if (!$invite_id) {
throw new Exception(t('An invitation is required.')); throw new Exception(L10n::t('An invitation is required.'));
} }
if (!dba::exists('register', ['hash' => $invite_id])) { if (!dba::exists('register', ['hash' => $invite_id])) {
throw new Exception(t('Invitation could not be verified.')); throw new Exception(L10n::t('Invitation could not be verified.'));
} }
} }
if (!x($username) || !x($email) || !x($nickname)) { if (!x($username) || !x($email) || !x($nickname)) {
if ($openid_url) { if ($openid_url) {
if (!validate_url($openid_url)) { if (!validate_url($openid_url)) {
throw new Exception(t('Invalid OpenID url')); throw new Exception(L10n::t('Invalid OpenID url'));
} }
$_SESSION['register'] = 1; $_SESSION['register'] = 1;
$_SESSION['openid'] = $openid_url; $_SESSION['openid'] = $openid_url;
@ -297,13 +296,13 @@ class User
try { try {
$authurl = $openid->authUrl(); $authurl = $openid->authUrl();
} catch (Exception $e) { } catch (Exception $e) {
throw new Exception(t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . t('The error message was:') . $e->getMessage(), 0, $e); throw new Exception(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . L10n::t('The error message was:') . $e->getMessage(), 0, $e);
} }
goaway($authurl); goaway($authurl);
// NOTREACHED // NOTREACHED
} }
throw new Exception(t('Please enter the required information.')); throw new Exception(L10n::t('Please enter the required information.'));
} }
if (!validate_url($openid_url)) { if (!validate_url($openid_url)) {
@ -316,10 +315,10 @@ class User
$username = preg_replace('/ +/', ' ', $username); $username = preg_replace('/ +/', ' ', $username);
if (mb_strlen($username) > 48) { if (mb_strlen($username) > 48) {
throw new Exception(t('Please use a shorter name.')); throw new Exception(L10n::t('Please use a shorter name.'));
} }
if (mb_strlen($username) < 3) { if (mb_strlen($username) < 3) {
throw new Exception(t('Name too short.')); throw new Exception(L10n::t('Name too short.'));
} }
// So now we are just looking for a space in the full name. // So now we are just looking for a space in the full name.
@ -327,20 +326,20 @@ class User
if (!$loose_reg) { if (!$loose_reg) {
$username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8'); $username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8');
if (!strpos($username, ' ')) { if (!strpos($username, ' ')) {
throw new Exception(t("That doesn't appear to be your full \x28First Last\x29 name.")); throw new Exception(L10n::t("That doesn't appear to be your full \x28First Last\x29 name."));
} }
} }
if (!allowed_email($email)) { if (!allowed_email($email)) {
throw new Exception(t('Your email domain is not among those allowed on this site.')); throw new Exception(L10n::t('Your email domain is not among those allowed on this site.'));
} }
if (!valid_email($email) || !validate_email($email)) { if (!valid_email($email) || !validate_email($email)) {
throw new Exception(t('Not a valid email address.')); throw new Exception(L10n::t('Not a valid email address.'));
} }
if (dba::exists('user', ['email' => $email])) { if (dba::exists('user', ['email' => $email])) {
throw new Exception(t('Cannot use that email.')); throw new Exception(L10n::t('Cannot use that email.'));
} }
// Disallow somebody creating an account using openid that uses the admin email address, // Disallow somebody creating an account using openid that uses the admin email address,
@ -348,21 +347,21 @@ class User
if (x($a->config, 'admin_email') && strlen($openid_url)) { if (x($a->config, 'admin_email') && strlen($openid_url)) {
$adminlist = explode(',', str_replace(' ', '', strtolower($a->config['admin_email']))); $adminlist = explode(',', str_replace(' ', '', strtolower($a->config['admin_email'])));
if (in_array(strtolower($email), $adminlist)) { if (in_array(strtolower($email), $adminlist)) {
throw new Exception(t('Cannot use that email.')); throw new Exception(L10n::t('Cannot use that email.'));
} }
} }
$nickname = $data['nickname'] = strtolower($nickname); $nickname = $data['nickname'] = strtolower($nickname);
if (!preg_match('/^[a-z0-9][a-z0-9\_]*$/', $nickname)) { if (!preg_match('/^[a-z0-9][a-z0-9\_]*$/', $nickname)) {
throw new Exception(t('Your "nickname" can only contain "a-z", "0-9" and "_".')); throw new Exception(L10n::t('Your "nickname" can only contain "a-z", "0-9" and "_".'));
} }
// Check existing and deleted accounts for this nickname. // Check existing and deleted accounts for this nickname.
if (dba::exists('user', ['nickname' => $nickname]) if (dba::exists('user', ['nickname' => $nickname])
|| dba::exists('userd', ['username' => $nickname]) || dba::exists('userd', ['username' => $nickname])
) { ) {
throw new Exception(t('Nickname is already registered. Please choose another.')); throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
} }
$new_password = strlen($password) ? $password : User::generateNewPassword(); $new_password = strlen($password) ? $password : User::generateNewPassword();
@ -372,7 +371,7 @@ class User
$keys = Crypto::newKeypair(4096); $keys = Crypto::newKeypair(4096);
if ($keys === false) { if ($keys === false) {
throw new Exception(t('SERIOUS ERROR: Generation of security keys failed.')); throw new Exception(L10n::t('SERIOUS ERROR: Generation of security keys failed.'));
} }
$prvkey = $keys['prvkey']; $prvkey = $keys['prvkey'];
@ -405,11 +404,11 @@ class User
$uid = dba::lastInsertId(); $uid = dba::lastInsertId();
$user = dba::selectFirst('user', [], ['uid' => $uid]); $user = dba::selectFirst('user', [], ['uid' => $uid]);
} else { } else {
throw new Exception(t('An error occurred during registration. Please try again.')); throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
} }
if (!$uid) { if (!$uid) {
throw new Exception(t('An error occurred during registration. Please try again.')); throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
} }
// if somebody clicked submit twice very quickly, they could end up with two accounts // if somebody clicked submit twice very quickly, they could end up with two accounts
@ -418,7 +417,7 @@ class User
if ($user_count > 1) { if ($user_count > 1) {
dba::delete('user', ['uid' => $uid]); dba::delete('user', ['uid' => $uid]);
throw new Exception(t('Nickname is already registered. Please choose another.')); throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
} }
$insert_result = dba::insert('profile', [ $insert_result = dba::insert('profile', [
@ -429,28 +428,28 @@ class User
'publish' => $publish, 'publish' => $publish,
'is-default' => 1, 'is-default' => 1,
'net-publish' => $netpublish, 'net-publish' => $netpublish,
'profile-name' => t('default') 'profile-name' => L10n::t('default')
]); ]);
if (!$insert_result) { if (!$insert_result) {
dba::delete('user', ['uid' => $uid]); dba::delete('user', ['uid' => $uid]);
throw new Exception(t('An error occurred creating your default profile. Please try again.')); throw new Exception(L10n::t('An error occurred creating your default profile. Please try again.'));
} }
// Create the self contact // Create the self contact
if (!Contact::createSelfFromUserId($uid)) { if (!Contact::createSelfFromUserId($uid)) {
dba::delete('user', ['uid' => $uid]); dba::delete('user', ['uid' => $uid]);
throw new Exception(t('An error occurred creating your self contact. Please try again.')); throw new Exception(L10n::t('An error occurred creating your self contact. Please try again.'));
} }
// Create a group with no members. This allows somebody to use it // Create a group with no members. This allows somebody to use it
// right away as a default group for new contacts. // right away as a default group for new contacts.
$def_gid = Group::create($uid, t('Friends')); $def_gid = Group::create($uid, L10n::t('Friends'));
if (!$def_gid) { if (!$def_gid) {
dba::delete('user', ['uid' => $uid]); dba::delete('user', ['uid' => $uid]);
throw new Exception(t('An error occurred creating your default contact group. Please try again.')); throw new Exception(L10n::t('An error occurred creating your default contact group. Please try again.'));
} }
$fields = ['def_gid' => $def_gid]; $fields = ['def_gid' => $def_gid];
@ -480,7 +479,7 @@ class User
$hash = photo_new_resource(); $hash = photo_new_resource();
$r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 4); $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 4);
if ($r === false) { if ($r === false) {
$photo_failure = true; $photo_failure = true;
@ -488,7 +487,7 @@ class User
$Image->scaleDown(80); $Image->scaleDown(80);
$r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 5); $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 5);
if ($r === false) { if ($r === false) {
$photo_failure = true; $photo_failure = true;
@ -496,7 +495,7 @@ class User
$Image->scaleDown(48); $Image->scaleDown(48);
$r = Photo::store($Image, $uid, 0, $hash, $filename, t('Profile Photos'), 6); $r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 6);
if ($r === false) { if ($r === false) {
$photo_failure = true; $photo_failure = true;
@ -524,7 +523,7 @@ class User
*/ */
public static function sendRegisterPendingEmail($email, $sitename, $username) public static function sendRegisterPendingEmail($email, $sitename, $username)
{ {
$body = deindent(t(' $body = deindent(L10n::t('
Dear %1$s, Dear %1$s,
Thank you for registering at %2$s. Your account is pending for approval by the administrator. Thank you for registering at %2$s. Your account is pending for approval by the administrator.
')); '));
@ -534,7 +533,7 @@ class User
return notification([ return notification([
'type' => SYSTEM_EMAIL, 'type' => SYSTEM_EMAIL,
'to_email' => $email, 'to_email' => $email,
'subject'=> sprintf( t('Registration at %s'), $sitename), 'subject'=> sprintf(L10n::t('Registration at %s'), $sitename),
'body' => $body]); 'body' => $body]);
} }
@ -552,11 +551,11 @@ class User
*/ */
public static function sendRegisterOpenEmail($email, $sitename, $siteurl, $username, $password) public static function sendRegisterOpenEmail($email, $sitename, $siteurl, $username, $password)
{ {
$preamble = deindent(t(' $preamble = deindent(L10n::t('
Dear %1$s, Dear %1$s,
Thank you for registering at %2$s. Your account has been created. Thank you for registering at %2$s. Your account has been created.
')); '));
$body = deindent(t(' $body = deindent(L10n::t('
The login details are as follows: The login details are as follows:
Site Location: %3$s Site Location: %3$s
Login Name: %1$s Login Name: %1$s
@ -588,7 +587,7 @@ class User
return notification([ return notification([
'type' => SYSTEM_EMAIL, 'type' => SYSTEM_EMAIL,
'to_email' => $email, 'to_email' => $email,
'subject'=> sprintf( t('Registration details for %s'), $sitename), 'subject'=> sprintf(L10n::t('Registration details for %s'), $sitename),
'preamble'=> $preamble, 'preamble'=> $preamble,
'body' => $body]); 'body' => $body]);
} }

View file

@ -76,7 +76,7 @@ class Login extends BaseModule
$openid->returnUrl = self::getApp()->get_baseurl(true) . '/openid'; $openid->returnUrl = self::getApp()->get_baseurl(true) . '/openid';
goaway($openid->authUrl()); goaway($openid->authUrl());
} catch (Exception $e) { } catch (Exception $e) {
notice(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br /><br >' . t('The error message was:') . ' ' . $e->getMessage()); notice(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . '<br /><br >' . L10n::t('The error message was:') . ' ' . $e->getMessage());
} }
// NOTREACHED // NOTREACHED
} }
@ -249,8 +249,8 @@ class Login extends BaseModule
$reg = false; $reg = false;
if ($register) { if ($register) {
$reg = [ $reg = [
'title' => t('Create a New Account'), 'title' => L10n::t('Create a New Account'),
'desc' => t('Register') 'desc' => L10n::t('Register')
]; ];
} }
@ -278,28 +278,28 @@ class Login extends BaseModule
$tpl, $tpl,
[ [
'$dest_url' => self::getApp()->get_baseurl(true) . '/login', '$dest_url' => self::getApp()->get_baseurl(true) . '/login',
'$logout' => t('Logout'), '$logout' => L10n::t('Logout'),
'$login' => t('Login'), '$login' => L10n::t('Login'),
'$lname' => ['username', t('Nickname or Email: ') , '', ''], '$lname' => ['username', L10n::t('Nickname or Email: ') , '', ''],
'$lpassword' => ['password', t('Password: '), '', ''], '$lpassword' => ['password', L10n::t('Password: '), '', ''],
'$lremember' => ['remember', t('Remember me'), 0, ''], '$lremember' => ['remember', L10n::t('Remember me'), 0, ''],
'$openid' => !$noid, '$openid' => !$noid,
'$lopenid' => ['openid_url', t('Or login using OpenID: '),'',''], '$lopenid' => ['openid_url', L10n::t('Or login using OpenID: '),'',''],
'$hiddens' => $hiddens, '$hiddens' => $hiddens,
'$register' => $reg, '$register' => $reg,
'$lostpass' => t('Forgot your password?'), '$lostpass' => L10n::t('Forgot your password?'),
'$lostlink' => t('Password Reset'), '$lostlink' => L10n::t('Password Reset'),
'$tostitle' => t('Website Terms of Service'), '$tostitle' => L10n::t('Website Terms of Service'),
'$toslink' => t('terms of service'), '$toslink' => L10n::t('terms of service'),
'$privacytitle' => t('Website Privacy Policy'), '$privacytitle' => L10n::t('Website Privacy Policy'),
'$privacylink' => t('privacy policy'), '$privacylink' => L10n::t('privacy policy'),
] ]
); );

View file

@ -8,6 +8,7 @@ namespace Friendica\Object;
use Friendica\App; use Friendica\App;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Photo; use Friendica\Model\Photo;
@ -944,7 +945,7 @@ class Image
$defperm = ""; $defperm = "";
$visitor = 0; $visitor = 0;
$r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 0, 0, $defperm); $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 0, 0, $defperm);
if (!$r) { if (!$r) {
logger("Picture couldn't be stored", LOGGER_DEBUG); logger("Picture couldn't be stored", LOGGER_DEBUG);
@ -960,7 +961,7 @@ class Image
if ($width > 640 || $height > 640) { if ($width > 640 || $height > 640) {
$Image->scaleDown(640); $Image->scaleDown(640);
$r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 1, 0, $defperm); $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 1, 0, $defperm);
if ($r) { if ($r) {
$image["medium"] = System::baseUrl()."/photo/{$hash}-1.".$Image->getExt(); $image["medium"] = System::baseUrl()."/photo/{$hash}-1.".$Image->getExt();
} }
@ -968,7 +969,7 @@ class Image
if ($width > 320 || $height > 320) { if ($width > 320 || $height > 320) {
$Image->scaleDown(320); $Image->scaleDown(320);
$r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 2, 0, $defperm); $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 2, 0, $defperm);
if ($r) { if ($r) {
$image["small"] = System::baseUrl()."/photo/{$hash}-2.".$Image->getExt(); $image["small"] = System::baseUrl()."/photo/{$hash}-2.".$Image->getExt();
} }
@ -993,7 +994,7 @@ class Image
$min = 160; $min = 160;
$Image->crop(160, $x, $y, $min, $min); $Image->crop(160, $x, $y, $min, $min);
$r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, t('Wall Photos'), 3, 0, $defperm); $r = Photo::store($Image, $uid, $visitor, $hash, $tempfile, L10n::t('Wall Photos'), 3, 0, $defperm);
if ($r) { if ($r) {
$image["thumb"] = System::baseUrl()."/photo/{$hash}-3.".$Image->getExt(); $image["thumb"] = System::baseUrl()."/photo/{$hash}-3.".$Image->getExt();
} }

View file

@ -123,7 +123,7 @@ class Post extends BaseObject
// only if the difference is more than 1 second. // only if the difference is more than 1 second.
if (strtotime($item['edited']) - strtotime($item['created']) > 1) { if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
$edited = [ $edited = [
'label' => t('This entry was edited'), 'label' => L10n::t('This entry was edited'),
'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'), 'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),
'relative' => relative_date($item['edited']) 'relative' => relative_date($item['edited'])
]; ];
@ -144,15 +144,15 @@ class Post extends BaseObject
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid'])))) || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? t('Private Message') ? L10n::t('Private Message')
: false); : false);
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1; $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
if (local_user() && link_compare($a->contact['url'], $item['author-link'])) { if (local_user() && link_compare($a->contact['url'], $item['author-link'])) {
if ($item["event-id"] != 0) { if ($item["event-id"] != 0) {
$edpost = ["events/event/" . $item['event-id'], t("Edit")]; $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
} else { } else {
$edpost = ["editpost/" . $item['id'], t("Edit")]; $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
} }
$dropping = in_array($item['uid'], [0, local_user()]); $dropping = in_array($item['uid'], [0, local_user()]);
} else { } else {
@ -173,11 +173,11 @@ class Post extends BaseObject
$drop = [ $drop = [
'dropping' => $dropping, 'dropping' => $dropping,
'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''), 'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''),
'select' => t('Select'), 'select' => L10n::t('Select'),
'delete' => t('Delete'), 'delete' => L10n::t('Delete'),
]; ];
$filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? t("save to folder") : false); $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
$diff_author = !link_compare($item['url'], $item['author-link']); $diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); $profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
@ -230,7 +230,7 @@ class Post extends BaseObject
$response_verbs[] = 'attendmaybe'; $response_verbs[] = 'attendmaybe';
if ($conv->isWritable()) { if ($conv->isWritable()) {
$isevent = true; $isevent = true;
$attend = [t('I will attend'), t('I will not attend'), t('I might attend')]; $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
} }
} }
@ -258,29 +258,29 @@ class Post extends BaseObject
$isstarred = (($item['starred']) ? "starred" : "unstarred"); $isstarred = (($item['starred']) ? "starred" : "unstarred");
$star = [ $star = [
'do' => t("add star"), 'do' => L10n::t("add star"),
'undo' => t("remove star"), 'undo' => L10n::t("remove star"),
'toggle' => t("toggle star status"), 'toggle' => L10n::t("toggle star status"),
'classdo' => $item['starred'] ? "hidden" : "", 'classdo' => $item['starred'] ? "hidden" : "",
'classundo' => $item['starred'] ? "" : "hidden", 'classundo' => $item['starred'] ? "" : "hidden",
'starred' => t('starred'), 'starred' => L10n::t('starred'),
]; ];
$thread = dba::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]); $thread = dba::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]);
if (DBM::is_result($thread)) { if (DBM::is_result($thread)) {
$ignore = [ $ignore = [
'do' => t("ignore thread"), 'do' => L10n::t("ignore thread"),
'undo' => t("unignore thread"), 'undo' => L10n::t("unignore thread"),
'toggle' => t("toggle ignore status"), 'toggle' => L10n::t("toggle ignore status"),
'classdo' => $thread['ignored'] ? "hidden" : "", 'classdo' => $thread['ignored'] ? "hidden" : "",
'classundo' => $thread['ignored'] ? "" : "hidden", 'classundo' => $thread['ignored'] ? "" : "hidden",
'ignored' => t('ignored'), 'ignored' => L10n::t('ignored'),
]; ];
} }
if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) { if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) {
$tagger = [ $tagger = [
'add' => t("add tag"), 'add' => L10n::t("add tag"),
'class' => "", 'class' => "",
]; ];
} }
@ -291,11 +291,11 @@ class Post extends BaseObject
if ($conv->isWritable()) { if ($conv->isWritable()) {
$buttons = [ $buttons = [
'like' => [t("I like this \x28toggle\x29"), t("like")], 'like' => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [t("I don't like this \x28toggle\x29"), t("dislike")] : '', 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")] : '',
]; ];
if ($shareable) { if ($shareable) {
$buttons['share'] = [t('Share this'), t('share')]; $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
} }
// If a contact isn't writable, we cannot send a like or dislike to it // If a contact isn't writable, we cannot send a like or dislike to it
@ -345,8 +345,8 @@ class Post extends BaseObject
'tags' => $item['tags'], 'tags' => $item['tags'],
'hashtags' => $item['hashtags'], 'hashtags' => $item['hashtags'],
'mentions' => $item['mentions'], 'mentions' => $item['mentions'],
'txt_cats' => t('Categories:'), 'txt_cats' => L10n::t('Categories:'),
'txt_folders' => t('Filed under:'), 'txt_folders' => L10n::t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''), 'has_cats' => ((count($categories)) ? 'true' : ''),
'has_folders' => ((count($folders)) ? 'true' : ''), 'has_folders' => ((count($folders)) ? 'true' : ''),
'categories' => $categories, 'categories' => $categories,
@ -357,12 +357,12 @@ class Post extends BaseObject
'guid' => urlencode($item['guid']), 'guid' => urlencode($item['guid']),
'isevent' => $isevent, 'isevent' => $isevent,
'attend' => $attend, 'attend' => $attend,
'linktitle' => t('View %s\'s profile @ %s', $profile_name, defaults($item, 'author-link', $item['url'])), 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, defaults($item, 'author-link', $item['url'])),
'olinktitle' => t('View %s\'s profile @ %s', htmlentities($this->getOwnerName()), defaults($item, 'owner-link', $item['url'])), 'olinktitle' => L10n::t('View %s\'s profile @ %s', htmlentities($this->getOwnerName()), defaults($item, 'owner-link', $item['url'])),
'to' => t('to'), 'to' => L10n::t('to'),
'via' => t('via'), 'via' => L10n::t('via'),
'wall' => t('Wall-to-Wall'), 'wall' => L10n::t('Wall-to-Wall'),
'vwall' => t('via Wall-To-Wall:'), 'vwall' => L10n::t('via Wall-To-Wall:'),
'profile_url' => $profile_link, 'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item), 'item_photo_menu' => item_photo_menu($item),
'name' => $name_e, 'name' => $name_e,
@ -371,7 +371,7 @@ class Post extends BaseObject
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'title' => $title_e, 'title' => $title_e,
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
'ago' => $item['app'] ? t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']), 'ago' => $item['app'] ? L10n::t('%s from %s', relative_date($item['created']), $item['app']) : relative_date($item['created']),
'app' => $item['app'], 'app' => $item['app'],
'created' => relative_date($item['created']), 'created' => relative_date($item['created']),
'lock' => $lock, 'lock' => $lock,
@ -393,10 +393,10 @@ class Post extends BaseObject
'like' => $responses['like']['output'], 'like' => $responses['like']['output'],
'dislike' => $responses['dislike']['output'], 'dislike' => $responses['dislike']['output'],
'responses' => $responses, 'responses' => $responses,
'switchcomment' => t('Comment'), 'switchcomment' => L10n::t('Comment'),
'comment' => $comment, 'comment' => $comment,
'previewing' => $conv->isPreview() ? ' preview ' : '', 'previewing' => $conv->isPreview() ? ' preview ' : '',
'wait' => t('Please wait'), 'wait' => L10n::t('Please wait'),
'thread_level' => $thread_level, 'thread_level' => $thread_level,
'edited' => $edited, 'edited' => $edited,
'network' => $item["item_network"], 'network' => $item["item_network"],
@ -424,7 +424,7 @@ class Post extends BaseObject
$result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children); $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
$result['children'][0]['hidden_comments_num'] = $total_children; $result['children'][0]['hidden_comments_num'] = $total_children;
$result['children'][0]['hidden_comments_text'] = L10n::tt('comment', 'comments', $total_children); $result['children'][0]['hidden_comments_text'] = L10n::tt('comment', 'comments', $total_children);
$result['children'][0]['hide_text'] = t('show more'); $result['children'][0]['hide_text'] = L10n::t('show more');
if ($thread_level > 1) { if ($thread_level > 1) {
$result['children'][$nb_children - 1]['comment_lastcollapsed'] = true; $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
} else { } else {
@ -787,21 +787,21 @@ class Post extends BaseObject
'$qcomment' => $qcomment, '$qcomment' => $qcomment,
'$profile_uid' => $uid, '$profile_uid' => $uid,
'$mylink' => $a->remove_baseurl($a->contact['url']), '$mylink' => $a->remove_baseurl($a->contact['url']),
'$mytitle' => t('This is you'), '$mytitle' => L10n::t('This is you'),
'$myphoto' => $a->remove_baseurl($a->contact['thumb']), '$myphoto' => $a->remove_baseurl($a->contact['thumb']),
'$comment' => t('Comment'), '$comment' => L10n::t('Comment'),
'$submit' => t('Submit'), '$submit' => L10n::t('Submit'),
'$edbold' => t('Bold'), '$edbold' => L10n::t('Bold'),
'$editalic' => t('Italic'), '$editalic' => L10n::t('Italic'),
'$eduline' => t('Underline'), '$eduline' => L10n::t('Underline'),
'$edquote' => t('Quote'), '$edquote' => L10n::t('Quote'),
'$edcode' => t('Code'), '$edcode' => L10n::t('Code'),
'$edimg' => t('Image'), '$edimg' => L10n::t('Image'),
'$edurl' => t('Link'), '$edurl' => L10n::t('Link'),
'$edvideo' => t('Video'), '$edvideo' => L10n::t('Video'),
'$preview' => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? t('Preview') : ''), '$preview' => ((Feature::isEnabled($conv->getProfileOwner(), 'preview')) ? L10n::t('Preview') : ''),
'$indent' => $indent, '$indent' => $indent,
'$sourceapp' => t($a->sourcename), '$sourceapp' => L10n::t($a->sourcename),
'$ww' => $conv->getMode() === 'network' ? $ww : '', '$ww' => $conv->getMode() === 'network' ? $ww : '',
'$rand_num' => random_digits(12) '$rand_num' => random_digits(12)
]); ]);

View file

@ -7,6 +7,7 @@ namespace Friendica\Protocol;
use Friendica\App; use Friendica\App;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -1258,9 +1259,9 @@ class OStatus
$root->setAttribute("xmlns:mastodon", NAMESPACE_MASTODON); $root->setAttribute("xmlns:mastodon", NAMESPACE_MASTODON);
switch ($filter) { switch ($filter) {
case 'activity': $title = t('%s\'s timeline', $owner['name']); break; case 'activity': $title = L10n::t('%s\'s timeline', $owner['name']); break;
case 'posts' : $title = t('%s\'s posts' , $owner['name']); break; case 'posts' : $title = L10n::t('%s\'s posts' , $owner['name']); break;
case 'comments': $title = t('%s\'s comments', $owner['name']); break; case 'comments': $title = L10n::t('%s\'s comments', $owner['name']); break;
} }
$attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION]; $attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION];
@ -1787,12 +1788,12 @@ class OStatus
} }
if ($item['verb'] == ACTIVITY_FOLLOW) { if ($item['verb'] == ACTIVITY_FOLLOW) {
$message = t('%s is now following %s.'); $message = L10n::t('%s is now following %s.');
$title = t('following'); $title = L10n::t('following');
$action = "subscription"; $action = "subscription";
} else { } else {
$message = t('%s stopped following %s.'); $message = L10n::t('%s stopped following %s.');
$title = t('stopped following'); $title = L10n::t('stopped following');
$action = "unfollow"; $action = "unfollow";
} }

View file

@ -7,6 +7,7 @@ namespace Friendica\Worker;
use Friendica\App; use Friendica\App;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Queue; use Friendica\Model\Queue;
@ -388,7 +389,7 @@ class Delivery {
$reply_to = $r1[0]['reply_to']; $reply_to = $r1[0]['reply_to'];
} }
$subject = (($it['title']) ? Email::encodeHeader($it['title'],'UTF-8') : t("\x28no subject\x29")) ; $subject = (($it['title']) ? Email::encodeHeader($it['title'],'UTF-8') : L10n::t("\x28no subject\x29")) ;
// only expose our real email address to true friends // only expose our real email address to true friends
@ -400,7 +401,7 @@ class Delivery {
$headers = 'From: '.Email::encodeHeader($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n"; $headers = 'From: '.Email::encodeHeader($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n";
} }
} else { } else {
$headers = 'From: '. Email::encodeHeader($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n"; $headers = 'From: '. Email::encodeHeader($local_user[0]['username'],'UTF-8') .' <'. L10n::t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
} }
//if ($reply_to) //if ($reply_to)