Browse Source

Finish t() for src

Update t() calls in src folder
pull/4312/head
Adam Magness 3 years ago
parent
commit
07d306aa37
19 changed files with 392 additions and 384 deletions
  1. +7
    -4
      src/App.php
  2. +27
    -26
      src/Content/ContactSelector.php
  3. +31
    -30
      src/Content/Feature.php
  4. +4
    -3
      src/Content/ForumManager.php
  5. +43
    -42
      src/Content/Nav.php
  6. +3
    -4
      src/Content/OEmbed.php
  7. +21
    -21
      src/Content/Widget.php
  8. +17
    -18
      src/Core/NotificationsManager.php
  9. +11
    -10
      src/Database/DBStructure.php
  10. +29
    -28
      src/Model/Contact.php
  11. +10
    -11
      src/Model/Group.php
  12. +3
    -2
      src/Model/Mail.php
  13. +77
    -78
      src/Model/Profile.php
  14. +33
    -34
      src/Model/User.php
  15. +15
    -15
      src/Module/Login.php
  16. +5
    -4
      src/Object/Image.php
  17. +45
    -45
      src/Object/Post.php
  18. +8
    -7
      src/Protocol/OStatus.php
  19. +3
    -2
      src/Worker/Delivery.php

+ 7
- 4
src/App.php View File

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


+ 27
- 26
src/Content/ContactSelector.php View File

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


+ 31
- 30
src/Content/Feature.php View File

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


+ 4
- 3
src/Content/ForumManager.php View File

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


+ 43
- 42
src/Content/Nav.php View File

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


+ 3
- 4
src/Content/OEmbed.php View File

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


+ 21
- 21
src/Content/Widget.php View File

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


+ 17
- 18
src/Core/NotificationsManager.php View File

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


+ 11
- 10
src/Database/DBStructure.php View File

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


+ 29
- 28
src/Model/Contact.php View File

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


+ 10
- 11
src/Model/Group.php View File

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


+ 3
- 2
src/Model/Mail.php View File

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


+ 77
- 78
src/Model/Profile.php View File

@ -2,7 +2,6 @@
/**
* @file src/Model/Profile.php
*/
namespace Friendica\Model;
use Friendica\App;
@ -163,7 +162,7 @@ class Profile
$a->page['aside'] .= replace_macros(
get_markup_template('profile_edlink.tpl'),
[
'$editprofile' => t('Edit profile'),
'$editprofile' => L10n::t('Edit profile'),
'$profid' => $a->profile['id']
]
);
@ -292,7 +291,7 @@ class Profile
// don't show connect link to yourself
$connect = $profile['uid'] != local_user() ? t('Connect') : false;
$connect = $profile['uid'] != local_user() ? L10n::t('Connect') : false;
// don't show connect link to authenticated visitors either
if (remote_user() && count($_SESSION['remote'])) {
@ -331,13 +330,13 @@ class Profile
}
if ($connect && ($profile['network'] == NETWORK_DFRN) && !isset($remoteconnect)) {
$subscribe_feed = t('Atom feed');
$subscribe_feed = L10n::t('Atom feed');
} else {
$subscribe_feed = false;
}
if (remote_user() || (self::getMyURL() && x($profile, 'unkmail') && ($profile['uid'] != local_user()))) {
$wallmessage = t('Message');
$wallmessage = L10n::t('Message');
$wallmessage_link = 'wallmessage/' . $profile['nickname'];
if (remote_user()) {
@ -367,15 +366,15 @@ class Profile
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) {
$profile['edit'] = [System::baseUrl() . '/profiles', t('Profiles'), '', t('Manage/edit profiles')];
$profile['edit'] = [System::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
$r = q(
"SELECT * FROM `profile` WHERE `uid` = %d",
local_user()
);
$profile['menu'] = [
'chg_photo' => t('Change profile photo'),
'cr_new' => t('Create New Profile'),
'chg_photo' => L10n::t('Change profile photo'),
'cr_new' => L10n::t('Create New Profile'),
'entries' => [],
];
@ -384,19 +383,19 @@ class Profile
$profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
'id' => $rr['id'],
'alt' => t('Profile Image'),
'alt' => L10n::t('Profile Image'),
'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'],
'visibile_to_everybody' => t('visible to everybody'),
'edit_visibility' => t('Edit visibility'),
'visibile_to_everybody' => L10n::t('visible to everybody'),
'edit_visibility' => L10n::t('Edit visibility'),
];
}
}
}
if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) {
$profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], t('Edit profile'), '', t('Edit profile')];
$profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
$profile['menu'] = [
'chg_photo' => t('Change profile photo'),
'chg_photo' => L10n::t('Change profile photo'),
'cr_new' => null,
'entries' => [],
];
@ -412,14 +411,14 @@ class Profile
|| x($profile, 'postal-code')
|| x($profile, 'country-name')
) {
$location = t('Location:');
$location = L10n::t('Location:');
}
$gender = x($profile, 'gender') ? t('Gender:') : false;
$marital = x($profile, 'marital') ? t('Status:') : false;
$homepage = x($profile, 'homepage') ? t('Homepage:') : false;
$about = x($profile, 'about') ? t('About:') : false;
$xmpp = x($profile, 'xmpp') ? t('XMPP:') : false;
$gender = x($profile, 'gender') ? L10n::t('Gender:') : false;
$marital = x($profile, 'marital') ? L10n::t('Status:') : false;
$homepage = x($profile, 'homepage') ? L10n::t('Homepage:') : false;
$about = x($profile, 'about') ? L10n::t('About:') : false;
$xmpp = x($profile, 'xmpp') ? L10n::t('XMPP:') : false;
if ((x($profile, 'hidewall') || $block) && !local_user() && !remote_user()) {
$location = $gender = $marital = $homepage = $about = false;
@ -513,7 +512,7 @@ class Profile
'$marital' => $marital,
'$homepage' => $homepage,
'$about' => $about,
'$network' => t('Network:'),
'$network' => L10n::t('Network:'),
'$contacts' => $contacts,
'$updated' => $updated,
'$diaspora' => $diaspora,
@ -543,8 +542,8 @@ class Profile
* return $o;
*/
$bd_format = t('g A l F d'); // 8 AM Friday January 18
$bd_short = t('F d');
$bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
$bd_short = L10n::t('F d');
$cachekey = 'get_birthdays:' . local_user();
$r = Cache::get($cachekey);
@ -599,7 +598,7 @@ class Profile
$rr['link'] = $url;
$rr['title'] = $rr['name'];
$rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . t('[today]') : '');
$rr['date'] = day_translate(datetime_convert('UTC', $a->timezone, $rr['start'], $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = null;
$rr['today'] = $today;
}
@ -610,8 +609,8 @@ class Profile
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => $total,
'$event_reminders' => t('Birthday Reminders'),
'$event_title' => t('Birthdays this week:'),
'$event_reminders' => L10n::t('Birthday Reminders'),
'$event_title' => L10n::t('Birthdays this week:'),
'$events' => $r,
'$lbr' => '{', // raw brackets mess up if/endif macro processing
'$rbr' => '}'
@ -635,7 +634,7 @@ class Profile
* return $o;
*/
$bd_format = t('g A l F d'); // 8 AM Friday January 18
$bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
$classtoday = '';
$s = dba::p(
@ -670,7 +669,7 @@ class Profile
$description = substr(strip_tags(bbcode($rr['desc'])), 0, 32) . '... ';
if (!$description) {
$description = t('[No description]');
$description = L10n::t('[No description]');
}
$strt = datetime_convert('UTC', $rr['convert'] ? $a->timezone : 'UTC', $rr['start']);
@ -683,7 +682,7 @@ class Profile
$rr['title'] = $title;
$rr['description'] = $description;
$rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : '');
$rr['date'] = day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = $strt;
$rr['today'] = $today;
@ -697,8 +696,8 @@ class Profile
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => count($r),
'$event_reminders' => t('Event Reminders'),
'$event_title' => t('Events this week:'),
'$event_reminders' => L10n::t('Event Reminders'),
'$event_title' => L10n::t('Events this week:'),
'$events' => $r,
]);
}
@ -710,7 +709,7 @@ class Profile
$o .= replace_macros(
get_markup_template('section_title.tpl'),