]> git.mxchange.org Git - friendica.git/commitdiff
Move L10n::t() calls to DI::l10n()->t() calls
authornupplaPhil <admin@philipp.info>
Sat, 18 Jan 2020 19:52:34 +0000 (20:52 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 19 Jan 2020 15:31:16 +0000 (16:31 +0100)
175 files changed:
doc/smarty3-templates.md
doc/themes.md
doc/translations.md
include/api.php
include/conversation.php
include/items.php
mod/api.php
mod/cal.php
mod/common.php
mod/community.php
mod/crepair.php
mod/dfrn_confirm.php
mod/dfrn_poll.php
mod/dfrn_request.php
mod/display.php
mod/editpost.php
mod/events.php
mod/fbrowser.php
mod/follow.php
mod/fsuggest.php
mod/item.php
mod/lockview.php
mod/lostpass.php
mod/match.php
mod/message.php
mod/network.php
mod/notes.php
mod/notifications.php
mod/oexchange.php
mod/ostatus_subscribe.php
mod/photos.php
mod/ping.php
mod/poke.php
mod/profile_photo.php
mod/profiles.php
mod/profperm.php
mod/redir.php
mod/regmod.php
mod/removeme.php
mod/repair_ostatus.php
mod/settings.php
mod/subthread.php
mod/suggest.php
mod/tagger.php
mod/tagrm.php
mod/uimport.php
mod/unfollow.php
mod/update_community.php
mod/update_contact.php
mod/update_display.php
mod/update_network.php
mod/update_notes.php
mod/update_profile.php
mod/videos.php
mod/wall_attach.php
mod/wall_upload.php
mod/wallmessage.php
src/App/Router.php
src/BaseModule.php
src/Console/ArchiveContact.php
src/Content/ContactSelector.php
src/Content/Feature.php
src/Content/ForumManager.php
src/Content/Nav.php
src/Content/OEmbed.php
src/Content/Pager.php
src/Content/Text/BBCode.php
src/Content/Text/HTML.php
src/Content/Widget.php
src/Content/Widget/CalendarExport.php
src/Content/Widget/ContactBlock.php
src/Content/Widget/SavedSearches.php
src/Content/Widget/TagCloud.php
src/Content/Widget/TrendingTags.php
src/Core/ACL.php
src/Core/Installer.php
src/Core/L10n.php
src/Core/L10n/L10n.php
src/Core/Update.php
src/Core/UserImport.php
src/Database/DBStructure.php
src/LegacyModule.php
src/Model/Contact.php
src/Model/Event.php
src/Model/FileTag.php
src/Model/Group.php
src/Model/Item.php
src/Model/Mail.php
src/Model/Photo.php
src/Model/Profile.php
src/Model/User.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Blocklist/Contact.php
src/Module/Admin/Blocklist/Server.php
src/Module/Admin/DBSync.php
src/Module/Admin/Features.php
src/Module/Admin/Federation.php
src/Module/Admin/Item/Delete.php
src/Module/Admin/Item/Source.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Logs/View.php
src/Module/Admin/Queue.php
src/Module/Admin/Site.php
src/Module/Admin/Summary.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Admin/Tos.php
src/Module/Admin/Users.php
src/Module/AllFriends.php
src/Module/Apps.php
src/Module/Attach.php
src/Module/Base/Api.php
src/Module/BaseAdminModule.php
src/Module/BaseSearchModule.php
src/Module/BaseSettingsModule.php
src/Module/Bookmarklet.php
src/Module/Contact.php
src/Module/Credits.php
src/Module/Debug/Babel.php
src/Module/Debug/Feed.php
src/Module/Debug/ItemBody.php
src/Module/Debug/Localtime.php
src/Module/Debug/Probe.php
src/Module/Debug/WebFinger.php
src/Module/Delegation.php
src/Module/Directory.php
src/Module/Filer/SaveTag.php
src/Module/FollowConfirm.php
src/Module/Friendica.php
src/Module/Group.php
src/Module/HTTPException/MethodNotAllowed.php
src/Module/HTTPException/PageNotFound.php
src/Module/Help.php
src/Module/Home.php
src/Module/Install.php
src/Module/Invite.php
src/Module/Item/Compose.php
src/Module/Maintenance.php
src/Module/Notifications/Notify.php
src/Module/Photo.php
src/Module/Profile.php
src/Module/Profile/Contacts.php
src/Module/Register.php
src/Module/Search/Acl.php
src/Module/Search/Directory.php
src/Module/Search/Index.php
src/Module/Search/Saved.php
src/Module/Security/Login.php
src/Module/Security/TwoFactor/Recovery.php
src/Module/Security/TwoFactor/Verify.php
src/Module/Settings/Delegation.php
src/Module/Settings/TwoFactor/AppSpecific.php
src/Module/Settings/TwoFactor/Index.php
src/Module/Settings/TwoFactor/Recovery.php
src/Module/Settings/TwoFactor/Verify.php
src/Module/Settings/UserExport.php
src/Module/Special/HTTPException.php
src/Module/Tos.php
src/Module/Welcome.php
src/Object/Post.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php
src/Util/Temporal.php
src/Worker/Delivery.php
tests/src/Core/InstallerTest.php
update.php
view/theme/duepuntozero/config.php
view/theme/frio/config.php
view/theme/frio/php/Image.php
view/theme/frio/theme.php
view/theme/quattro/config.php
view/theme/vier/config.php
view/theme/vier/theme.php

index 1fadcb22148374ce69b12027a88e18e90d29e1ff..27e2a023057cfdda77b56ff808d274ebcc411f97 100644 (file)
@@ -39,7 +39,7 @@ They are initialized with an array of data, depending on the tyle of the field.
 
 All of these take an array holding the values, e.g. for a one line text input field, which is required and should be used to type email addesses use something along the lines of:
 
-               '$adminmail' => array('adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
+               '$adminmail' => array('adminmail', DI::l10n()->t('Site administrator email address'), $adminmail, DI::l10n()->t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
 
 To evaluate the input value, you can then use the $_POST array, more precisely the $_POST['adminemail'] variable.
 
index 577d6a5da9edbdedaabb07b14d9745a1baf4bf0a..f50ea791da08fefde2293747724f345a47e2612a 100644 (file)
@@ -108,17 +108,17 @@ The _post functions handle the processing of the send form, in this case they sa
 To make your own variation appear in the menu, all you need to do is to create a new CSS file in the deriv directoy and include it in the array in the config.php:
 
     $colorset = array(
-        'default'=>L10n::t('default'),
-        'greenzero'=>L10n::t('greenzero'),
-        'purplezero'=>L10n::t('purplezero'),
-        'easterbunny'=>L10n::t('easterbunny'),
-        'darkzero'=>L10n::t('darkzero'),
-        'comix'=>L10n::t('comix'),
-        'slackr'=>L10n::t('slackr'),
+        'default'=>DI::l10n()->t('default'),
+        'greenzero'=>DI::l10n()->t('greenzero'),
+        'purplezero'=>DI::l10n()->t('purplezero'),
+        'easterbunny'=>DI::l10n()->t('easterbunny'),
+        'darkzero'=>DI::l10n()->t('darkzero'),
+        'comix'=>DI::l10n()->t('comix'),
+        'slackr'=>DI::l10n()->t('slackr'),
     );
 
 the 1st part of the line is the name of the CSS file (without the .css) the 2nd part is the common name of the variant.
-Calling the L10n::t() function with the common name makes the string translateable.
+Calling the DI::l10n()->t() function with the common name makes the string translateable.
 The selected 1st part will be saved in the database by the theme_post function.
 
     function theme_post(App $a){
index 9ecd8f6d4978415b612803cd445c8be553067c9c..c1bd3ce88f68d321a600489c72c7e5ff1dd1e101 100644 (file)
@@ -73,8 +73,8 @@ Then run `bin/console po2php view/lang/<language>/messages.po` to update the rel
 
 ### Basic usage
 
-- `Friendica\Core\L10n::t('Label')` => `Label`
-- `Friendica\Core\L10n::t('Label %s', 'test')` => `Label test`
+- `Friendica\Core\DI::l10n()->t('Label')` => `Label`
+- `Friendica\Core\DI::l10n()->t('Label %s', 'test')` => `Label test`
 
 ### Plural
 
index e4464a2c72c6e283ecdcb07dc55ac1435c92f1cc..ab12d42bf3c75ee7c0b8617afa50174ee701997d 100644 (file)
@@ -1106,7 +1106,7 @@ function api_statuses_update($type)
 
                        if ($posts_day > $throttle_day) {
                                Logger::log('Daily posting limit reached for user '.api_user(), Logger::DEBUG);
-                               // die(api_error($type, L10n::t("Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
+                               // die(api_error($type, DI::l10n()->t("Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
                                throw new TooManyRequestsException(L10n::tt("Daily posting limit of %d post reached. The post was rejected.", "Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
                        }
                }
@@ -1120,7 +1120,7 @@ function api_statuses_update($type)
 
                        if ($posts_week > $throttle_week) {
                                Logger::log('Weekly posting limit reached for user '.api_user(), Logger::DEBUG);
-                               // die(api_error($type, L10n::t("Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week)));
+                               // die(api_error($type, DI::l10n()->t("Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week)));
                                throw new TooManyRequestsException(L10n::tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week));
                        }
                }
@@ -1134,8 +1134,8 @@ function api_statuses_update($type)
 
                        if ($posts_month > $throttle_month) {
                                Logger::log('Monthly posting limit reached for user '.api_user(), Logger::DEBUG);
-                               // die(api_error($type, L10n::t("Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
-                               throw new TooManyRequestsException(L10n::t("Monthly posting limit of %d post reached. The post was rejected.", "Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
+                               // die(api_error($type, DI::l10n()->t("Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
+                               throw new TooManyRequestsException(DI::l10n()->t("Monthly posting limit of %d post reached. The post was rejected.", "Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
                        }
                }
        }
@@ -4598,7 +4598,7 @@ function api_account_update_profile_image($type)
                $media = $_FILES['media'];
        }
        // save new profile image
-       $data = save_media_to_database("profileimage", $media, $type, L10n::t('Profile Photos'), "", "", "", "", "", $is_default_profile);
+       $data = save_media_to_database("profileimage", $media, $type, DI::l10n()->t('Profile Photos'), "", "", "", "", "", $is_default_profile);
 
        // get filetype
        if (is_array($media['type'])) {
index 990c72e05ac7dbfba4c1fbd7153373e8e7720994..d09c918d1501019972d2292dfbae851c2c1d790b 100644 (file)
@@ -160,20 +160,20 @@ function localize_item(&$item)
                        case Activity::POST:
                                switch ($obj['object-type']) {
                                        case Activity\ObjectType::EVENT:
-                                               $post_type = L10n::t('event');
+                                               $post_type = DI::l10n()->t('event');
                                                break;
                                        default:
-                                               $post_type = L10n::t('status');
+                                               $post_type = DI::l10n()->t('status');
                                }
                                break;
                        default:
                                if ($obj['resource-id']) {
-                                       $post_type = L10n::t('photo');
+                                       $post_type = DI::l10n()->t('photo');
                                        $m = [];
                                        preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
                                        $rr['plink'] = $m[1];
                                } else {
-                                       $post_type = L10n::t('status');
+                                       $post_type = DI::l10n()->t('status');
                                }
                }
 
@@ -181,15 +181,15 @@ function localize_item(&$item)
 
                $bodyverb = '';
                if ($activity->match($item['verb'], Activity::LIKE)) {
-                       $bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
+                       $bodyverb = DI::l10n()->t('%1$s likes %2$s\'s %3$s');
                } elseif ($activity->match($item['verb'], Activity::DISLIKE)) {
-                       $bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
+                       $bodyverb = DI::l10n()->t('%1$s doesn\'t like %2$s\'s %3$s');
                } elseif ($activity->match($item['verb'], Activity::ATTEND)) {
-                       $bodyverb = L10n::t('%1$s attends %2$s\'s %3$s');
+                       $bodyverb = DI::l10n()->t('%1$s attends %2$s\'s %3$s');
                } elseif ($activity->match($item['verb'], Activity::ATTENDNO)) {
-                       $bodyverb = L10n::t('%1$s doesn\'t attend %2$s\'s %3$s');
+                       $bodyverb = DI::l10n()->t('%1$s doesn\'t attend %2$s\'s %3$s');
                } elseif ($activity->match($item['verb'], Activity::ATTENDMAYBE)) {
-                       $bodyverb = L10n::t('%1$s attends maybe %2$s\'s %3$s');
+                       $bodyverb = DI::l10n()->t('%1$s attends maybe %2$s\'s %3$s');
                }
 
                $item['body'] = sprintf($bodyverb, $author, $objauthor, $plink);
@@ -224,7 +224,7 @@ function localize_item(&$item)
                        $Bphoto = '[url=' . Contact::magicLink($Blink) . '][img]' . $Bphoto . '[/img][/url]';
                }
 
-               $item['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B)."\n\n\n".$Bphoto;
+               $item['body'] = DI::l10n()->t('%1$s is now friends with %2$s', $A, $B)."\n\n\n".$Bphoto;
 
        }
        if (stristr($item['verb'], Activity::POKE)) {
@@ -265,11 +265,11 @@ function localize_item(&$item)
                 * we can't have a translation string with three positions but no distinguishable text
                 * So here is the translate string.
                 */
-               $txt = L10n::t('%1$s poked %2$s');
+               $txt = DI::l10n()->t('%1$s poked %2$s');
 
                // now translate the verb
                $poked_t = trim(sprintf($txt, "", ""));
-               $txt = str_replace($poked_t, L10n::t($verb), $txt);
+               $txt = str_replace($poked_t, DI::l10n()->t($verb), $txt);
 
                // then do the sprintf on the translation string
 
@@ -297,19 +297,19 @@ function localize_item(&$item)
                        case Activity::POST:
                                switch ($obj['object-type']) {
                                        case Activity\ObjectType::EVENT:
-                                               $post_type = L10n::t('event');
+                                               $post_type = DI::l10n()->t('event');
                                                break;
                                        default:
-                                               $post_type = L10n::t('status');
+                                               $post_type = DI::l10n()->t('status');
                                }
                                break;
                        default:
                                if ($obj['resource-id']) {
-                                       $post_type = L10n::t('photo');
+                                       $post_type = DI::l10n()->t('photo');
                                        $m=[]; preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
                                        $rr['plink'] = $m[1];
                                } else {
-                                       $post_type = L10n::t('status');
+                                       $post_type = DI::l10n()->t('status');
                                }
                                // Let's break everthing ... ;-)
                                break;
@@ -319,7 +319,7 @@ function localize_item(&$item)
                $parsedobj = XML::parseString($xmlhead.$item['object']);
 
                $tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content);
-               $item['body'] = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag);
+               $item['body'] = DI::l10n()->t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag);
        }
 
        if ($activity->match($item['verb'], Activity::FAVORITE)) {
@@ -341,8 +341,8 @@ function localize_item(&$item)
                                $Blink = $target['author-link'];
                                $A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
                                $B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]';
-                               $P = '[url=' . $target['plink'] . ']' . L10n::t('post/item') . '[/url]';
-                               $item['body'] = L10n::t('%1$s marked %2$s\'s %3$s as favorite', $A, $B, $P)."\n";
+                               $P = '[url=' . $target['plink'] . ']' . DI::l10n()->t('post/item') . '[/url]';
+                               $item['body'] = DI::l10n()->t('%1$s marked %2$s\'s %3$s as favorite', $A, $B, $P)."\n";
                        }
                }
        }
@@ -566,12 +566,12 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
        $items = $cb['items'];
 
        $conv_responses = [
-               'like' => ['title' => L10n::t('Likes','title')],
-               'dislike' => ['title' => L10n::t('Dislikes','title')],
-               'attendyes' => ['title' => L10n::t('Attending','title')],
-               'attendno' => ['title' => L10n::t('Not attending','title')],
-               'attendmaybe' => ['title' => L10n::t('Might attend','title')],
-               'announce' => ['title' => L10n::t('Reshares','title')]
+               'like' => ['title' => DI::l10n()->t('Likes','title')],
+               'dislike' => ['title' => DI::l10n()->t('Dislikes','title')],
+               'attendyes' => ['title' => DI::l10n()->t('Attending','title')],
+               'attendno' => ['title' => DI::l10n()->t('Not attending','title')],
+               'attendmaybe' => ['title' => DI::l10n()->t('Might attend','title')],
+               'announce' => ['title' => DI::l10n()->t('Reshares','title')]
        ];
 
        // array with html for each thread (parent+comments)
@@ -651,8 +651,8 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                                $drop = [
                                        'dropping' => $dropping,
                                        'pagedrop' => $page_dropping,
-                                       'select' => L10n::t('Select'),
-                                       'delete' => L10n::t('Delete'),
+                                       'select' => DI::l10n()->t('Select'),
+                                       'delete' => DI::l10n()->t('Delete'),
                                ];
 
                                $star = false;
@@ -678,7 +678,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                                        'network' => $item['network'],
                                        'network_name' => ContactSelector::networkToName($item['author-network'], $item['author-link'], $item['network']),
                                        'network_icon' => ContactSelector::networkToIcon($item['network'], $item['author-link']),
-                                       'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
+                                       'linktitle' => DI::l10n()->t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
                                        'profile_url' => $profile_link,
                                        'item_photo_menu' => item_photo_menu($item),
                                        'name' => $profile_name,
@@ -691,15 +691,15 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                                        'hashtags' => $tags['hashtags'],
                                        'mentions' => $tags['mentions'],
                                        'implicit_mentions' => $tags['implicit_mentions'],
-                                       'txt_cats' => L10n::t('Categories:'),
-                                       'txt_folders' => L10n::t('Filed under:'),
+                                       'txt_cats' => DI::l10n()->t('Categories:'),
+                                       'txt_folders' => DI::l10n()->t('Filed under:'),
                                        'has_cats' => ((count($categories)) ? 'true' : ''),
                                        'has_folders' => ((count($folders)) ? 'true' : ''),
                                        'categories' => $categories,
                                        'folders' => $folders,
                                        'text' => strip_tags($body),
                                        'localtime' => DateTimeFormat::local($item['created'], 'r'),
-                                       'ago' => (($item['app']) ? L10n::t('%s from %s', Temporal::getRelativeDate($item['created']),$item['app']) : Temporal::getRelativeDate($item['created'])),
+                                       'ago' => (($item['app']) ? DI::l10n()->t('%s from %s', Temporal::getRelativeDate($item['created']),$item['app']) : Temporal::getRelativeDate($item['created'])),
                                        'location' => $location,
                                        'indent' => '',
                                        'owner_name' => $owner_name,
@@ -714,9 +714,9 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                                        'like' => '',
                                        'dislike' => '',
                                        'comment' => '',
-                                       'conv' => (($preview) ? '' : ['href'=> 'display/'.$item['guid'], 'title'=> L10n::t('View in context')]),
+                                       'conv' => (($preview) ? '' : ['href'=> 'display/'.$item['guid'], 'title'=> DI::l10n()->t('View in context')]),
                                        'previewing' => $previewing,
-                                       'wait' => L10n::t('Please wait'),
+                                       'wait' => DI::l10n()->t('Please wait'),
                                        'thread_level' => 1,
                                ];
 
@@ -780,11 +780,11 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
                '$baseurl' => DI::baseUrl()->get($ssl_state),
                '$return_path' => DI::args()->getQueryString(),
                '$live_update' => $live_update_div,
-               '$remove' => L10n::t('remove'),
+               '$remove' => DI::l10n()->t('remove'),
                '$mode' => $mode,
                '$user' => $a->user,
                '$threads' => $threads,
-               '$dropping' => ($page_dropping ? L10n::t('Delete Selected Items') : False),
+               '$dropping' => ($page_dropping ? DI::l10n()->t('Delete Selected Items') : False),
        ]);
 
        return $o;
@@ -945,27 +945,27 @@ function item_photo_menu($item) {
 
        if (local_user()) {
                $menu = [
-                       L10n::t('Follow Thread') => $sub_link,
-                       L10n::t('View Status') => $status_link,
-                       L10n::t('View Profile') => $profile_link,
-                       L10n::t('View Photos') => $photos_link,
-                       L10n::t('Network Posts') => $posts_link,
-                       L10n::t('View Contact') => $contact_url,
-                       L10n::t('Send PM') => $pm_url,
-                       L10n::t('Block') => $block_link,
-                       L10n::t('Ignore') => $ignore_link
+                       DI::l10n()->t('Follow Thread') => $sub_link,
+                       DI::l10n()->t('View Status') => $status_link,
+                       DI::l10n()->t('View Profile') => $profile_link,
+                       DI::l10n()->t('View Photos') => $photos_link,
+                       DI::l10n()->t('Network Posts') => $posts_link,
+                       DI::l10n()->t('View Contact') => $contact_url,
+                       DI::l10n()->t('Send PM') => $pm_url,
+                       DI::l10n()->t('Block') => $block_link,
+                       DI::l10n()->t('Ignore') => $ignore_link
                ];
 
                if ($network == Protocol::DFRN) {
-                       $menu[L10n::t("Poke")] = $poke_link;
+                       $menu[DI::l10n()->t("Poke")] = $poke_link;
                }
 
                if ((($cid == 0) || ($rel == Contact::FOLLOWER)) &&
                        in_array($item['network'], Protocol::FEDERATED)) {
-                       $menu[L10n::t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
+                       $menu[DI::l10n()->t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
                }
        } else {
-               $menu = [L10n::t('View Profile') => $item['author-link']];
+               $menu = [DI::l10n()->t('View Profile') => $item['author-link']];
        }
 
        $args = ['item' => $item, 'menu' => $menu];
@@ -1088,22 +1088,22 @@ function format_like($cnt, array $arr, $type, $id) {
                // list which show all likers
                switch ($type) {
                        case 'like' :
-                               $phrase = L10n::t('%s likes this.', $likers);
+                               $phrase = DI::l10n()->t('%s likes this.', $likers);
                                break;
                        case 'dislike' :
-                               $phrase = L10n::t('%s doesn\'t like this.', $likers);
+                               $phrase = DI::l10n()->t('%s doesn\'t like this.', $likers);
                                break;
                        case 'attendyes' :
-                               $phrase = L10n::t('%s attends.', $likers);
+                               $phrase = DI::l10n()->t('%s attends.', $likers);
                                break;
                        case 'attendno' :
-                               $phrase = L10n::t('%s doesn\'t attend.', $likers);
+                               $phrase = DI::l10n()->t('%s doesn\'t attend.', $likers);
                                break;
                        case 'attendmaybe' :
-                               $phrase = L10n::t('%s attends maybe.', $likers);
+                               $phrase = DI::l10n()->t('%s attends maybe.', $likers);
                                break;
                        case 'announce' :
-                               $phrase = L10n::t('%s reshared this.', $likers);
+                               $phrase = DI::l10n()->t('%s reshared this.', $likers);
                                break;
                }
        }
@@ -1111,13 +1111,13 @@ function format_like($cnt, array $arr, $type, $id) {
        if ($cnt > 1) {
                $total = count($arr);
                if ($total < MAX_LIKERS) {
-                       $last = L10n::t('and') . ' ' . $arr[count($arr)-1];
+                       $last = DI::l10n()->t('and') . ' ' . $arr[count($arr)-1];
                        $arr2 = array_slice($arr, 0, -1);
                        $likers = implode(', ', $arr2) . ' ' . $last;
                } else  {
                        $arr = array_slice($arr, 0, MAX_LIKERS - 1);
                        $likers = implode(', ', $arr);
-                       $likers .= L10n::t('and %d other people', $total - MAX_LIKERS);
+                       $likers .= DI::l10n()->t('and %d other people', $total - MAX_LIKERS);
                }
 
                $spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\"";
@@ -1125,28 +1125,28 @@ function format_like($cnt, array $arr, $type, $id) {
                $explikers = '';
                switch ($type) {
                        case 'like':
-                               $phrase = L10n::t('<span  %1$s>%2$d people</span> like this', $spanatts, $cnt);
-                               $explikers = L10n::t('%s like this.', $likers);
+                               $phrase = DI::l10n()->t('<span  %1$s>%2$d people</span> like this', $spanatts, $cnt);
+                               $explikers = DI::l10n()->t('%s like this.', $likers);
                                break;
                        case 'dislike':
-                               $phrase = L10n::t('<span  %1$s>%2$d people</span> don\'t like this', $spanatts, $cnt);
-                               $explikers = L10n::t('%s don\'t like this.', $likers);
+                               $phrase = DI::l10n()->t('<span  %1$s>%2$d people</span> don\'t like this', $spanatts, $cnt);
+                               $explikers = DI::l10n()->t('%s don\'t like this.', $likers);
                                break;
                        case 'attendyes':
-                               $phrase = L10n::t('<span  %1$s>%2$d people</span> attend', $spanatts, $cnt);
-                               $explikers = L10n::t('%s attend.', $likers);
+                               $phrase = DI::l10n()->t('<span  %1$s>%2$d people</span> attend', $spanatts, $cnt);
+                               $explikers = DI::l10n()->t('%s attend.', $likers);
                                break;
                        case 'attendno':
-                               $phrase = L10n::t('<span  %1$s>%2$d people</span> don\'t attend', $spanatts, $cnt);
-                               $explikers = L10n::t('%s don\'t attend.', $likers);
+                               $phrase = DI::l10n()->t('<span  %1$s>%2$d people</span> don\'t attend', $spanatts, $cnt);
+                               $explikers = DI::l10n()->t('%s don\'t attend.', $likers);
                                break;
                        case 'attendmaybe':
-                               $phrase = L10n::t('<span  %1$s>%2$d people</span> attend maybe', $spanatts, $cnt);
-                               $explikers = L10n::t('%s attend maybe.', $likers);
+                               $phrase = DI::l10n()->t('<span  %1$s>%2$d people</span> attend maybe', $spanatts, $cnt);
+                               $explikers = DI::l10n()->t('%s attend maybe.', $likers);
                                break;
                        case 'announce':
-                               $phrase = L10n::t('<span  %1$s>%2$d people</span> reshared this', $spanatts, $cnt);
-                               $explikers = L10n::t('%s reshared this.', $likers);
+                               $phrase = DI::l10n()->t('<span  %1$s>%2$d people</span> reshared this', $spanatts, $cnt);
+                               $explikers = DI::l10n()->t('%s reshared this.', $likers);
                                break;
                }
 
@@ -1175,12 +1175,12 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$baseurl'   => DI::baseUrl()->get(true),
                '$geotag'    => $geotag,
                '$nickname'  => $x['nickname'],
-               '$ispublic'  => L10n::t('Visible to <strong>everybody</strong>'),
-               '$linkurl'   => L10n::t('Please enter a image/video/audio/webpage URL:'),
-               '$term'      => L10n::t('Tag term:'),
-               '$fileas'    => L10n::t('Save to Folder:'),
-               '$whereareu' => L10n::t('Where are you right now?'),
-               '$delitems'  => L10n::t("Delete item\x28s\x29?")
+               '$ispublic'  => DI::l10n()->t('Visible to <strong>everybody</strong>'),
+               '$linkurl'   => DI::l10n()->t('Please enter a image/video/audio/webpage URL:'),
+               '$term'      => DI::l10n()->t('Tag term:'),
+               '$fileas'    => DI::l10n()->t('Save to Folder:'),
+               '$whereareu' => DI::l10n()->t('Where are you right now?'),
+               '$delitems'  => DI::l10n()->t("Delete item\x28s\x29?")
        ]);
 
        $jotplugins = '';
@@ -1212,33 +1212,33 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
        $tpl = Renderer::getMarkupTemplate("jot.tpl");
 
        $o .= Renderer::replaceMacros($tpl,[
-               '$new_post' => L10n::t('New Post'),
+               '$new_post' => DI::l10n()->t('New Post'),
                '$return_path'  => $query_str,
                '$action'       => 'item',
-               '$share'        => ($x['button'] ?? '') ?: L10n::t('Share'),
-               '$upload'       => L10n::t('Upload photo'),
-               '$shortupload'  => L10n::t('upload photo'),
-               '$attach'       => L10n::t('Attach file'),
-               '$shortattach'  => L10n::t('attach file'),
-               '$edbold'       => L10n::t('Bold'),
-               '$editalic'     => L10n::t('Italic'),
-               '$eduline'      => L10n::t('Underline'),
-               '$edquote'      => L10n::t('Quote'),
-               '$edcode'       => L10n::t('Code'),
-               '$edimg'        => L10n::t('Image'),
-               '$edurl'        => L10n::t('Link'),
-               '$edattach'     => L10n::t('Link or Media'),
-               '$setloc'       => L10n::t('Set your location'),
-               '$shortsetloc'  => L10n::t('set location'),
-               '$noloc'        => L10n::t('Clear browser location'),
-               '$shortnoloc'   => L10n::t('clear location'),
+               '$share'        => ($x['button'] ?? '') ?: DI::l10n()->t('Share'),
+               '$upload'       => DI::l10n()->t('Upload photo'),
+               '$shortupload'  => DI::l10n()->t('upload photo'),
+               '$attach'       => DI::l10n()->t('Attach file'),
+               '$shortattach'  => DI::l10n()->t('attach file'),
+               '$edbold'       => DI::l10n()->t('Bold'),
+               '$editalic'     => DI::l10n()->t('Italic'),
+               '$eduline'      => DI::l10n()->t('Underline'),
+               '$edquote'      => DI::l10n()->t('Quote'),
+               '$edcode'       => DI::l10n()->t('Code'),
+               '$edimg'        => DI::l10n()->t('Image'),
+               '$edurl'        => DI::l10n()->t('Link'),
+               '$edattach'     => DI::l10n()->t('Link or Media'),
+               '$setloc'       => DI::l10n()->t('Set your location'),
+               '$shortsetloc'  => DI::l10n()->t('set location'),
+               '$noloc'        => DI::l10n()->t('Clear browser location'),
+               '$shortnoloc'   => DI::l10n()->t('clear location'),
                '$title'        => $x['title'] ?? '',
-               '$placeholdertitle' => L10n::t('Set title'),
+               '$placeholdertitle' => DI::l10n()->t('Set title'),
                '$category'     => $x['category'] ?? '',
-               '$placeholdercategory' => Feature::isEnabled(local_user(), 'categories') ? L10n::t("Categories \x28comma-separated list\x29") : '',
-               '$wait'         => L10n::t('Please wait'),
-               '$permset'      => L10n::t('Permission settings'),
-               '$shortpermset' => L10n::t('permissions'),
+               '$placeholdercategory' => Feature::isEnabled(local_user(), 'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : '',
+               '$wait'         => DI::l10n()->t('Please wait'),
+               '$permset'      => DI::l10n()->t('Permission settings'),
+               '$shortpermset' => DI::l10n()->t('permissions'),
                '$wall'         => $notes_cid ? 0 : 1,
                '$posttype'     => $notes_cid ? Item::PT_PERSONAL_NOTE : Item::PT_ARTICLE,
                '$content'      => $x['content'] ?? '',
@@ -1247,28 +1247,28 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
                '$defloc'       => $x['default_location'],
                '$visitor'      => $x['visitor'],
                '$pvisit'       => $notes_cid ? 'none' : $x['visitor'],
-               '$public'       => L10n::t('Public post'),
+               '$public'       => DI::l10n()->t('Public post'),
                '$lockstate'    => $x['lockstate'],
                '$bang'         => $x['bang'],
                '$profile_uid'  => $x['profile_uid'],
-               '$preview'      => L10n::t('Preview'),
+               '$preview'      => DI::l10n()->t('Preview'),
                '$jotplugins'   => $jotplugins,
                '$notes_cid'    => $notes_cid,
-               '$sourceapp'    => L10n::t($a->sourcename),
-               '$cancel'       => L10n::t('Cancel'),
+               '$sourceapp'    => DI::l10n()->t($a->sourcename),
+               '$cancel'       => DI::l10n()->t('Cancel'),
                '$rand_num'     => Crypto::randomDigits(12),
 
                // ACL permissions box
                '$acl'           => $x['acl'],
-               '$group_perms'   => L10n::t('Post to Groups'),
-               '$contact_perms' => L10n::t('Post to Contacts'),
-               '$private'       => L10n::t('Private post'),
+               '$group_perms'   => DI::l10n()->t('Post to Groups'),
+               '$contact_perms' => DI::l10n()->t('Post to Contacts'),
+               '$private'       => DI::l10n()->t('Private post'),
                '$is_private'    => $private_post,
                '$public_link'   => $public_post_link,
 
                //jot nav tab (used in some themes)
-               '$message' => L10n::t('Message'),
-               '$browser' => L10n::t('Browser'),
+               '$message' => DI::l10n()->t('Message'),
+               '$browser' => DI::l10n()->t('Browser'),
        ]);
 
 
@@ -1557,7 +1557,7 @@ function get_responses(array $conv_responses, array $response_verbs, array $item
                if (count($ret[$v]['list']) > MAX_LIKERS) {
                        $ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS);
                        array_push($ret[$v]['list_part'], '<a href="#" data-toggle="modal" data-target="#' . $v . 'Modal-'
-                               . (($ob) ? $ob->getId() : $item['id']) . '"><b>' . L10n::t('View all') . '</b></a>');
+                               . (($ob) ? $ob->getId() : $item['id']) . '"><b>' . DI::l10n()->t('View all') . '</b></a>');
                } else {
                        $ret[$v]['list_part'] = '';
                }
index 91165344af8602540ee5d86bcfa7e0db8f362f23..a78588e9f859532d018b9008825db9c1f923c765 100644 (file)
@@ -347,7 +347,7 @@ function drop_item($id, $return = '')
        $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
 
        if (!DBA::isResult($item)) {
-               notice(L10n::t('Item not found.') . EOL);
+               notice(DI::l10n()->t('Item not found.') . EOL);
                DI::baseUrl()->redirect('network');
        }
 
@@ -379,12 +379,12 @@ function drop_item($id, $return = '')
 
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'get',
-                               '$message' => L10n::t('Do you really want to delete this item?'),
+                               '$message' => DI::l10n()->t('Do you really want to delete this item?'),
                                '$extra_inputs' => $inputs,
-                               '$confirm' => L10n::t('Yes'),
+                               '$confirm' => DI::l10n()->t('Yes'),
                                '$confirm_url' => $query['base'],
                                '$confirm_name' => 'confirmed',
-                               '$cancel' => L10n::t('Cancel'),
+                               '$cancel' => DI::l10n()->t('Cancel'),
                        ]);
                }
                // Now check how the user responded to the confirmation query
@@ -431,7 +431,7 @@ function drop_item($id, $return = '')
                        }
                }
        } else {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                DI::baseUrl()->redirect('display/' . $item['guid']);
                //NOTREACHED
        }
index 68308d3a621b018ad06ce884371512848c46f703..b0941c5589c8d4ef91f480919223d1e6815b31ef 100644 (file)
@@ -33,12 +33,12 @@ function oauth_get_client(OAuthRequest $request)
 function api_post(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
        if (count($a->user) && !empty($a->user['uid']) && $a->user['uid'] != local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 }
@@ -83,8 +83,8 @@ function api_content(App $a)
 
                        $tpl = Renderer::getMarkupTemplate("oauth_authorize_done.tpl");
                        $o = Renderer::replaceMacros($tpl, [
-                               '$title' => L10n::t('Authorize application connection'),
-                               '$info' => L10n::t('Return to your app and insert this Securty Code:'),
+                               '$title' => DI::l10n()->t('Authorize application connection'),
+                               '$info' => DI::l10n()->t('Return to your app and insert this Securty Code:'),
                                '$code' => $verifier,
                        ]);
 
@@ -93,7 +93,7 @@ function api_content(App $a)
 
                if (!local_user()) {
                        /// @TODO We need login form to redirect to this page
-                       notice(L10n::t('Please login to continue.') . EOL);
+                       notice(DI::l10n()->t('Please login to continue.') . EOL);
                        return Login::form(DI::args()->getQueryString(), false, $request->get_parameters());
                }
                //FKOAuth1::loginUser(4);
@@ -105,11 +105,11 @@ function api_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('oauth_authorize.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$title' => L10n::t('Authorize application connection'),
+                       '$title' => DI::l10n()->t('Authorize application connection'),
                        '$app' => $app,
-                       '$authorize' => L10n::t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
-                       '$yes' => L10n::t('Yes'),
-                       '$no' => L10n::t('No'),
+                       '$authorize' => DI::l10n()->t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
+                       '$yes' => DI::l10n()->t('Yes'),
+                       '$no' => DI::l10n()->t('No'),
                ]);
 
                return $o;
index 86a762af84997062c61c935a0dcd0c5cc2daebd8..6279bc24116b9ca2c0f84f61264c435417ed4fe5 100644 (file)
@@ -27,11 +27,11 @@ use Friendica\Util\Temporal;
 function cal_init(App $a)
 {
        if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
-               throw new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Access denied.'));
+               throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
        if ($a->argc < 2) {
-               throw new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Access denied.'));
+               throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
        Nav::setSelected('events');
@@ -126,7 +126,7 @@ function cal_content(App $a)
        $is_owner = local_user() == $a->profile['profile_uid'];
 
        if ($a->profile['hidewall'] && !$is_owner && !$remote_contact) {
-               notice(L10n::t('Access to this profile has been restricted.') . EOL);
+               notice(DI::l10n()->t('Access to this profile has been restricted.') . EOL);
                return;
        }
 
@@ -257,17 +257,17 @@ function cal_content(App $a)
 
                $o = Renderer::replaceMacros($tpl, [
                        '$tabs' => $tabs,
-                       '$title' => L10n::t('Events'),
-                       '$view' => L10n::t('View'),
-                       '$previous' => [DI::baseUrl() . "/events/$prevyear/$prevmonth", L10n::t('Previous'), '', ''],
-                       '$next' => [DI::baseUrl() . "/events/$nextyear/$nextmonth", L10n::t('Next'), '', ''],
+                       '$title' => DI::l10n()->t('Events'),
+                       '$view' => DI::l10n()->t('View'),
+                       '$previous' => [DI::baseUrl() . "/events/$prevyear/$prevmonth", DI::l10n()->t('Previous'), '', ''],
+                       '$next' => [DI::baseUrl() . "/events/$nextyear/$nextmonth", DI::l10n()->t('Next'), '', ''],
                        '$calendar' => Temporal::getCalendarTable($y, $m, $links, ' eventcal'),
                        '$events' => $events,
-                       "today" => L10n::t("today"),
-                       "month" => L10n::t("month"),
-                       "week" => L10n::t("week"),
-                       "day" => L10n::t("day"),
-                       "list" => L10n::t("list"),
+                       "today" => DI::l10n()->t("today"),
+                       "month" => DI::l10n()->t("month"),
+                       "week" => DI::l10n()->t("week"),
+                       "day" => DI::l10n()->t("day"),
+                       "list" => DI::l10n()->t("list"),
                ]);
 
                if (!empty($_GET['id'])) {
@@ -280,14 +280,14 @@ function cal_content(App $a)
 
        if ($mode == 'export') {
                if (!$owner_uid) {
-                       notice(L10n::t('User not found'));
+                       notice(DI::l10n()->t('User not found'));
                        return;
                }
 
                // Test permissions
                // Respect the export feature setting for all other /cal pages if it's not the own profile
                if ((local_user() !== $owner_uid) && !Feature::isEnabled($owner_uid, "export_calendar")) {
-                       notice(L10n::t('Permission denied.') . EOL);
+                       notice(DI::l10n()->t('Permission denied.') . EOL);
                        DI::baseUrl()->redirect('cal/' . $nick);
                }
 
@@ -296,9 +296,9 @@ function cal_content(App $a)
 
                if (!$evexport["success"]) {
                        if ($evexport["content"]) {
-                               notice(L10n::t('This calendar format is not supported'));
+                               notice(DI::l10n()->t('This calendar format is not supported'));
                        } else {
-                               notice(L10n::t('No exportable data found'));
+                               notice(DI::l10n()->t('No exportable data found'));
                        }
 
                        // If it the own calendar return to the events page
@@ -315,7 +315,7 @@ function cal_content(App $a)
                // If nothing went wrong we can echo the export content
                if ($evexport["success"]) {
                        header('Content-type: text/calendar');
-                       header('content-disposition: attachment; filename="' . L10n::t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
+                       header('content-disposition: attachment; filename="' . DI::l10n()->t('calendar') . '-' . $nick . '.' . $evexport["extension"] . '"');
                        echo $evexport["content"];
                        exit();
                }
index 6ad531d0712727cf52c70aec10ca4581a62ead43..4a539665ad953a7a8c26d7a30433729fe0020181 100644 (file)
@@ -25,7 +25,7 @@ function common_content(App $a)
        $zcid = 0;
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -88,7 +88,7 @@ function common_content(App $a)
        }
 
        if ($total < 1) {
-               notice(L10n::t('No contacts in common.') . EOL);
+               notice(DI::l10n()->t('No contacts in common.') . EOL);
                return $o;
        }
 
@@ -139,7 +139,7 @@ function common_content(App $a)
        if ($cmd === 'loc' && $cid && local_user() == $uid) {
                $tab_str = Module\Contact::getTabsHTML($a, $contact, 5);
        } else {
-               $title = L10n::t('Common Friends');
+               $title = DI::l10n()->t('Common Friends');
        }
 
        $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
index 8ed0c14dca588e0c3da02787676c20e3b9a867be..a318148aab37e5b132a1bba539d18e4355d6089d 100644 (file)
@@ -23,14 +23,14 @@ function community_content(App $a, $update = 0)
        $o = '';
 
        if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
-               notice(L10n::t('Public access denied.') . EOL);
+               notice(DI::l10n()->t('Public access denied.') . EOL);
                return;
        }
 
        $page_style = Config::get('system', 'community_page_style');
 
        if ($page_style == CP_NO_INTERNAL_COMMUNITY) {
-               notice(L10n::t('Access denied.') . EOL);
+               notice(DI::l10n()->t('Access denied.') . EOL);
                return;
        }
 
@@ -66,7 +66,7 @@ function community_content(App $a, $update = 0)
        }
 
        if (!in_array($content, ['local', 'global'])) {
-               notice(L10n::t('Community option not available.') . EOL);
+               notice(DI::l10n()->t('Community option not available.') . EOL);
                return;
        }
 
@@ -83,7 +83,7 @@ function community_content(App $a, $update = 0)
                }
 
                if (!$available) {
-                       notice(L10n::t('Not available.') . EOL);
+                       notice(DI::l10n()->t('Not available.') . EOL);
                        return;
                }
        }
@@ -93,10 +93,10 @@ function community_content(App $a, $update = 0)
 
                if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system', 'singleuser'))) {
                        $tabs[] = [
-                               'label' => L10n::t('Local Community'),
+                               'label' => DI::l10n()->t('Local Community'),
                                'url' => 'community/local',
                                'sel' => $content == 'local' ? 'active' : '',
-                               'title' => L10n::t('Posts from local users on this server'),
+                               'title' => DI::l10n()->t('Posts from local users on this server'),
                                'id' => 'community-local-tab',
                                'accesskey' => 'l'
                        ];
@@ -104,10 +104,10 @@ function community_content(App $a, $update = 0)
 
                if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) {
                        $tabs[] = [
-                               'label' => L10n::t('Global Community'),
+                               'label' => DI::l10n()->t('Global Community'),
                                'url' => 'community/global',
                                'sel' => $content == 'global' ? 'active' : '',
-                               'title' => L10n::t('Posts from users of the whole federated network'),
+                               'title' => DI::l10n()->t('Posts from users of the whole federated network'),
                                'id' => 'community-global-tab',
                                'accesskey' => 'g'
                        ];
@@ -153,7 +153,7 @@ function community_content(App $a, $update = 0)
        $r = community_getitems($pager->getStart(), $pager->getItemsPerPage(), $content, $accounttype);
 
        if (!DBA::isResult($r)) {
-               info(L10n::t('No results.') . EOL);
+               info(DI::l10n()->t('No results.') . EOL);
                return $o;
        }
 
@@ -205,7 +205,7 @@ function community_content(App $a, $update = 0)
                '$content' => $o,
                '$header' => '',
                '$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'),
-               '$global_community_hint' => L10n::t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.")
+               '$global_community_hint' => DI::l10n()->t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.")
        ]);
 }
 
index ad90c9f7a911dbdfbfb0452171498d98740bb907..985acce8042841fbabb631f12fe7334493323b24 100644 (file)
@@ -77,9 +77,9 @@ function crepair_post(App $a)
        }
 
        if ($r) {
-               info(L10n::t('Contact settings applied.') . EOL);
+               info(DI::l10n()->t('Contact settings applied.') . EOL);
        } else {
-               notice(L10n::t('Contact update failed.') . EOL);
+               notice(DI::l10n()->t('Contact update failed.') . EOL);
        }
 
        return;
@@ -88,7 +88,7 @@ function crepair_post(App $a)
 function crepair_content(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -100,7 +100,7 @@ function crepair_content(App $a)
        }
 
        if (!DBA::isResult($contact)) {
-               notice(L10n::t('Contact not found.') . EOL);
+               notice(DI::l10n()->t('Contact not found.') . EOL);
                return;
        }
 
@@ -113,8 +113,8 @@ function crepair_content(App $a)
                Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"]));
        }
 
-       $warning = L10n::t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
-       $info = L10n::t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
+       $warning = DI::l10n()->t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
+       $info = DI::l10n()->t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
 
        $returnaddr = "contact/$cid";
 
@@ -128,9 +128,9 @@ function crepair_content(App $a)
        }
 
        if ($contact['network'] == Protocol::FEED) {
-               $remote_self_options = ['0' => L10n::t('No mirroring'), '1' => L10n::t('Mirror as forwarded posting'), '2' => L10n::t('Mirror as my own posting')];
+               $remote_self_options = ['0' => DI::l10n()->t('No mirroring'), '1' => DI::l10n()->t('Mirror as forwarded posting'), '2' => DI::l10n()->t('Mirror as my own posting')];
        } else {
-               $remote_self_options = ['0' => L10n::t('No mirroring'), '2' => L10n::t('Mirror as my own posting')];
+               $remote_self_options = ['0' => DI::l10n()->t('No mirroring'), '2' => DI::l10n()->t('Mirror as my own posting')];
        }
 
        $update_profile = in_array($contact['network'], Protocol::FEDERATED);
@@ -143,30 +143,30 @@ function crepair_content(App $a)
                '$warning'        => $warning,
                '$info'           => $info,
                '$returnaddr'     => $returnaddr,
-               '$return'         => L10n::t('Return to contact editor'),
+               '$return'         => DI::l10n()->t('Return to contact editor'),
                '$update_profile' => $update_profile,
-               '$udprofilenow'   => L10n::t('Refetch contact data'),
+               '$udprofilenow'   => DI::l10n()->t('Refetch contact data'),
                '$contact_id'     => $contact['id'],
-               '$lbl_submit'     => L10n::t('Submit'),
-               '$label_remote_self' => L10n::t('Remote Self'),
+               '$lbl_submit'     => DI::l10n()->t('Submit'),
+               '$label_remote_self' => DI::l10n()->t('Remote Self'),
                '$allow_remote_self' => $allow_remote_self,
                '$remote_self' => ['remote_self',
-                       L10n::t('Mirror postings from this contact'),
+                       DI::l10n()->t('Mirror postings from this contact'),
                        $contact['remote_self'],
-                       L10n::t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
+                       DI::l10n()->t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
                        $remote_self_options
                ],
 
-               '$name'         => ['name', L10n::t('Name') , $contact['name']],
-               '$nick'         => ['nick', L10n::t('Account Nickname'), $contact['nick']],
-               '$attag'        => ['attag', L10n::t('@Tagname - overrides Name/Nickname'), $contact['attag']],
-               '$url'          => ['url', L10n::t('Account URL'), $contact['url']],
-               '$alias'        => ['alias', L10n::t('Account URL Alias'), $contact['alias']],
-               '$request'      => ['request', L10n::t('Friend Request URL'), $contact['request']],
-               'confirm'       => ['confirm', L10n::t('Friend Confirm URL'), $contact['confirm']],
-               'notify'        => ['notify', L10n::t('Notification Endpoint URL'), $contact['notify']],
-               'poll'          => ['poll', L10n::t('Poll/Feed URL'), $contact['poll']],
-               'photo'         => ['photo', L10n::t('New photo from this URL'), ''],
+               '$name'         => ['name', DI::l10n()->t('Name') , $contact['name']],
+               '$nick'         => ['nick', DI::l10n()->t('Account Nickname'), $contact['nick']],
+               '$attag'        => ['attag', DI::l10n()->t('@Tagname - overrides Name/Nickname'), $contact['attag']],
+               '$url'          => ['url', DI::l10n()->t('Account URL'), $contact['url']],
+               '$alias'        => ['alias', DI::l10n()->t('Account URL Alias'), $contact['alias']],
+               '$request'      => ['request', DI::l10n()->t('Friend Request URL'), $contact['request']],
+               'confirm'       => ['confirm', DI::l10n()->t('Friend Confirm URL'), $contact['confirm']],
+               'notify'        => ['notify', DI::l10n()->t('Notification Endpoint URL'), $contact['notify']],
+               'poll'          => ['poll', DI::l10n()->t('Poll/Feed URL'), $contact['poll']],
+               'photo'         => ['photo', DI::l10n()->t('New photo from this URL'), ''],
        ]);
 
        return $o;
index 489a943cd79cdd34ccf5a7ea7c032b0966f1f580..a0752f8880e23ec54809bef58297335c62b5832b 100644 (file)
@@ -64,13 +64,13 @@ function dfrn_confirm_post(App $a, $handsfree = null)
        if (empty($_POST['source_url'])) {
                $uid = ($handsfree['uid'] ?? 0) ?: local_user();
                if (!$uid) {
-                       notice(L10n::t('Permission denied.') . EOL);
+                       notice(DI::l10n()->t('Permission denied.') . EOL);
                        return;
                }
 
                $user = DBA::selectFirst('user', [], ['uid' => $uid]);
                if (!DBA::isResult($user)) {
-                       notice(L10n::t('Profile not found.') . EOL);
+                       notice(DI::l10n()->t('Profile not found.') . EOL);
                        return;
                }
 
@@ -125,8 +125,8 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                );
                if (!DBA::isResult($r)) {
                        Logger::log('Contact not found in DB.');
-                       notice(L10n::t('Contact not found.') . EOL);
-                       notice(L10n::t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
+                       notice(DI::l10n()->t('Contact not found.') . EOL);
+                       notice(DI::l10n()->t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL);
                        return;
                }
 
@@ -227,20 +227,20 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                        // We shouldn't proceed, because the xml parser might choke,
                        // and $status is going to be zero, which indicates success.
                        // We can hardly call this a success.
-                       notice(L10n::t('Response from remote site was not understood.') . EOL);
+                       notice(DI::l10n()->t('Response from remote site was not understood.') . EOL);
                        return;
                }
 
                if (strlen($leading_junk) && Config::get('system', 'debugging')) {
                        // This might be more common. Mixed error text and some XML.
                        // If we're configured for debugging, show the text. Proceed in either case.
-                       notice(L10n::t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);
+                       notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL);
                }
 
                if (stristr($res, "<status") === false) {
                        // wrong xml! stop here!
                        Logger::log('Unexpected response posting to ' . $dfrn_confirm);
-                       notice(L10n::t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL);
+                       notice(DI::l10n()->t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL);
                        return;
                }
 
@@ -249,7 +249,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                $message = XML::unescape($xml->message);   // human readable text of what may have gone wrong.
                switch ($status) {
                        case 0:
-                               info(L10n::t("Confirmation completed successfully.") . EOL);
+                               info(DI::l10n()->t("Confirmation completed successfully.") . EOL);
                                break;
                        case 1:
                                // birthday paradox - generate new dfrn-id and fall through.
@@ -261,15 +261,15 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                                );
 
                        case 2:
-                               notice(L10n::t("Temporary failure. Please wait and try again.") . EOL);
+                               notice(DI::l10n()->t("Temporary failure. Please wait and try again.") . EOL);
                                break;
                        case 3:
-                               notice(L10n::t("Introduction failed or was revoked.") . EOL);
+                               notice(DI::l10n()->t("Introduction failed or was revoked.") . EOL);
                                break;
                }
 
                if (strlen($message)) {
-                       notice(L10n::t('Remote site reported: ') . $message . EOL);
+                       notice(DI::l10n()->t('Remote site reported: ') . $message . EOL);
                }
 
                if (($status == 0) && $intro_id) {
@@ -374,7 +374,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                // Find our user's account
                $user = DBA::selectFirst('user', [], ['nickname' => $node]);
                if (!DBA::isResult($user)) {
-                       $message = L10n::t('No user record found for \'%s\' ', $node);
+                       $message = DI::l10n()->t('No user record found for \'%s\' ', $node);
                        System::xmlExit(3, $message); // failure
                        // NOTREACHED
                }
@@ -384,7 +384,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
 
 
                if (!strstr($my_prvkey, 'PRIVATE KEY')) {
-                       $message = L10n::t('Our site encryption key is apparently messed up.');
+                       $message = DI::l10n()->t('Our site encryption key is apparently messed up.');
                        System::xmlExit(3, $message);
                }
 
@@ -395,7 +395,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
 
 
                if (!strlen($decrypted_source_url)) {
-                       $message = L10n::t('Empty site URL was provided or URL could not be decrypted by us.');
+                       $message = DI::l10n()->t('Empty site URL was provided or URL could not be decrypted by us.');
                        System::xmlExit(3, $message);
                        // NOTREACHED
                }
@@ -411,7 +411,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                        $contact = DBA::selectFirst('contact', [], ['url' => $newurl, 'uid' => $local_uid]);
                        if (!DBA::isResult($contact)) {
                                // this is either a bogus confirmation (?) or we deleted the original introduction.
-                               $message = L10n::t('Contact record was not found for you on our site.');
+                               $message = DI::l10n()->t('Contact record was not found for you on our site.');
                                System::xmlExit(3, $message);
                                return; // NOTREACHED
                        }
@@ -425,7 +425,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                $dfrn_record = $contact['id'];
 
                if (!$foreign_pubkey) {
-                       $message = L10n::t('Site public key not available in contact record for URL %s.', $decrypted_source_url);
+                       $message = DI::l10n()->t('Site public key not available in contact record for URL %s.', $decrypted_source_url);
                        System::xmlExit(3, $message);
                }
 
@@ -441,7 +441,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                }
 
                if (DBA::exists('contact', ['dfrn-id' => $decrypted_dfrn_id])) {
-                       $message = L10n::t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
+                       $message = DI::l10n()->t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
                        System::xmlExit(1, $message); // Birthday paradox - duplicate dfrn-id
                        // NOTREACHED
                }
@@ -452,7 +452,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                        intval($dfrn_record)
                );
                if (!DBA::isResult($r)) {
-                       $message = L10n::t('Unable to set your contact credentials on our system.');
+                       $message = DI::l10n()->t('Unable to set your contact credentials on our system.');
                        System::xmlExit(3, $message);
                }
 
@@ -508,7 +508,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                        intval($dfrn_record)
                );
                if (!DBA::isResult($r)) {       // indicates schema is messed up or total db failure
-                       $message = L10n::t('Unable to update your contact profile details on our system');
+                       $message = DI::l10n()->t('Unable to update your contact profile details on our system');
                        System::xmlExit(3, $message);
                }
 
@@ -538,7 +538,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                                        'to_email'     => $combined['email'],
                                        'uid'          => $combined['uid'],
                                        'link'         => DI::baseUrl() . '/contact/' . $dfrn_record,
-                                       'source_name'  => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : L10n::t('[Name Withheld]')),
+                                       'source_name'  => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : DI::l10n()->t('[Name Withheld]')),
                                        'source_link'  => $combined['url'],
                                        'source_photo' => $combined['photo'],
                                        'verb'         => ($mutual ? Activity::FRIEND : Activity::FOLLOW),
index 3e193e2a3a579390f49b84cdf4febc2d91b40520..e18874481358a8c9dff1a287bcc4def209f84ac2 100644 (file)
@@ -121,7 +121,7 @@ function dfrn_poll_init(App $a)
                                        Session::setVisitorsContacts();
 
                                        if (!$quiet) {
-                                               info(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
+                                               info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
                                        }
 
                                        // Visitors get 1 day session.
@@ -524,7 +524,7 @@ function dfrn_poll_content(App $a)
                                        Session::setVisitorsContacts();
 
                                        if (!$quiet) {
-                                               info(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
+                                               info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
                                        }
 
                                        // Visitors get 1 day session.
index ea570d9955c33d6efa118b72f1c8e81046c5062a..001735ea82cda7473904d9de37ead6a421114254 100644 (file)
@@ -99,7 +99,7 @@ function dfrn_request_post(App $a)
                                if (DBA::isResult($r)) {
                                        if (strlen($r[0]['dfrn-id'])) {
                                                // We don't need to be here. It has already happened.
-                                               notice(L10n::t("This introduction has already been accepted.") . EOL);
+                                               notice(DI::l10n()->t("This introduction has already been accepted.") . EOL);
                                                return;
                                        } else {
                                                $contact_record = $r[0];
@@ -117,14 +117,14 @@ function dfrn_request_post(App $a)
                                        $parms = Probe::profile($dfrn_url);
 
                                        if (!count($parms)) {
-                                               notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
+                                               notice(DI::l10n()->t('Profile location is not valid or does not contain profile information.') . EOL);
                                                return;
                                        } else {
                                                if (empty($parms['fn'])) {
-                                                       notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
+                                                       notice(DI::l10n()->t('Warning: profile location has no identifiable owner name.') . EOL);
                                                }
                                                if (empty($parms['photo'])) {
-                                                       notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
+                                                       notice(DI::l10n()->t('Warning: profile location has no profile photo.') . EOL);
                                                }
                                                $invalid = Probe::validDfrn($parms);
                                                if ($invalid) {
@@ -166,7 +166,7 @@ function dfrn_request_post(App $a)
                                }
 
                                if ($r) {
-                                       info(L10n::t("Introduction complete.") . EOL);
+                                       info(DI::l10n()->t("Introduction complete.") . EOL);
                                }
 
                                $r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `site-pubkey` = '%s' LIMIT 1",
@@ -202,7 +202,7 @@ function dfrn_request_post(App $a)
                }
 
                // invalid/bogus request
-               notice(L10n::t('Unrecoverable protocol error.') . EOL);
+               notice(DI::l10n()->t('Unrecoverable protocol error.') . EOL);
                DI::baseUrl()->redirect();
                return; // NOTREACHED
        }
@@ -229,7 +229,7 @@ function dfrn_request_post(App $a)
         *
         */
        if (!(is_array($a->profile) && count($a->profile))) {
-               notice(L10n::t('Profile unavailable.') . EOL);
+               notice(DI::l10n()->t('Profile unavailable.') . EOL);
                return;
        }
 
@@ -250,9 +250,9 @@ function dfrn_request_post(App $a)
                                intval($uid)
                        );
                        if (DBA::isResult($r) && count($r) > $maxreq) {
-                               notice(L10n::t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
-                               notice(L10n::t('Spam protection measures have been invoked.') . EOL);
-                               notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
+                               notice(DI::l10n()->t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
+                               notice(DI::l10n()->t('Spam protection measures have been invoked.') . EOL);
+                               notice(DI::l10n()->t('Friends are advised to please try again in 24 hours.') . EOL);
                                return;
                        }
                }
@@ -276,7 +276,7 @@ function dfrn_request_post(App $a)
 
                $url = trim($_POST['dfrn_url']);
                if (!strlen($url)) {
-                       notice(L10n::t("Invalid locator") . EOL);
+                       notice(DI::l10n()->t("Invalid locator") . EOL);
                        return;
                }
 
@@ -312,10 +312,10 @@ function dfrn_request_post(App $a)
 
                        if (DBA::isResult($ret)) {
                                if (strlen($ret[0]['issued-id'])) {
-                                       notice(L10n::t('You have already introduced yourself here.') . EOL);
+                                       notice(DI::l10n()->t('You have already introduced yourself here.') . EOL);
                                        return;
                                } elseif ($ret[0]['rel'] == Contact::FRIEND) {
-                                       notice(L10n::t('Apparently you are already friends with %s.', $a->profile['name']) . EOL);
+                                       notice(DI::l10n()->t('Apparently you are already friends with %s.', $a->profile['name']) . EOL);
                                        return;
                                } else {
                                        $contact_record = $ret[0];
@@ -335,19 +335,19 @@ function dfrn_request_post(App $a)
                        } else {
                                $url = Network::isUrlValid($url);
                                if (!$url) {
-                                       notice(L10n::t('Invalid profile URL.') . EOL);
+                                       notice(DI::l10n()->t('Invalid profile URL.') . EOL);
                                        DI::baseUrl()->redirect(DI::args()->getCommand());
                                        return; // NOTREACHED
                                }
 
                                if (!Network::isUrlAllowed($url)) {
-                                       notice(L10n::t('Disallowed profile URL.') . EOL);
+                                       notice(DI::l10n()->t('Disallowed profile URL.') . EOL);
                                        DI::baseUrl()->redirect(DI::args()->getCommand());
                                        return; // NOTREACHED
                                }
 
                                if (Network::isUrlBlocked($url)) {
-                                       notice(L10n::t('Blocked domain') . EOL);
+                                       notice(DI::l10n()->t('Blocked domain') . EOL);
                                        DI::baseUrl()->redirect(DI::args()->getCommand());
                                        return; // NOTREACHED
                                }
@@ -355,14 +355,14 @@ function dfrn_request_post(App $a)
                                $parms = Probe::profile(($hcard) ? $hcard : $url);
 
                                if (!count($parms)) {
-                                       notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
+                                       notice(DI::l10n()->t('Profile location is not valid or does not contain profile information.') . EOL);
                                        DI::baseUrl()->redirect(DI::args()->getCommand());
                                } else {
                                        if (empty($parms['fn'])) {
-                                               notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
+                                               notice(DI::l10n()->t('Warning: profile location has no identifiable owner name.') . EOL);
                                        }
                                        if (empty($parms['photo'])) {
-                                               notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
+                                               notice(DI::l10n()->t('Warning: profile location has no profile photo.') . EOL);
                                        }
                                        $invalid = Probe::validDfrn($parms);
                                        if ($invalid) {
@@ -414,7 +414,7 @@ function dfrn_request_post(App $a)
                                }
                        }
                        if ($r === false) {
-                               notice(L10n::t('Failed to update contact record.') . EOL);
+                               notice(DI::l10n()->t('Failed to update contact record.') . EOL);
                                return;
                        }
 
@@ -434,7 +434,7 @@ function dfrn_request_post(App $a)
 
                        // This notice will only be seen by the requestor if the requestor and requestee are on the same server.
                        if (!$failed) {
-                               info(L10n::t('Your introduction has been sent.') . EOL);
+                               info(DI::l10n()->t('Your introduction has been sent.') . EOL);
                        }
 
                        // "Homecoming" - send the requestor back to their site to record the introduction.
@@ -472,7 +472,7 @@ function dfrn_request_post(App $a)
                        // NOTREACHED
                        // END $network != Protocol::PHANTOM
                } else {
-                       notice(L10n::t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL);
+                       notice(DI::l10n()->t("Remote subscription can't be done for your network. Please subscribe directly on your system.") . EOL);
                        return;
                }
        } return;
@@ -488,7 +488,7 @@ function dfrn_request_content(App $a)
        // to send us to the post section to record the introduction.
        if (!empty($_GET['dfrn_url'])) {
                if (!local_user()) {
-                       info(L10n::t("Please login to confirm introduction.") . EOL);
+                       info(DI::l10n()->t("Please login to confirm introduction.") . EOL);
                        /* setup the return URL to come back to this page if they use openid */
                        return Login::form();
                }
@@ -496,7 +496,7 @@ function dfrn_request_content(App $a)
                // Edge case, but can easily happen in the wild. This person is authenticated,
                // but not as the person who needs to deal with this request.
                if ($a->user['nickname'] != $a->argv[1]) {
-                       notice(L10n::t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
+                       notice(DI::l10n()->t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
                        return Login::form();
                }
 
@@ -510,7 +510,7 @@ function dfrn_request_content(App $a)
                        $_POST["confirm_key"] = $confirm_key;
                        $_POST["localconfirm"] = 1;
                        $_POST["hidden-contact"] = 0;
-                       $_POST["submit"] = L10n::t('Confirm');
+                       $_POST["submit"] = DI::l10n()->t('Confirm');
 
                        dfrn_request_post($a);
 
@@ -521,11 +521,11 @@ function dfrn_request_content(App $a)
                $o = Renderer::replaceMacros($tpl, [
                        '$dfrn_url' => $dfrn_url,
                        '$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
-                       '$hidethem' => L10n::t('Hide this contact'),
+                       '$hidethem' => DI::l10n()->t('Hide this contact'),
                        '$confirm_key' => $confirm_key,
-                       '$welcome' => L10n::t('Welcome home %s.', $a->user['username']),
-                       '$please' => L10n::t('Please confirm your introduction/connection request to %s.', $dfrn_url),
-                       '$submit' => L10n::t('Confirm'),
+                       '$welcome' => DI::l10n()->t('Welcome home %s.', $a->user['username']),
+                       '$please' => DI::l10n()->t('Please confirm your introduction/connection request to %s.', $dfrn_url),
+                       '$submit' => DI::l10n()->t('Confirm'),
                        '$uid' => $_SESSION['uid'],
                        '$nickname' => $a->user['nickname'],
                        'dfrn_rawurl' => $_GET['dfrn_url']
@@ -561,7 +561,7 @@ function dfrn_request_content(App $a)
                                                'to_email'     => $r[0]['email'],
                                                'uid'          => $r[0]['uid'],
                                                'link'         => DI::baseUrl() . '/notifications/intros',
-                                               'source_name'  => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : L10n::t('[Name Withheld]')),
+                                               'source_name'  => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : DI::l10n()->t('[Name Withheld]')),
                                                'source_link'  => $r[0]['url'],
                                                'source_photo' => $r[0]['photo'],
                                                'verb'         => Activity::REQ_FRIEND,
@@ -598,7 +598,7 @@ function dfrn_request_content(App $a)
                // Normal web request. Display our user's introduction form.
                if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
                        if (!Config::get('system', 'local_block')) {
-                               notice(L10n::t('Public access denied.') . EOL);
+                               notice(DI::l10n()->t('Public access denied.') . EOL);
                                return;
                        }
                }
@@ -633,25 +633,25 @@ function dfrn_request_content(App $a)
                        $tpl = Renderer::getMarkupTemplate('auto_request.tpl');
                }
 
-               $page_desc = L10n::t("Please enter your 'Identity Address' from one of the following supported communications networks:");
+               $page_desc = DI::l10n()->t("Please enter your 'Identity Address' from one of the following supported communications networks:");
 
-               $invite_desc = L10n::t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.', Search::getGlobalDirectory() . '/servers');
+               $invite_desc = DI::l10n()->t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.', Search::getGlobalDirectory() . '/servers');
 
                $o = Renderer::replaceMacros($tpl, [
-                       '$header' => L10n::t('Friend/Connection Request'),
-                       '$desc' => L10n::t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
-                       '$pls_answer' => L10n::t('Please answer the following:'),
-                       '$does_know_you' => ['knowyou', L10n::t('Does %s know you?', $a->profile['name']), false, '', [L10n::t('No'), L10n::t('Yes')]],
-                       '$add_note' => L10n::t('Add a personal note:'),
+                       '$header' => DI::l10n()->t('Friend/Connection Request'),
+                       '$desc' => DI::l10n()->t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
+                       '$pls_answer' => DI::l10n()->t('Please answer the following:'),
+                       '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $a->profile['name']), false, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
+                       '$add_note' => DI::l10n()->t('Add a personal note:'),
                        '$page_desc' => $page_desc,
-                       '$friendica' => L10n::t('Friendica'),
-                       '$statusnet' => L10n::t("GNU Social \x28Pleroma, Mastodon\x29"),
-                       '$diaspora' => L10n::t("Diaspora \x28Socialhome, Hubzilla\x29"),
-                       '$diasnote' => L10n::t(' - please do not use this form.  Instead, enter %s into your Diaspora search bar.', $target_addr),
-                       '$your_address' => L10n::t('Your Identity Address:'),
+                       '$friendica' => DI::l10n()->t('Friendica'),
+                       '$statusnet' => DI::l10n()->t("GNU Social \x28Pleroma, Mastodon\x29"),
+                       '$diaspora' => DI::l10n()->t("Diaspora \x28Socialhome, Hubzilla\x29"),
+                       '$diasnote' => DI::l10n()->t(' - please do not use this form.  Instead, enter %s into your Diaspora search bar.', $target_addr),
+                       '$your_address' => DI::l10n()->t('Your Identity Address:'),
                        '$invite_desc' => $invite_desc,
-                       '$submit' => L10n::t('Submit Request'),
-                       '$cancel' => L10n::t('Cancel'),
+                       '$submit' => DI::l10n()->t('Submit Request'),
+                       '$cancel' => DI::l10n()->t('Cancel'),
                        '$nickname' => $a->argv[1],
                        '$name' => $a->profile['name'],
                        '$myaddr' => $myaddr
index 07445ba51fb3c2991c7e1ab48ef008f7191acab7..2b4e2c2207ac9fc0708ee1941ec7b5f560c1ee2b 100644 (file)
@@ -166,7 +166,7 @@ function display_fetchauthor($a, $item)
 function display_content(App $a, $update = false, $update_uid = 0)
 {
        if (Config::get('system','block_public') && !Session::isAuthenticated()) {
-               throw new HTTPException\ForbiddenException(L10n::t('Public access denied.'));
+               throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
        }
 
        $o = '';
@@ -223,7 +223,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
        }
 
        if (empty($item)) {
-               throw new HTTPException\NotFoundException(L10n::t('The requested item doesn\'t exist or has been deleted.'));
+               throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
        }
 
        // We are displaying an "alternate" link if that post was public. See issue 2864
@@ -268,7 +268,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
        $is_owner = (local_user() && (in_array($a->profile['profile_uid'], [local_user(), 0])) ? true : false);
 
        if (!empty($a->profile['hidewall']) && !$is_owner && !$is_remote_contact) {
-               throw new HTTPException\ForbiddenException(L10n::t('Access to this profile has been restricted.'));
+               throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
        }
 
        // We need the editor here to be able to reshare an item.
@@ -304,7 +304,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
        $item = Item::selectFirstForUser($a->profile['profile_uid'], $fields, $condition);
 
        if (!DBA::isResult($item)) {
-               throw new HTTPException\NotFoundException(L10n::t('The requested item doesn\'t exist or has been deleted.'));
+               throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
        }
 
        $item['uri'] = $item['parent-uri'];
@@ -384,7 +384,7 @@ function displayShowFeed($item_id, $conversation)
 {
        $xml = DFRN::itemFeed($item_id, $conversation);
        if ($xml == '') {
-               throw new HTTPException\InternalServerErrorException(L10n::t('The feed for this item is unavailable.'));
+               throw new HTTPException\InternalServerErrorException(DI::l10n()->t('The feed for this item is unavailable.'));
        }
        header("Content-type: application/atom+xml");
        echo $xml;
index b6ed782463fe7573645d747d3b613e6b62383d28..94d483172f6c14ce76f6de678817d5baf1bb8210 100644 (file)
@@ -20,14 +20,14 @@ function editpost_content(App $a)
        $o = '';
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
        $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
 
        if (!$post_id) {
-               notice(L10n::t('Item not found') . EOL);
+               notice(DI::l10n()->t('Item not found') . EOL);
                return;
        }
 
@@ -37,19 +37,19 @@ function editpost_content(App $a)
        $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
 
        if (!DBA::isResult($item)) {
-               notice(L10n::t('Item not found') . EOL);
+               notice(DI::l10n()->t('Item not found') . EOL);
                return;
        }
 
        $geotag = '';
 
        $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate("section_title.tpl"), [
-               '$title' => L10n::t('Edit post')
+               '$title' => DI::l10n()->t('Edit post')
        ]);
 
        $tpl = Renderer::getMarkupTemplate('jot-header.tpl');
        DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-               '$ispublic' => '&nbsp;', // L10n::t('Visible to <strong>everybody</strong>'),
+               '$ispublic' => '&nbsp;', // DI::l10n()->t('Visible to <strong>everybody</strong>'),
                '$geotag' => $geotag,
                '$nickname' => $a->user['nickname']
        ]);
@@ -70,23 +70,23 @@ function editpost_content(App $a)
                '$is_edit' => true,
                '$return_path' => '/display/' . $item['guid'],
                '$action' => 'item',
-               '$share' => L10n::t('Save'),
-               '$upload' => L10n::t('Upload photo'),
-               '$shortupload' => L10n::t('upload photo'),
-               '$attach' => L10n::t('Attach file'),
-               '$shortattach' => L10n::t('attach file'),
-               '$weblink' => L10n::t('Insert web link'),
-               '$shortweblink' => L10n::t('web link'),
-               '$video' => L10n::t('Insert video link'),
-               '$shortvideo' => L10n::t('video link'),
-               '$audio' => L10n::t('Insert audio link'),
-               '$shortaudio' => L10n::t('audio link'),
-               '$setloc' => L10n::t('Set your location'),
-               '$shortsetloc' => L10n::t('set location'),
-               '$noloc' => L10n::t('Clear browser location'),
-               '$shortnoloc' => L10n::t('clear location'),
-               '$wait' => L10n::t('Please wait'),
-               '$permset' => L10n::t('Permission settings'),
+               '$share' => DI::l10n()->t('Save'),
+               '$upload' => DI::l10n()->t('Upload photo'),
+               '$shortupload' => DI::l10n()->t('upload photo'),
+               '$attach' => DI::l10n()->t('Attach file'),
+               '$shortattach' => DI::l10n()->t('attach file'),
+               '$weblink' => DI::l10n()->t('Insert web link'),
+               '$shortweblink' => DI::l10n()->t('web link'),
+               '$video' => DI::l10n()->t('Insert video link'),
+               '$shortvideo' => DI::l10n()->t('video link'),
+               '$audio' => DI::l10n()->t('Insert audio link'),
+               '$shortaudio' => DI::l10n()->t('audio link'),
+               '$setloc' => DI::l10n()->t('Set your location'),
+               '$shortsetloc' => DI::l10n()->t('set location'),
+               '$noloc' => DI::l10n()->t('Clear browser location'),
+               '$shortnoloc' => DI::l10n()->t('clear location'),
+               '$wait' => DI::l10n()->t('Please wait'),
+               '$permset' => DI::l10n()->t('Permission settings'),
                '$wall' => $item['wall'],
                '$posttype' => $item['post-type'],
                '$content' => undo_post_tagging($item['body']),
@@ -94,28 +94,28 @@ function editpost_content(App $a)
                '$defloc' => $a->user['default-location'],
                '$visitor' => 'none',
                '$pvisit' => 'none',
-               '$emailcc' => L10n::t('CC: email addresses'),
-               '$public' => L10n::t('Public post'),
+               '$emailcc' => DI::l10n()->t('CC: email addresses'),
+               '$public' => DI::l10n()->t('Public post'),
                '$jotnets' => $jotnets,
                '$title' => $item['title'],
-               '$placeholdertitle' => L10n::t('Set title'),
+               '$placeholdertitle' => DI::l10n()->t('Set title'),
                '$category' => FileTag::fileToList($item['file'], 'category'),
-               '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? L10n::t("Categories \x28comma-separated list\x29") : ''),
-               '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'),
+               '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
+               '$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
                '$lockstate' => $lockstate,
                '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
                '$bang' => ($lockstate === 'lock' ? '!' : ''),
                '$profile_uid' => $_SESSION['uid'],
-               '$preview' => L10n::t('Preview'),
+               '$preview' => DI::l10n()->t('Preview'),
                '$jotplugins' => $jotplugins,
-               '$sourceapp' => L10n::t($a->sourcename),
-               '$cancel' => L10n::t('Cancel'),
+               '$sourceapp' => DI::l10n()->t($a->sourcename),
+               '$cancel' => DI::l10n()->t('Cancel'),
                '$rand_num' => Crypto::randomDigits(12),
 
                //jot nav tab (used in some themes)
-               '$message' => L10n::t('Message'),
-               '$browser' => L10n::t('Browser'),
-               '$shortpermset' => L10n::t('permissions'),
+               '$message' => DI::l10n()->t('Message'),
+               '$browser' => DI::l10n()->t('Browser'),
+               '$shortpermset' => DI::l10n()->t('permissions'),
        ]);
 
        return $o;
index a3c27a0538a8cad1341d6d7ce21cdc083f74469d..f92a01cf606d552cc367ae24469463d9351e776c 100644 (file)
@@ -117,18 +117,18 @@ function events_post(App $a)
        $onerror_path = 'events/' . $action . '?' . http_build_query($params, null, null, PHP_QUERY_RFC3986);
 
        if (strcmp($finish, $start) < 0 && !$nofinish) {
-               notice(L10n::t('Event can not end before it has started.') . EOL);
+               notice(DI::l10n()->t('Event can not end before it has started.') . EOL);
                if (intval($_REQUEST['preview'])) {
-                       echo L10n::t('Event can not end before it has started.');
+                       echo DI::l10n()->t('Event can not end before it has started.');
                        exit();
                }
                DI::baseUrl()->redirect($onerror_path);
        }
 
        if (!$summary || ($start === DBA::NULL_DATETIME)) {
-               notice(L10n::t('Event title and start time are required.') . EOL);
+               notice(DI::l10n()->t('Event title and start time are required.') . EOL);
                if (intval($_REQUEST['preview'])) {
-                       echo L10n::t('Event title and start time are required.');
+                       echo DI::l10n()->t('Event title and start time are required.');
                        exit();
                }
                DI::baseUrl()->redirect($onerror_path);
@@ -210,7 +210,7 @@ function events_post(App $a)
 function events_content(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return Login::form();
        }
 
@@ -391,20 +391,20 @@ function events_content(App $a)
 
                $o = Renderer::replaceMacros($tpl, [
                        '$tabs'      => $tabs,
-                       '$title'     => L10n::t('Events'),
-                       '$view'      => L10n::t('View'),
-                       '$new_event' => [DI::baseUrl() . '/events/new', L10n::t('Create New Event'), '', ''],
-                       '$previous'  => [DI::baseUrl() . '/events/$prevyear/$prevmonth', L10n::t('Previous'), '', ''],
-                       '$next'      => [DI::baseUrl() . '/events/$nextyear/$nextmonth', L10n::t('Next'), '', ''],
+                       '$title'     => DI::l10n()->t('Events'),
+                       '$view'      => DI::l10n()->t('View'),
+                       '$new_event' => [DI::baseUrl() . '/events/new', DI::l10n()->t('Create New Event'), '', ''],
+                       '$previous'  => [DI::baseUrl() . '/events/$prevyear/$prevmonth', DI::l10n()->t('Previous'), '', ''],
+                       '$next'      => [DI::baseUrl() . '/events/$nextyear/$nextmonth', DI::l10n()->t('Next'), '', ''],
                        '$calendar'  => Temporal::getCalendarTable($y, $m, $links, ' eventcal'),
 
                        '$events'    => $events,
 
-                       '$today' => L10n::t('today'),
-                       '$month' => L10n::t('month'),
-                       '$week'  => L10n::t('week'),
-                       '$day'   => L10n::t('day'),
-                       '$list'  => L10n::t('list'),
+                       '$today' => DI::l10n()->t('today'),
+                       '$month' => DI::l10n()->t('month'),
+                       '$week'  => DI::l10n()->t('week'),
+                       '$day'   => DI::l10n()->t('day'),
+                       '$list'  => DI::l10n()->t('list'),
                ]);
 
                if (!empty($_GET['id'])) {
@@ -505,14 +505,14 @@ function events_content(App $a)
                        '$cid'  => $cid,
                        '$uri'  => $uri,
 
-                       '$title' => L10n::t('Event details'),
-                       '$desc' => L10n::t('Starting date and Title are required.'),
-                       '$s_text' => L10n::t('Event Starts:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
+                       '$title' => DI::l10n()->t('Event details'),
+                       '$desc' => DI::l10n()->t('Starting date and Title are required.'),
+                       '$s_text' => DI::l10n()->t('Event Starts:') . ' <span class="required" title="' . DI::l10n()->t('Required') . '">*</span>',
                        '$s_dsel' => Temporal::getDateTimeField(
                                new DateTime(),
                                DateTime::createFromFormat('Y', intval($syear) + 5),
                                DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"),
-                               L10n::t('Event Starts:'),
+                               DI::l10n()->t('Event Starts:'),
                                'start_text',
                                true,
                                true,
@@ -520,39 +520,39 @@ function events_content(App $a)
                                '',
                                true
                        ),
-                       '$n_text' => L10n::t('Finish date/time is not known or not relevant'),
+                       '$n_text' => DI::l10n()->t('Finish date/time is not known or not relevant'),
                        '$n_checked' => $n_checked,
-                       '$f_text' => L10n::t('Event Finishes:'),
+                       '$f_text' => DI::l10n()->t('Event Finishes:'),
                        '$f_dsel' => Temporal::getDateTimeField(
                                new DateTime(),
                                DateTime::createFromFormat('Y', intval($fyear) + 5),
                                DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"),
-                               L10n::t('Event Finishes:'),
+                               DI::l10n()->t('Event Finishes:'),
                                'finish_text',
                                true,
                                true,
                                'start_text'
                        ),
-                       '$a_text' => L10n::t('Adjust for viewer timezone'),
+                       '$a_text' => DI::l10n()->t('Adjust for viewer timezone'),
                        '$a_checked' => $a_checked,
-                       '$d_text' => L10n::t('Description:'),
+                       '$d_text' => DI::l10n()->t('Description:'),
                        '$d_orig' => $d_orig,
-                       '$l_text' => L10n::t('Location:'),
+                       '$l_text' => DI::l10n()->t('Location:'),
                        '$l_orig' => $l_orig,
-                       '$t_text' => L10n::t('Title:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
+                       '$t_text' => DI::l10n()->t('Title:') . ' <span class="required" title="' . DI::l10n()->t('Required') . '">*</span>',
                        '$t_orig' => $t_orig,
-                       '$summary' => ['summary', L10n::t('Title:'), $t_orig, '', '*'],
-                       '$sh_text' => L10n::t('Share this event'),
-                       '$share' => ['share', L10n::t('Share this event'), $share_checked, '', $share_disabled],
+                       '$summary' => ['summary', DI::l10n()->t('Title:'), $t_orig, '', '*'],
+                       '$sh_text' => DI::l10n()->t('Share this event'),
+                       '$share' => ['share', DI::l10n()->t('Share this event'), $share_checked, '', $share_disabled],
                        '$sh_checked' => $share_checked,
-                       '$nofinish' => ['nofinish', L10n::t('Finish date/time is not known or not relevant'), $n_checked],
-                       '$adjust' => ['adjust', L10n::t('Adjust for viewer timezone'), $a_checked],
-                       '$preview' => L10n::t('Preview'),
+                       '$nofinish' => ['nofinish', DI::l10n()->t('Finish date/time is not known or not relevant'), $n_checked],
+                       '$adjust' => ['adjust', DI::l10n()->t('Adjust for viewer timezone'), $a_checked],
+                       '$preview' => DI::l10n()->t('Preview'),
                        '$acl' => $acl,
-                       '$submit' => L10n::t('Submit'),
-                       '$basic' => L10n::t('Basic'),
-                       '$advanced' => L10n::t('Advanced'),
-                       '$permissions' => L10n::t('Permissions'),
+                       '$submit' => DI::l10n()->t('Submit'),
+                       '$basic' => DI::l10n()->t('Basic'),
+                       '$advanced' => DI::l10n()->t('Advanced'),
+                       '$permissions' => DI::l10n()->t('Permissions'),
                ]);
 
                return $o;
@@ -568,9 +568,9 @@ function events_content(App $a)
                }
 
                if (Item::exists(['id' => $ev[0]['itemid']])) {
-                       notice(L10n::t('Failed to remove event') . EOL);
+                       notice(DI::l10n()->t('Failed to remove event') . EOL);
                } else {
-                       info(L10n::t('Event removed') . EOL);
+                       info(DI::l10n()->t('Event removed') . EOL);
                }
 
                DI::baseUrl()->redirect('events');
index 2b293a716d89355bef08cdd3db209933888bd6c2..79dd1599bb300836844ae39153889413ea0c0cef 100644 (file)
@@ -40,7 +40,7 @@ function fbrowser_content(App $a)
 
        switch ($a->argv[1]) {
                case "image":
-                       $path = [["", L10n::t("Photos")]];
+                       $path = [["", DI::l10n()->t("Photos")]];
                        $albums = false;
                        $sql_extra = "";
                        $sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
@@ -49,7 +49,7 @@ function fbrowser_content(App $a)
                                $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' ",
                                        intval(local_user()),
                                        DBA::escape('Contact Photos'),
-                                       DBA::escape(L10n::t('Contact Photos'))
+                                       DBA::escape(DI::l10n()->t('Contact Photos'))
                                );
 
                                function _map_folder1($el)
@@ -73,7 +73,7 @@ function fbrowser_content(App $a)
                                        GROUP BY `resource-id` $sql_extra2",
                                intval(local_user()),
                                DBA::escape('Contact Photos'),
-                               DBA::escape(L10n::t('Contact Photos'))
+                               DBA::escape(DI::l10n()->t('Contact Photos'))
                        );
 
                        function _map_files1($rr)
@@ -107,9 +107,9 @@ function fbrowser_content(App $a)
                                '$path'     => $path,
                                '$folders'  => $albums,
                                '$files'    => $files,
-                               '$cancel'   => L10n::t('Cancel'),
+                               '$cancel'   => DI::l10n()->t('Cancel'),
                                '$nickname' => $a->user['nickname'],
-                               '$upload'   => L10n::t('Upload')
+                               '$upload'   => DI::l10n()->t('Upload')
                        ]);
 
                        break;
@@ -133,12 +133,12 @@ function fbrowser_content(App $a)
                                $tpl = Renderer::getMarkupTemplate($template_file);
                                $o = Renderer::replaceMacros($tpl, [
                                        '$type'     => 'file',
-                                       '$path'     => [ [ "", L10n::t("Files")] ],
+                                       '$path'     => [ [ "", DI::l10n()->t("Files")] ],
                                        '$folders'  => false,
                                        '$files'    => $files,
-                                       '$cancel'   => L10n::t('Cancel'),
+                                       '$cancel'   => DI::l10n()->t('Cancel'),
                                        '$nickname' => $a->user['nickname'],
-                                       '$upload'   => L10n::t('Upload')
+                                       '$upload'   => DI::l10n()->t('Upload')
                                ]);
                        }
 
index 7363275de69966e7b352bf8e5d4dd1dd108d366f..dce6798b3c305c2288599a7f42ef5b275cf14da8 100644 (file)
@@ -18,7 +18,7 @@ use Friendica\Util\Strings;
 function follow_post(App $a)
 {
        if (!local_user()) {
-               throw new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Access denied.'));
+               throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
        }
 
        if (isset($_REQUEST['cancel'])) {
@@ -44,7 +44,7 @@ function follow_post(App $a)
                DI::baseUrl()->redirect('contact/' . $result['cid']);
        }
 
-       info(L10n::t('The contact could not be added.'));
+       info(DI::l10n()->t('The contact could not be added.'));
 
        DI::baseUrl()->redirect($return_path);
        // NOTREACHED
@@ -55,7 +55,7 @@ function follow_content(App $a)
        $return_path = 'contact';
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.'));
+               notice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
@@ -74,7 +74,7 @@ function follow_content(App $a)
                DI::baseUrl()->redirect($return_path);
        }
 
-       $submit = L10n::t('Submit Request');
+       $submit = DI::l10n()->t('Submit Request');
 
        // Don't try to add a pending contact
        $r = q("SELECT `pending` FROM `contact` WHERE `uid` = %d AND ((`rel` != %d) OR (`network` = '%s')) AND
@@ -85,7 +85,7 @@ function follow_content(App $a)
 
        if ($r) {
                if ($r[0]['pending']) {
-                       notice(L10n::t('You already added this contact.'));
+                       notice(DI::l10n()->t('You already added this contact.'));
                        $submit = '';
                        //$a->internalRedirect($_SESSION['return_path']);
                        // NOTREACHED
@@ -97,21 +97,21 @@ function follow_content(App $a)
        $protocol = Contact::getProtocol($ret['url'], $ret['network']);
 
        if (($protocol == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
-               notice(L10n::t("Diaspora support isn't enabled. Contact can't be added."));
+               notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
                $submit = '';
                //$a->internalRedirect($_SESSION['return_path']);
                // NOTREACHED
        }
 
        if (($protocol == Protocol::OSTATUS) && Config::get('system', 'ostatus_disabled')) {
-               notice(L10n::t("OStatus support is disabled. Contact can't be added."));
+               notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
                $submit = '';
                //$a->internalRedirect($_SESSION['return_path']);
                // NOTREACHED
        }
 
        if ($protocol == Protocol::PHANTOM) {
-               notice(L10n::t("The network type couldn't be detected. Contact can't be added."));
+               notice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
                $submit = '';
                //$a->internalRedirect($_SESSION['return_path']);
                // NOTREACHED
@@ -132,7 +132,7 @@ function follow_content(App $a)
        $r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1", intval($uid));
 
        if (!$r) {
-               notice(L10n::t('Permission denied.'));
+               notice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
@@ -158,30 +158,30 @@ function follow_content(App $a)
        }
 
        $o = Renderer::replaceMacros($tpl, [
-               '$header'        => L10n::t('Connect/Follow'),
+               '$header'        => DI::l10n()->t('Connect/Follow'),
                '$desc'          => '',
-               '$pls_answer'    => L10n::t('Please answer the following:'),
-               '$does_know_you' => ['knowyou', L10n::t('Does %s know you?', $ret['name']), false, '', [L10n::t('No'), L10n::t('Yes')]],
-               '$add_note'      => L10n::t('Add a personal note:'),
+               '$pls_answer'    => DI::l10n()->t('Please answer the following:'),
+               '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name']), false, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
+               '$add_note'      => DI::l10n()->t('Add a personal note:'),
                '$page_desc'     => '',
                '$friendica'     => '',
                '$statusnet'     => '',
                '$diaspora'      => '',
                '$diasnote'      => '',
-               '$your_address'  => L10n::t('Your Identity Address:'),
+               '$your_address'  => DI::l10n()->t('Your Identity Address:'),
                '$invite_desc'   => '',
                '$emailnet'      => '',
                '$submit'        => $submit,
-               '$cancel'        => L10n::t('Cancel'),
+               '$cancel'        => DI::l10n()->t('Cancel'),
                '$nickname'      => '',
                '$name'          => $ret['name'],
                '$url'           => $ret['url'],
                '$zrl'           => Profile::zrl($ret['url']),
-               '$url_label'     => L10n::t('Profile URL'),
+               '$url_label'     => DI::l10n()->t('Profile URL'),
                '$myaddr'        => $myaddr,
                '$request'       => $request,
                '$keywords'      => $r[0]['keywords'],
-               '$keywords_label'=> L10n::t('Tags:')
+               '$keywords_label'=> DI::l10n()->t('Tags:')
        ]);
 
        DI::page()['aside'] = '';
@@ -193,7 +193,7 @@ function follow_content(App $a)
 
        if ($gcontact_id <> 0) {
                $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'),
-                       ['$title' => L10n::t('Status Messages and Posts')]
+                       ['$title' => DI::l10n()->t('Status Messages and Posts')]
                );
 
                // Show last public posts
index d41363ad7b38d153043b2afa7484bff30fdd8370..f7c1930cca7db2a2b63df548a79ee8310cf292d3 100644 (file)
@@ -29,7 +29,7 @@ function fsuggest_post(App $a)
 
        // We do query the "uid" as well to ensure that it is our contact
        if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) {
-               notice(L10n::t('Contact not found.') . EOL);
+               notice(DI::l10n()->t('Contact not found.') . EOL);
                return;
        }
 
@@ -41,7 +41,7 @@ function fsuggest_post(App $a)
        // We do query the "uid" as well to ensure that it is our contact
        $contact = DBA::selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]);
        if (!DBA::isResult($contact)) {
-               notice(L10n::t('Suggested contact not found.') . EOL);
+               notice(DI::l10n()->t('Suggested contact not found.') . EOL);
                return;
        }
 
@@ -54,13 +54,13 @@ function fsuggest_post(App $a)
 
        Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, DBA::lastInsertId());
 
-       info(L10n::t('Friend suggestion sent.') . EOL);
+       info(DI::l10n()->t('Friend suggestion sent.') . EOL);
 }
 
 function fsuggest_content(App $a)
 {
        if (! local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -72,13 +72,13 @@ function fsuggest_content(App $a)
 
        $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]);
        if (! DBA::isResult($contact)) {
-               notice(L10n::t('Contact not found.') . EOL);
+               notice(DI::l10n()->t('Contact not found.') . EOL);
                return;
        }
 
-       $o = '<h3>' . L10n::t('Suggest Friends') . '</h3>';
+       $o = '<h3>' . DI::l10n()->t('Suggest Friends') . '</h3>';
 
-       $o .= '<div id="fsuggest-desc" >' . L10n::t('Suggest a friend for %s', $contact['name']) . '</div>';
+       $o .= '<div id="fsuggest-desc" >' . DI::l10n()->t('Suggest a friend for %s', $contact['name']) . '</div>';
 
        $o .= '<form id="fsuggest-form" action="fsuggest/' . $contact_id . '" method="post" >';
 
@@ -89,7 +89,7 @@ function fsuggest_content(App $a)
        );
 
 
-       $o .= '<div id="fsuggest-submit-wrapper"><input id="fsuggest-submit" type="submit" name="submit" value="' . L10n::t('Submit') . '" /></div>';
+       $o .= '<div id="fsuggest-submit-wrapper"><input id="fsuggest-submit" type="submit" name="submit" value="' . DI::l10n()->t('Submit') . '" /></div>';
        $o .= '</form>';
 
        return $o;
index 90d8f3eadac3d0880d046897fb61dd05880b666e..a639886ad2402d07db37a5943591ec35ddbd3816 100644 (file)
@@ -123,7 +123,7 @@ function item_post(App $a) {
                }
 
                if (!DBA::isResult($toplevel_item)) {
-                       notice(L10n::t('Unable to locate original post.') . EOL);
+                       notice(DI::l10n()->t('Unable to locate original post.') . EOL);
                        if (!empty($_REQUEST['return'])) {
                                DI::baseUrl()->redirect($return_path);
                        }
@@ -170,7 +170,7 @@ function item_post(App $a) {
 
        // Now check that valid personal details have been provided
        if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
 
                if (!empty($_REQUEST['return'])) {
                        DI::baseUrl()->redirect($return_path);
@@ -325,7 +325,7 @@ function item_post(App $a) {
                        if ($preview) {
                                exit();
                        }
-                       info(L10n::t('Empty post discarded.') . EOL);
+                       info(DI::l10n()->t('Empty post discarded.') . EOL);
                        if (!empty($_REQUEST['return'])) {
                                DI::baseUrl()->redirect($return_path);
                        }
@@ -797,14 +797,14 @@ function item_post(App $a) {
                                if (!strlen($addr)) {
                                        continue;
                                }
-                               $disclaimer = '<hr />' . L10n::t('This message was sent to you by %s, a member of the Friendica social network.', $a->user['username'])
+                               $disclaimer = '<hr />' . DI::l10n()->t('This message was sent to you by %s, a member of the Friendica social network.', $a->user['username'])
                                        . '<br />';
-                               $disclaimer .= L10n::t('You may visit them online at %s', DI::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
-                               $disclaimer .= L10n::t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
+                               $disclaimer .= DI::l10n()->t('You may visit them online at %s', DI::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
+                               $disclaimer .= DI::l10n()->t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
                                if (!$datarray['title']=='') {
                                        $subject = Email::encodeHeader($datarray['title'], 'UTF-8');
                                } else {
-                                       $subject = Email::encodeHeader('[Friendica]' . ' ' . L10n::t('%s posted an update.', $a->user['username']), 'UTF-8');
+                                       $subject = Email::encodeHeader('[Friendica]' . ' ' . DI::l10n()->t('%s posted an update.', $a->user['username']), 'UTF-8');
                                }
                                $link = '<a href="' . DI::baseUrl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
                                $html    = Item::prepareBody($datarray);
index fc9fed306699ac270151915a4420794fac3fd3b7..aeee5a76252b980c4020efa946eac7fbc015474b 100644 (file)
@@ -45,7 +45,7 @@ function lockview_content(App $a)
        Hook::callAll('lockview_content', $item);
 
        if ($item['uid'] != local_user()) {
-               echo L10n::t('Remote privacy information not available.') . '<br />';
+               echo DI::l10n()->t('Remote privacy information not available.') . '<br />';
                exit();
        }
 
@@ -56,7 +56,7 @@ function lockview_content(App $a)
                && empty($item['deny_cid'])
                && empty($item['deny_gid']))
        {
-               echo L10n::t('Remote privacy information not available.') . '<br />';
+               echo DI::l10n()->t('Remote privacy information not available.') . '<br />';
                exit();
        }
 
@@ -67,19 +67,19 @@ function lockview_content(App $a)
        $deny_users = $aclFormatter->expand($item['deny_cid']);
        $deny_groups = $aclFormatter->expand($item['deny_gid']);
 
-       $o = L10n::t('Visible to:') . '<br />';
+       $o = DI::l10n()->t('Visible to:') . '<br />';
        $l = [];
 
        if (count($allowed_groups)) {
                $key = array_search(Group::FOLLOWERS, $allowed_groups);
                if ($key !== false) {
-                       $l[] = '<b>' . L10n::t('Followers') . '</b>';
+                       $l[] = '<b>' . DI::l10n()->t('Followers') . '</b>';
                        unset($allowed_groups[$key]);
                }
 
                $key = array_search(Group::MUTUALS, $allowed_groups);
                if ($key !== false) {
-                       $l[] = '<b>' . L10n::t('Mutuals') . '</b>';
+                       $l[] = '<b>' . DI::l10n()->t('Mutuals') . '</b>';
                        unset($allowed_groups[$key]);
                }
 
@@ -108,13 +108,13 @@ function lockview_content(App $a)
        if (count($deny_groups)) {
                $key = array_search(Group::FOLLOWERS, $deny_groups);
                if ($key !== false) {
-                       $l[] = '<b><strike>' . L10n::t('Followers') . '</strike></b>';
+                       $l[] = '<b><strike>' . DI::l10n()->t('Followers') . '</strike></b>';
                        unset($deny_groups[$key]);
                }
 
                $key = array_search(Group::MUTUALS, $deny_groups);
                if ($key !== false) {
-                       $l[] = '<b><strike>' . L10n::t('Mutuals') . '</strike></b>';
+                       $l[] = '<b><strike>' . DI::l10n()->t('Mutuals') . '</strike></b>';
                        unset($deny_groups[$key]);
                }
 
index 81bcad79c97b275576ec91b725dc528575be96ff..cf6801d708e76573fb3ebf75f0986c0c07d21a66 100644 (file)
@@ -24,7 +24,7 @@ function lostpass_post(App $a)
        $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
        $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
        if (!DBA::isResult($user)) {
-               notice(L10n::t('No valid account found.') . EOL);
+               notice(DI::l10n()->t('No valid account found.') . EOL);
                DI::baseUrl()->redirect();
        }
 
@@ -36,13 +36,13 @@ function lostpass_post(App $a)
        ];
        $result = DBA::update('user', $fields, ['uid' => $user['uid']]);
        if ($result) {
-               info(L10n::t('Password reset request issued. Check your email.') . EOL);
+               info(DI::l10n()->t('Password reset request issued. Check your email.') . EOL);
        }
 
        $sitename = Config::get('config', 'sitename');
        $resetlink = DI::baseUrl() . '/lostpass/' . $pwdreset_token;
 
-       $preamble = Strings::deindent(L10n::t('
+       $preamble = Strings::deindent(DI::l10n()->t('
                Dear %1$s,
                        A request was recently received at "%2$s" to reset your account
                password. In order to confirm this request, please select the verification link
@@ -53,7 +53,7 @@ function lostpass_post(App $a)
 
                Your password will not be changed unless we can verify that you
                issued this request.', $user['username'], $sitename));
-       $body = Strings::deindent(L10n::t('
+       $body = Strings::deindent(DI::l10n()->t('
                Follow this link soon to verify your identity:
 
                %1$s
@@ -72,7 +72,7 @@ function lostpass_post(App $a)
                'to_name'  => $user['username'],
                'to_email' => $user['email'],
                'uid'      => $user['uid'],
-               'subject'  => L10n::t('Password reset requested at %s', $sitename),
+               'subject'  => DI::l10n()->t('Password reset requested at %s', $sitename),
                'preamble' => $preamble,
                'body'     => $body
        ]);
@@ -87,7 +87,7 @@ function lostpass_content(App $a)
 
                $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => $pwdreset_token]);
                if (!DBA::isResult($user)) {
-                       notice(L10n::t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
+                       notice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
 
                        return lostpass_form();
                }
@@ -100,7 +100,7 @@ function lostpass_content(App $a)
                        ];
                        DBA::update('user', $fields, ['uid' => $user['uid']]);
 
-                       notice(L10n::t('Request has expired, please make a new one.'));
+                       notice(DI::l10n()->t('Request has expired, please make a new one.'));
 
                        return lostpass_form();
                }
@@ -115,10 +115,10 @@ function lostpass_form()
 {
        $tpl = Renderer::getMarkupTemplate('lostpass.tpl');
        $o = Renderer::replaceMacros($tpl, [
-               '$title' => L10n::t('Forgot your Password?'),
-               '$desc' => L10n::t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
-               '$name' => L10n::t('Nickname or Email: '),
-               '$submit' => L10n::t('Reset')
+               '$title' => DI::l10n()->t('Forgot your Password?'),
+               '$desc' => DI::l10n()->t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
+               '$name' => DI::l10n()->t('Nickname or Email: '),
+               '$submit' => DI::l10n()->t('Reset')
        ]);
 
        return $o;
@@ -133,25 +133,25 @@ function lostpass_generate_password($user)
        if (DBA::isResult($result)) {
                $tpl = Renderer::getMarkupTemplate('pwdreset.tpl');
                $o .= Renderer::replaceMacros($tpl, [
-                       '$lbl1'    => L10n::t('Password Reset'),
-                       '$lbl2'    => L10n::t('Your password has been reset as requested.'),
-                       '$lbl3'    => L10n::t('Your new password is'),
-                       '$lbl4'    => L10n::t('Save or copy your new password - and then'),
-                       '$lbl5'    => '<a href="' . DI::baseUrl() . '">' . L10n::t('click here to login') . '</a>.',
-                       '$lbl6'    => L10n::t('Your password may be changed from the <em>Settings</em> page after successful login.'),
+                       '$lbl1'    => DI::l10n()->t('Password Reset'),
+                       '$lbl2'    => DI::l10n()->t('Your password has been reset as requested.'),
+                       '$lbl3'    => DI::l10n()->t('Your new password is'),
+                       '$lbl4'    => DI::l10n()->t('Save or copy your new password - and then'),
+                       '$lbl5'    => '<a href="' . DI::baseUrl() . '">' . DI::l10n()->t('click here to login') . '</a>.',
+                       '$lbl6'    => DI::l10n()->t('Your password may be changed from the <em>Settings</em> page after successful login.'),
                        '$newpass' => $new_password,
                ]);
 
                info("Your password has been reset." . EOL);
 
                $sitename = Config::get('config', 'sitename');
-               $preamble = Strings::deindent(L10n::t('
+               $preamble = Strings::deindent(DI::l10n()->t('
                        Dear %1$s,
                                Your password has been changed as requested. Please retain this
                        information for your records ' . "\x28" . 'or change your password immediately to
                        something that you will remember' . "\x29" . '.
                ', $user['username']));
-               $body = Strings::deindent(L10n::t('
+               $body = Strings::deindent(DI::l10n()->t('
                        Your login details are as follows:
 
                        Site Location:  %1$s
@@ -167,7 +167,7 @@ function lostpass_generate_password($user)
                        'to_name'  => $user['username'],
                        'to_email' => $user['email'],
                        'uid'      => $user['uid'],
-                       'subject'  => L10n::t('Your password has been changed at %s', $sitename),
+                       'subject'  => DI::l10n()->t('Your password has been changed at %s', $sitename),
                        'preamble' => $preamble,
                        'body'     => $body
                ]);
index 0bfe8fd30556ac6dab2be22122ffb6dd67975168..c187546b32d77eb09350c34592855dc40be82d5d 100644 (file)
@@ -46,7 +46,7 @@ function match_content(App $a)
                return '';
        }
        if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) {
-               notice(L10n::t('No keywords to match. Please add keywords to your default profile.') . EOL);
+               notice(DI::l10n()->t('No keywords to match. Please add keywords to your default profile.') . EOL);
                return '';
        }
 
@@ -84,8 +84,8 @@ function match_content(App $a)
 
                        $connlnk = DI::baseUrl() . '/follow/?url=' . $profile->url;
                        $photo_menu = [
-                               'profile' => [L10n::t("View Profile"), Contact::magicLink($profile->url)],
-                               'follow' => [L10n::t("Connect/Follow"), $connlnk]
+                               'profile' => [DI::l10n()->t("View Profile"), Contact::magicLink($profile->url)],
+                               'follow' => [DI::l10n()->t("Connect/Follow"), $connlnk]
                        ];
 
                        $contact_details = Contact::getDetailsByURL($profile->url, 0);
@@ -99,7 +99,7 @@ function match_content(App $a)
                                'about'        => $contact_details['about'] ?? '',
                                'account_type' => Contact::getAccountType($contact_details),
                                'thumb'        => ProxyUtils::proxifyUrl($profile->photo, false, ProxyUtils::SIZE_THUMB),
-                               'conntxt'      => L10n::t('Connect'),
+                               'conntxt'      => DI::l10n()->t('Connect'),
                                'connlnk'      => $connlnk,
                                'img_hover'    => $profile->tags,
                                'photo_menu'   => $photo_menu,
@@ -112,12 +112,12 @@ function match_content(App $a)
                        'class' => 'pager',
                        'first' => [
                                'url'   => 'match',
-                               'text'  => L10n::t('first'),
+                               'text'  => DI::l10n()->t('first'),
                                'class' => 'previous' . ($start == 0 ? 'disabled' : '')
                        ],
                        'next'  => [
                                'url'   => 'match?start=' . $i,
-                               'text'  => L10n::t('next'),
+                               'text'  => DI::l10n()->t('next'),
                                'class' =>  'next' . ($i >= $msearch->total ? ' disabled' : '')
                        ]
                ];
@@ -127,12 +127,12 @@ function match_content(App $a)
        }
 
        if (empty($entries)) {
-               info(L10n::t('No matches') . EOL);
+               info(DI::l10n()->t('No matches') . EOL);
        }
 
        $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
        $o = Renderer::replaceMacros($tpl, [
-               '$title'    => L10n::t('Profile Match'),
+               '$title'    => DI::l10n()->t('Profile Match'),
                '$contacts' => $entries,
                '$paginate' => $paginate
        ]);
index 3d378f5158c3dde10ed88d48fc270ac9701fa42c..06203b8394525da5e539a66970417de5818d502d 100644 (file)
@@ -29,7 +29,7 @@ function message_init(App $a)
        }
 
        $new = [
-               'label' => L10n::t('New Message'),
+               'label' => DI::l10n()->t('New Message'),
                'url' => 'message/new',
                'sel' => $a->argc > 1 && $a->argv[1] == 'new',
                'accesskey' => 'm',
@@ -52,7 +52,7 @@ function message_init(App $a)
 function message_post(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -66,20 +66,20 @@ function message_post(App $a)
 
        switch ($ret) {
                case -1:
-                       notice(L10n::t('No recipient selected.') . EOL);
+                       notice(DI::l10n()->t('No recipient selected.') . EOL);
                        $norecip = true;
                        break;
                case -2:
-                       notice(L10n::t('Unable to locate contact information.') . EOL);
+                       notice(DI::l10n()->t('Unable to locate contact information.') . EOL);
                        break;
                case -3:
-                       notice(L10n::t('Message could not be sent.') . EOL);
+                       notice(DI::l10n()->t('Message could not be sent.') . EOL);
                        break;
                case -4:
-                       notice(L10n::t('Message collection failure.') . EOL);
+                       notice(DI::l10n()->t('Message collection failure.') . EOL);
                        break;
                default:
-                       info(L10n::t('Message sent.') . EOL);
+                       info(DI::l10n()->t('Message sent.') . EOL);
        }
 
        // fake it to go back to the input form if no recipient listed
@@ -97,7 +97,7 @@ function message_content(App $a)
        Nav::setSelected('messages');
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return Login::form();
        }
 
@@ -106,20 +106,20 @@ function message_content(App $a)
        $tpl = Renderer::getMarkupTemplate('mail_head.tpl');
        if ($a->argc > 1 && $a->argv[1] == 'new') {
                $button = [
-                       'label' => L10n::t('Discard'),
+                       'label' => DI::l10n()->t('Discard'),
                        'url' => '/message',
                        'sel' => 'close',
                ];
        } else {
                $button = [
-                       'label' => L10n::t('New Message'),
+                       'label' => DI::l10n()->t('New Message'),
                        'url' => '/message/new',
                        'sel' => 'new',
                        'accesskey' => 'm',
                ];
        }
        $header = Renderer::replaceMacros($tpl, [
-               '$messages' => L10n::t('Messages'),
+               '$messages' => DI::l10n()->t('Messages'),
                '$button' => $button,
        ]);
 
@@ -144,12 +144,12 @@ function message_content(App $a)
                        //DI::page()['aside'] = '';
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'get',
-                               '$message' => L10n::t('Do you really want to delete this message?'),
+                               '$message' => DI::l10n()->t('Do you really want to delete this message?'),
                                '$extra_inputs' => $inputs,
-                               '$confirm' => L10n::t('Yes'),
+                               '$confirm' => DI::l10n()->t('Yes'),
                                '$confirm_url' => $query['base'],
                                '$confirm_name' => 'confirmed',
-                               '$cancel' => L10n::t('Cancel'),
+                               '$cancel' => DI::l10n()->t('Cancel'),
                        ]);
                }
 
@@ -162,17 +162,17 @@ function message_content(App $a)
                if ($cmd === 'drop') {
                        $message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
                        if(!DBA::isResult($message)){
-                               info(L10n::t('Conversation not found.') . EOL);
+                               info(DI::l10n()->t('Conversation not found.') . EOL);
                                DI::baseUrl()->redirect('message');
                        }
 
                        if (DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
-                               info(L10n::t('Message deleted.') . EOL);
+                               info(DI::l10n()->t('Message deleted.') . EOL);
                        }
 
                        $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
                        if(!DBA::isResult($conversation)){
-                               info(L10n::t('Conversation removed.') . EOL);
+                               info(DI::l10n()->t('Conversation removed.') . EOL);
                                DI::baseUrl()->redirect('message');
                        }
 
@@ -186,7 +186,7 @@ function message_content(App $a)
                                $parent = $r[0]['parent-uri'];
 
                                if (DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
-                                       info(L10n::t('Conversation removed.') . EOL);
+                                       info(DI::l10n()->t('Conversation removed.') . EOL);
                                }
                        }
                        DI::baseUrl()->redirect('message');
@@ -200,7 +200,7 @@ function message_content(App $a)
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
                        '$baseurl' => DI::baseUrl()->get(true),
                        '$nickname' => $a->user['nickname'],
-                       '$linkurl' => L10n::t('Please enter a link URL:')
+                       '$linkurl' => DI::l10n()->t('Please enter a link URL:')
                ]);
 
                $preselect = isset($a->argv[2]) ? [$a->argv[2]] : [];
@@ -242,22 +242,22 @@ function message_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('prv_message.tpl');
                $o .= Renderer::replaceMacros($tpl, [
-                       '$header'     => L10n::t('Send Private Message'),
-                       '$to'         => L10n::t('To:'),
+                       '$header'     => DI::l10n()->t('Send Private Message'),
+                       '$to'         => DI::l10n()->t('To:'),
                        '$showinputs' => 'true',
                        '$prefill'    => $prefill,
                        '$preid'      => $preid,
-                       '$subject'    => L10n::t('Subject:'),
+                       '$subject'    => DI::l10n()->t('Subject:'),
                        '$subjtxt'    => $_REQUEST['subject'] ?? '',
                        '$text'       => $_REQUEST['body'] ?? '',
                        '$readonly'   => '',
-                       '$yourmessage'=> L10n::t('Your message:'),
+                       '$yourmessage'=> DI::l10n()->t('Your message:'),
                        '$select'     => $select,
                        '$parent'     => '',
-                       '$upload'     => L10n::t('Upload photo'),
-                       '$insert'     => L10n::t('Insert web link'),
-                       '$wait'       => L10n::t('Please wait'),
-                       '$submit'     => L10n::t('Submit')
+                       '$upload'     => DI::l10n()->t('Upload photo'),
+                       '$insert'     => DI::l10n()->t('Insert web link'),
+                       '$wait'       => DI::l10n()->t('Please wait'),
+                       '$submit'     => DI::l10n()->t('Submit')
                ]);
                return $o;
        }
@@ -285,7 +285,7 @@ function message_content(App $a)
                $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
 
                if (!DBA::isResult($r)) {
-                       info(L10n::t('No messages.') . EOL);
+                       info(DI::l10n()->t('No messages.') . EOL);
                        return $o;
                }
 
@@ -348,7 +348,7 @@ function message_content(App $a)
                }
 
                if (!DBA::isResult($messages)) {
-                       notice(L10n::t('Message not available.') . EOL);
+                       notice(DI::l10n()->t('Message not available.') . EOL);
                        return $o;
                }
 
@@ -356,7 +356,7 @@ function message_content(App $a)
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
                        '$baseurl' => DI::baseUrl()->get(true),
                        '$nickname' => $a->user['nickname'],
-                       '$linkurl' => L10n::t('Please enter a link URL:')
+                       '$linkurl' => DI::l10n()->t('Please enter a link URL:')
                ]);
 
                $mails = [];
@@ -402,9 +402,9 @@ function message_content(App $a)
                                'from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB),
                                'subject' => $subject_e,
                                'body' => $body_e,
-                               'delete' => L10n::t('Delete message'),
+                               'delete' => DI::l10n()->t('Delete message'),
                                'to_name' => $to_name_e,
-                               'date' => DateTimeFormat::local($message['created'], L10n::t('D, d M Y - g:i A')),
+                               'date' => DateTimeFormat::local($message['created'], DI::l10n()->t('D, d M Y - g:i A')),
                                'ago' => Temporal::getRelativeDate($message['created']),
                        ];
 
@@ -419,26 +419,26 @@ function message_content(App $a)
                        '$thread_id' => $a->argv[1],
                        '$thread_subject' => $message['title'],
                        '$thread_seen' => $seen,
-                       '$delete' => L10n::t('Delete conversation'),
+                       '$delete' => DI::l10n()->t('Delete conversation'),
                        '$canreply' => (($unknown) ? false : '1'),
-                       '$unknown_text' => L10n::t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
+                       '$unknown_text' => DI::l10n()->t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
                        '$mails' => $mails,
 
                        // reply
-                       '$header' => L10n::t('Send Reply'),
-                       '$to' => L10n::t('To:'),
+                       '$header' => DI::l10n()->t('Send Reply'),
+                       '$to' => DI::l10n()->t('To:'),
                        '$showinputs' => '',
-                       '$subject' => L10n::t('Subject:'),
+                       '$subject' => DI::l10n()->t('Subject:'),
                        '$subjtxt' => $message['title'],
                        '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',
-                       '$yourmessage' => L10n::t('Your message:'),
+                       '$yourmessage' => DI::l10n()->t('Your message:'),
                        '$text' => '',
                        '$select' => $select,
                        '$parent' => $parent,
-                       '$upload' => L10n::t('Upload photo'),
-                       '$insert' => L10n::t('Insert web link'),
-                       '$submit' => L10n::t('Submit'),
-                       '$wait' => L10n::t('Please wait')
+                       '$upload' => DI::l10n()->t('Upload photo'),
+                       '$insert' => DI::l10n()->t('Insert web link'),
+                       '$submit' => DI::l10n()->t('Submit'),
+                       '$wait' => DI::l10n()->t('Please wait')
                ]);
 
                return $o;
@@ -508,11 +508,11 @@ function render_messages(array $msg, $t)
 
        foreach ($msg as $rr) {
                if ($rr['unknown']) {
-                       $participants = L10n::t("Unknown sender - %s", $rr['from-name']);
+                       $participants = DI::l10n()->t("Unknown sender - %s", $rr['from-name']);
                } elseif (Strings::compareLink($rr['from-url'], $myprofile)) {
-                       $participants = L10n::t("You and %s", $rr['name']);
+                       $participants = DI::l10n()->t("You and %s", $rr['name']);
                } else {
-                       $participants = L10n::t("%s and You", $rr['from-name']);
+                       $participants = DI::l10n()->t("%s and You", $rr['from-name']);
                }
 
                $body_e = $rr['body'];
@@ -533,10 +533,10 @@ function render_messages(array $msg, $t)
                        '$sparkle' => ' sparkle',
                        '$from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB),
                        '$subject' => $rr['title'],
-                       '$delete' => L10n::t('Delete conversation'),
+                       '$delete' => DI::l10n()->t('Delete conversation'),
                        '$body' => $body_e,
                        '$to_name' => $to_name_e,
-                       '$date' => DateTimeFormat::local($rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
+                       '$date' => DateTimeFormat::local($rr['mailcreated'], DI::l10n()->t('D, d M Y - g:i A')),
                        '$ago' => Temporal::getRelativeDate($rr['mailcreated']),
                        '$seen' => $rr['mailseen'],
                        '$count' => L10n::tt('%d message', '%d messages', $rr['count']),
index 271231c5333336b102c1bb5e81b8f973f2439e7a..11650367b586398258a6e120e471ba79e47d4bb8 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
 function network_init(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -494,7 +494,7 @@ function networkThreadedView(App $a, $update, $parent)
                        notice(L10n::tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
                                "Warning: This group contains %s members from a network that doesn't allow non public messages.",
                                $t) . EOL);
-                       notice(L10n::t("Messages in this group won't be send to these receivers.").EOL);
+                       notice(DI::l10n()->t("Messages in this group won't be send to these receivers.").EOL);
                }
 
                Nav::setSelected('network');
@@ -561,7 +561,7 @@ function networkThreadedView(App $a, $update, $parent)
                        if ($update) {
                                exit();
                        }
-                       notice(L10n::t('No such group') . EOL);
+                       notice(DI::l10n()->t('No such group') . EOL);
                        DI::baseUrl()->redirect('network/0');
                        // NOTREACHED
                }
@@ -582,11 +582,11 @@ function networkThreadedView(App $a, $update, $parent)
                        $sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . Strings::protectSprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
                } else {
                        $sql_extra3 .= " AND false ";
-                       info(L10n::t('Group is empty'));
+                       info(DI::l10n()->t('Group is empty'));
                }
 
                $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
-                       '$title' => L10n::t('Group: %s', $group['name'])
+                       '$title' => DI::l10n()->t('Group: %s', $group['name'])
                ]) . $o;
        } elseif ($cid) {
                $fields = ['id', 'name', 'network', 'writable', 'nurl',
@@ -612,10 +612,10 @@ function networkThreadedView(App $a, $update, $parent)
                        ]) . $o;
 
                        if ($contact['network'] === Protocol::OSTATUS && $contact['writable'] && !DI::pConfig()->get(local_user(),'system','nowarn_insecure')) {
-                               notice(L10n::t('Private messages to this person are at risk of public disclosure.') . EOL);
+                               notice(DI::l10n()->t('Private messages to this person are at risk of public disclosure.') . EOL);
                        }
                } else {
-                       notice(L10n::t('Invalid contact.') . EOL);
+                       notice(DI::l10n()->t('Invalid contact.') . EOL);
                        DI::baseUrl()->redirect('network');
                        // NOTREACHED
                }
@@ -899,38 +899,38 @@ function network_tabs(App $a)
        // tabs
        $tabs = [
                [
-                       'label' => L10n::t('Latest Activity'),
+                       'label' => DI::l10n()->t('Latest Activity'),
                        'url'   => $cmd . '?' . http_build_query(array_merge($def_param, ['order' => 'activity'])),
                        'sel'   => $all_active,
-                       'title' => L10n::t('Sort by latest activity'),
+                       'title' => DI::l10n()->t('Sort by latest activity'),
                        'id'    => 'activity-order-tab',
                        'accesskey' => 'e',
                ],
                [
-                       'label' => L10n::t('Latest Posts'),
+                       'label' => DI::l10n()->t('Latest Posts'),
                        'url'   => $cmd . '?' . http_build_query(array_merge($def_param, ['order' => 'post'])),
                        'sel'   => $post_active,
-                       'title' => L10n::t('Sort by post received date'),
+                       'title' => DI::l10n()->t('Sort by post received date'),
                        'id'    => 'post-order-tab',
                        'accesskey' => 't',
                ],
        ];
 
        $tabs[] = [
-               'label' => L10n::t('Personal'),
+               'label' => DI::l10n()->t('Personal'),
                'url'   => $cmd . '?' . http_build_query(array_merge($def_param, ['conv' => true])),
                'sel'   => $conv_active,
-               'title' => L10n::t('Posts that mention or involve you'),
+               'title' => DI::l10n()->t('Posts that mention or involve you'),
                'id'    => 'personal-tab',
                'accesskey' => 'r',
        ];
 
        if (Feature::isEnabled(local_user(), 'new_tab')) {
                $tabs[] = [
-                       'label' => L10n::t('New'),
+                       'label' => DI::l10n()->t('New'),
                        'url'   => $cmd . '?' . http_build_query(array_merge($def_param, ['new' => true])),
                        'sel'   => $new_active,
-                       'title' => L10n::t('Activity Stream - by date'),
+                       'title' => DI::l10n()->t('Activity Stream - by date'),
                        'id'    => 'activitiy-by-date-tab',
                        'accesskey' => 'w',
                ];
@@ -938,20 +938,20 @@ function network_tabs(App $a)
 
        if (Feature::isEnabled(local_user(), 'link_tab')) {
                $tabs[] = [
-                       'label' => L10n::t('Shared Links'),
+                       'label' => DI::l10n()->t('Shared Links'),
                        'url'   => $cmd . '?' . http_build_query(array_merge($def_param, ['bmark' => true])),
                        'sel'   => $bookmarked_active,
-                       'title' => L10n::t('Interesting Links'),
+                       'title' => DI::l10n()->t('Interesting Links'),
                        'id'    => 'shared-links-tab',
                        'accesskey' => 'b',
                ];
        }
 
        $tabs[] = [
-               'label' => L10n::t('Starred'),
+               'label' => DI::l10n()->t('Starred'),
                'url'   => $cmd . '?' . http_build_query(array_merge($def_param, ['star' => true])),
                'sel'   => $starred_active,
-               'title' => L10n::t('Favourite Posts'),
+               'title' => DI::l10n()->t('Favourite Posts'),
                'id'    => 'starred-posts-tab',
                'accesskey' => 'm',
        ];
index 4a19ab5ca840bdbbe90f9702b2fe830ac704f4bc..223e030232aa567ed91a865a822218d4373c1f47 100644 (file)
@@ -25,14 +25,14 @@ function notes_init(App $a)
 function notes_content(App $a, $update = false)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
        $o = Profile::getTabs($a, 'notes', true);
 
        if (!$update) {
-               $o .= '<h3>' . L10n::t('Personal Notes') . '</h3>';
+               $o .= '<h3>' . DI::l10n()->t('Personal Notes') . '</h3>';
 
                $x = [
                        'is_owner' => true,
@@ -44,7 +44,7 @@ function notes_content(App $a, $update = false)
                        'bang' => '',
                        'visitor' => 'block',
                        'profile_uid' => local_user(),
-                       'button' => L10n::t('Save'),
+                       'button' => DI::l10n()->t('Save'),
                        'acl_data' => '',
                ];
 
index e306f0c8a64d2cf86a41d6c719c6112fa6d560d8..634a6d74a2cc833a0d516e01a8cbe90888f1cfdb 100644 (file)
@@ -34,10 +34,10 @@ function notifications_post(App $a)
                $intro = DI::intro()->selectFirst(['id' => $request_id, 'uid' => local_user()]);
 
                switch ($_POST['submit']) {
-                       case L10n::t('Discard'):
+                       case DI::l10n()->t('Discard'):
                                $intro->discard();
                                break;
-                       case L10n::t('Ignore'):
+                       case DI::l10n()->t('Ignore'):
                                $intro->ignore();
                                break;
                }
@@ -49,7 +49,7 @@ function notifications_post(App $a)
 function notifications_content(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return Login::form();
        }
 
@@ -72,7 +72,7 @@ function notifications_content(App $a)
        $perpage = 20;
        $startrec = ($page * $perpage) - $perpage;
 
-       $notif_header = L10n::t('Notifications');
+       $notif_header = DI::l10n()->t('Notifications');
 
        $all = false;
 
@@ -91,22 +91,22 @@ function notifications_content(App $a)
 
        // Get the network notifications
        } elseif (($a->argc > 1) && ($a->argv[1] == 'network')) {
-               $notif_header = L10n::t('Network Notifications');
+               $notif_header = DI::l10n()->t('Network Notifications');
                $notifs = $nm->getNetworkList($show, $startrec, $perpage);
 
        // Get the system notifications
        } elseif (($a->argc > 1) && ($a->argv[1] == 'system')) {
-               $notif_header = L10n::t('System Notifications');
+               $notif_header = DI::l10n()->t('System Notifications');
                $notifs = $nm->getSystemList($show, $startrec, $perpage);
 
        // Get the personal notifications
        } elseif (($a->argc > 1) && ($a->argv[1] == 'personal')) {
-               $notif_header = L10n::t('Personal Notifications');
+               $notif_header = DI::l10n()->t('Personal Notifications');
                $notifs = $nm->getPersonalList($show, $startrec, $perpage);
 
        // Get the home notifications
        } elseif (($a->argc > 1) && ($a->argv[1] == 'home')) {
-               $notif_header = L10n::t('Home Notifications');
+               $notif_header = DI::l10n()->t('Home Notifications');
                $notifs = $nm->getHomeList($show, $startrec, $perpage);
        // fallback - redirect to main page
        } else {
@@ -129,7 +129,7 @@ function notifications_content(App $a)
 
        $notif_show_lnk = [
                'href' => ($show ? 'notifications/' . $notifs['ident'] : 'notifications/' . $notifs['ident'] . '?show=all' ),
-               'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
+               'text' => ($show ? DI::l10n()->t('Show unread') : DI::l10n()->t('Show all')),
        ];
 
        // Process the data for template creation
@@ -140,7 +140,7 @@ function notifications_content(App $a)
                // The link to switch between ignored and normal connection requests
                $notif_show_lnk = [
                        'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros' ),
-                       'text' => (!$all ? L10n::t('Show Ignored Requests') : L10n::t('Hide Ignored Requests'))
+                       'text' => (!$all ? DI::l10n()->t('Show Ignored Requests') : DI::l10n()->t('Hide Ignored Requests'))
                ];
 
                // Loop through all introduction notifications.This creates an array with the output html for each
@@ -153,10 +153,10 @@ function notifications_content(App $a)
                                case 'friend_suggestion':
                                        $notif_content[] = Renderer::replaceMacros($sugg, [
                                                '$type'       => $notif['label'],
-                                               '$str_notifytype' => L10n::t('Notification type:'),
+                                               '$str_notifytype' => DI::l10n()->t('Notification type:'),
                                                '$notify_type'=> $notif['notify_type'],
                                                '$intro_id'   => $notif['intro_id'],
-                                               '$lbl_madeby' => L10n::t('Suggested by:'),
+                                               '$lbl_madeby' => DI::l10n()->t('Suggested by:'),
                                                '$madeby'     => $notif['madeby'],
                                                '$madeby_url' => $notif['madeby_url'],
                                                '$madeby_zrl' => $notif['madeby_zrl'],
@@ -166,15 +166,15 @@ function notifications_content(App $a)
                                                '$fullname'   => $notif['name'],
                                                '$url'        => $notif['url'],
                                                '$zrl'        => $notif['zrl'],
-                                               '$lbl_url'    => L10n::t('Profile URL'),
+                                               '$lbl_url'    => DI::l10n()->t('Profile URL'),
                                                '$addr'       => $notif['addr'],
-                                               '$hidden'     => ['hidden', L10n::t('Hide this contact from others'), ($notif['hidden'] == 1), ''],
+                                               '$hidden'     => ['hidden', DI::l10n()->t('Hide this contact from others'), ($notif['hidden'] == 1), ''],
                                                '$knowyou'    => $notif['knowyou'],
-                                               '$approve'    => L10n::t('Approve'),
+                                               '$approve'    => DI::l10n()->t('Approve'),
                                                '$note'       => $notif['note'],
                                                '$request'    => $notif['request'],
-                                               '$ignore'     => L10n::t('Ignore'),
-                                               '$discard'    => L10n::t('Discard'),
+                                               '$ignore'     => DI::l10n()->t('Ignore'),
+                                               '$discard'    => DI::l10n()->t('Discard'),
                                        ]);
                                        break;
 
@@ -190,15 +190,15 @@ function notifications_content(App $a)
                                        $helptext3   = '';
 
                                        if ($notif['network'] === Protocol::DFRN) {
-                                               $lbl_knowyou = L10n::t('Claims to be known to you: ');
-                                               $knowyou   = (($notif['knowyou']) ? L10n::t('yes') : L10n::t('no'));
-                                               $helptext  = L10n::t('Shall your connection be bidirectional or not?');
-                                               $helptext2 = L10n::t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notif['name'], $notif['name']);
-                                               $helptext3 = L10n::t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notif['name']);
+                                               $lbl_knowyou = DI::l10n()->t('Claims to be known to you: ');
+                                               $knowyou   = (($notif['knowyou']) ? DI::l10n()->t('yes') : DI::l10n()->t('no'));
+                                               $helptext  = DI::l10n()->t('Shall your connection be bidirectional or not?');
+                                               $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notif['name'], $notif['name']);
+                                               $helptext3 = DI::l10n()->t('Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notif['name']);
                                        } elseif ($notif['network'] === Protocol::DIASPORA) {
-                                               $helptext  = L10n::t('Shall your connection be bidirectional or not?');
-                                               $helptext2 = L10n::t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notif['name'], $notif['name']);
-                                               $helptext3 = L10n::t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notif['name']);
+                                               $helptext  = DI::l10n()->t('Shall your connection be bidirectional or not?');
+                                               $helptext2 = DI::l10n()->t('Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed.', $notif['name'], $notif['name']);
+                                               $helptext3 = DI::l10n()->t('Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed.', $notif['name']);
                                        }
 
                                        $dfrn_tpl = Renderer::getMarkupTemplate('netfriend.tpl');
@@ -209,8 +209,8 @@ function notifications_content(App $a)
                                                '$approve_as1' => $helptext,
                                                '$approve_as2' => $helptext2,
                                                '$approve_as3' => $helptext3,
-                                               '$as_friend'   => L10n::t('Friend'),
-                                               '$as_fan'      => (($notif['network'] == Protocol::DIASPORA) ? L10n::t('Sharer') : L10n::t('Subscriber'))
+                                               '$as_friend'   => DI::l10n()->t('Friend'),
+                                               '$as_fan'      => (($notif['network'] == Protocol::DIASPORA) ? DI::l10n()->t('Sharer') : DI::l10n()->t('Subscriber'))
                                        ]);
 
                                        $contact = DBA::selectFirst('contact', ['network', 'protocol'], ['id' => $notif['contact_id']]);
@@ -230,7 +230,7 @@ function notifications_content(App $a)
                                        $header .= ' (' . ContactSelector::networkToName($notif['network'], $notif['url']) . ')';
 
                                        if ($notif['network'] != Protocol::DIASPORA) {
-                                               $discard = L10n::t('Discard');
+                                               $discard = DI::l10n()->t('Discard');
                                        } else {
                                                $discard = '';
                                        }
@@ -238,7 +238,7 @@ function notifications_content(App $a)
                                        $notif_content[] = Renderer::replaceMacros($tpl, [
                                                '$type'        => $notif['label'],
                                                '$header'      => $header,
-                                               '$str_notifytype' => L10n::t('Notification type:'),
+                                               '$str_notifytype' => DI::l10n()->t('Notification type:'),
                                                '$notify_type' => $notif['notify_type'],
                                                '$dfrn_text'   => $dfrn_text,
                                                '$dfrn_id'     => $notif['dfrn_id'],
@@ -248,25 +248,25 @@ function notifications_content(App $a)
                                                '$photo'       => $notif['photo'],
                                                '$fullname'    => $notif['name'],
                                                '$location'    => $notif['location'],
-                                               '$lbl_location'=> L10n::t('Location:'),
+                                               '$lbl_location'=> DI::l10n()->t('Location:'),
                                                '$about'       => $notif['about'],
-                                               '$lbl_about'   => L10n::t('About:'),
+                                               '$lbl_about'   => DI::l10n()->t('About:'),
                                                '$keywords'    => $notif['keywords'],
-                                               '$lbl_keywords'=> L10n::t('Tags:'),
+                                               '$lbl_keywords'=> DI::l10n()->t('Tags:'),
                                                '$gender'      => $notif['gender'],
-                                               '$lbl_gender'  => L10n::t('Gender:'),
-                                               '$hidden'      => ['hidden', L10n::t('Hide this contact from others'), ($notif['hidden'] == 1), ''],
+                                               '$lbl_gender'  => DI::l10n()->t('Gender:'),
+                                               '$hidden'      => ['hidden', DI::l10n()->t('Hide this contact from others'), ($notif['hidden'] == 1), ''],
                                                '$url'         => $notif['url'],
                                                '$zrl'         => $notif['zrl'],
-                                               '$lbl_url'     => L10n::t('Profile URL'),
+                                               '$lbl_url'     => DI::l10n()->t('Profile URL'),
                                                '$addr'        => $notif['addr'],
                                                '$lbl_knowyou' => $lbl_knowyou,
-                                               '$lbl_network' => L10n::t('Network:'),
+                                               '$lbl_network' => DI::l10n()->t('Network:'),
                                                '$network'     => ContactSelector::networkToName($notif['network'], $notif['url']),
                                                '$knowyou'     => $knowyou,
-                                               '$approve'     => L10n::t('Approve'),
+                                               '$approve'     => DI::l10n()->t('Approve'),
                                                '$note'        => $notif['note'],
-                                               '$ignore'      => L10n::t('Ignore'),
+                                               '$ignore'      => DI::l10n()->t('Ignore'),
                                                '$discard'     => $discard,
                                                '$action'      => $action,
                                        ]);
@@ -275,7 +275,7 @@ function notifications_content(App $a)
                }
 
                if (count($notifs['notifications']) == 0) {
-                       info(L10n::t('No introductions.') . EOL);
+                       info(DI::l10n()->t('No introductions.') . EOL);
                }
 
                // Normal notifications (no introductions)
@@ -309,7 +309,7 @@ function notifications_content(App $a)
                        ]);
                }
        } else {
-               $notif_nocontent = L10n::t('No more %s notifications.', $notifs['ident']);
+               $notif_nocontent = DI::l10n()->t('No more %s notifications.', $notifs['ident']);
        }
 
        $o .= Renderer::replaceMacros($notif_tpl, [
index 10d48338a436aabe6ca335737158d77b6f9edea2..d1b5523a42f373b4e05f9027e75318cf159a0770 100644 (file)
@@ -29,7 +29,7 @@ function oexchange_content(App $a) {
        }
 
        if (($a->argc > 1) && $a->argv[1] === 'done') {
-               info(L10n::t('Post successful.') . EOL);
+               info(DI::l10n()->t('Post successful.') . EOL);
                return;
        }
 
index f6d826e85a5b406cd785008018e326996ec8110a..a6c7d9da47f15f16f595bac8e3ae1d375ed0bb08 100644 (file)
@@ -14,12 +14,12 @@ use Friendica\Util\Network;
 function ostatus_subscribe_content(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                DI::baseUrl()->redirect('ostatus_subscribe');
                // NOTREACHED
        }
 
-       $o = '<h2>' . L10n::t('Subscribing to OStatus contacts') . '</h2>';
+       $o = '<h2>' . DI::l10n()->t('Subscribing to OStatus contacts') . '</h2>';
 
        $uid = local_user();
 
@@ -29,14 +29,14 @@ function ostatus_subscribe_content(App $a)
 
                if ($_REQUEST['url'] == '') {
                        DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
-                       return $o . L10n::t('No contact provided.');
+                       return $o . DI::l10n()->t('No contact provided.');
                }
 
                $contact = Probe::uri($_REQUEST['url']);
 
                if (!$contact) {
                        DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
-                       return $o . L10n::t('Couldn\'t fetch information for contact.');
+                       return $o . DI::l10n()->t('Couldn\'t fetch information for contact.');
                }
 
                $api = $contact['baseurl'] . '/api/';
@@ -46,7 +46,7 @@ function ostatus_subscribe_content(App $a)
 
                if (!$curlResult->isSuccess()) {
                        DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
-                       return $o . L10n::t('Couldn\'t fetch friends for contact.');
+                       return $o . DI::l10n()->t('Couldn\'t fetch friends for contact.');
                }
 
                DI::pConfig()->set($uid, 'ostatus', 'legacy_friends', $curlResult->getBody());
@@ -64,7 +64,7 @@ function ostatus_subscribe_content(App $a)
                DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl() . '/settings/connectors">';
                DI::pConfig()->delete($uid, 'ostatus', 'legacy_friends');
                DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
-               $o .= L10n::t('Done');
+               $o .= DI::l10n()->t('Done');
                return $o;
        }
 
@@ -78,17 +78,17 @@ function ostatus_subscribe_content(App $a)
        if ($probed['network'] == Protocol::OSTATUS) {
                $result = Contact::createFromProbe($uid, $url, true, Protocol::OSTATUS);
                if ($result['success']) {
-                       $o .= ' - ' . L10n::t('success');
+                       $o .= ' - ' . DI::l10n()->t('success');
                } else {
-                       $o .= ' - ' . L10n::t('failed');
+                       $o .= ' - ' . DI::l10n()->t('failed');
                }
        } else {
-               $o .= ' - ' . L10n::t('ignored');
+               $o .= ' - ' . DI::l10n()->t('ignored');
        }
 
        $o .= '</p>';
 
-       $o .= '<p>' . L10n::t('Keep this window open until done.') . '</p>';
+       $o .= '<p>' . DI::l10n()->t('Keep this window open until done.') . '</p>';
 
        DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl() . '/ostatus_subscribe?counter=' . $counter . '">';
 
index 37c974048b39b9b307359b524bfa5ad7825181be..db30c7d94c0e908569873a87fb0c0f6eab2ad823 100644 (file)
@@ -86,7 +86,7 @@ function photos_init(App $a) {
                        $ret['albums'] = [];
                        foreach ($albums as $k => $album) {
                                //hide profile photos to others
-                               if (!$is_owner && !Session::getRemoteContactID($a->profile_uid) && ($album['album'] == L10n::t('Profile Photos')))
+                               if (!$is_owner && !Session::getRemoteContactID($a->profile_uid) && ($album['album'] == DI::l10n()->t('Profile Photos')))
                                        continue;
                                $entry = [
                                        'text'      => $album['album'],
@@ -108,10 +108,10 @@ function photos_init(App $a) {
                if ($ret['success']) {
                        $photo_albums_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate('photo_albums.tpl'), [
                                '$nick'     => $a->data['user']['nickname'],
-                               '$title'    => L10n::t('Photo Albums'),
-                               '$recent'   => L10n::t('Recent Photos'),
+                               '$title'    => DI::l10n()->t('Photo Albums'),
+                               '$recent'   => DI::l10n()->t('Recent Photos'),
                                '$albums'   => $ret['albums'],
-                               '$upload'   => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
+                               '$upload'   => [DI::l10n()->t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
                                '$can_post' => $can_post
                        ]);
                }
@@ -129,7 +129,7 @@ function photos_init(App $a) {
                $tpl = Renderer::getMarkupTemplate("photos_head.tpl");
 
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl,[
-                       '$ispublic' => L10n::t('everybody')
+                       '$ispublic' => DI::l10n()->t('everybody')
                ]);
        }
 
@@ -159,14 +159,14 @@ function photos_post(App $a)
        }
 
        if (!$can_post) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                exit();
        }
 
        $owner_record = User::getOwnerDataById($page_owner_uid);
 
        if (!$owner_record) {
-               notice(L10n::t('Contact information unavailable') . EOL);
+               notice(DI::l10n()->t('Contact information unavailable') . EOL);
                Logger::log('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
                exit();
        }
@@ -177,7 +177,7 @@ function photos_post(App $a)
                }
                $album = hex2bin($a->argv[3]);
 
-               if ($album === L10n::t('Profile Photos') || $album === 'Contact Photos' || $album === L10n::t('Contact Photos')) {
+               if ($album === DI::l10n()->t('Profile Photos') || $album === 'Contact Photos' || $album === DI::l10n()->t('Contact Photos')) {
                        DI::baseUrl()->redirect($_SESSION['photo_return']);
                        return; // NOTREACHED
                }
@@ -188,7 +188,7 @@ function photos_post(App $a)
                );
 
                if (!DBA::isResult($r)) {
-                       notice(L10n::t('Album not found.') . EOL);
+                       notice(DI::l10n()->t('Album not found.') . EOL);
                        DI::baseUrl()->redirect($_SESSION['photo_return']);
                        return; // NOTREACHED
                }
@@ -246,9 +246,9 @@ function photos_post(App $a)
 
                                // Update the photo albums cache
                                Photo::clearAlbumCache($page_owner_uid);
-                               notice(L10n::t('Album successfully deleted'));
+                               notice(DI::l10n()->t('Album successfully deleted'));
                        } else {
-                               notice(L10n::t('Album was empty.'));
+                               notice(DI::l10n()->t('Album was empty.'));
                        }
                }
 
@@ -573,7 +573,7 @@ function photos_post(App $a)
                                        $arr['tag']           = $tagged[4];
                                        $arr['inform']        = $tagged[2];
                                        $arr['origin']        = 1;
-                                       $arr['body']          = L10n::t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . L10n::t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
+                                       $arr['body']          = DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
                                        $arr['body'] .= "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
 
                                        $arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
@@ -623,7 +623,7 @@ function photos_post(App $a)
 
        $r = Photo::selectToArray([], ['`album` = ? AND `uid` = ? AND `created` > UTC_TIMESTAMP() - INTERVAL 3 HOUR', $album, $page_owner_uid]);
 
-       if (!DBA::isResult($r) || ($album == L10n::t('Profile Photos'))) {
+       if (!DBA::isResult($r) || ($album == DI::l10n()->t('Profile Photos'))) {
                $visible = 1;
        } else {
                $visible = 0;
@@ -668,21 +668,21 @@ function photos_post(App $a)
        if ($error !== UPLOAD_ERR_OK) {
                switch ($error) {
                        case UPLOAD_ERR_INI_SIZE:
-                               notice(L10n::t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
+                               notice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize')) . EOL);
                                break;
                        case UPLOAD_ERR_FORM_SIZE:
-                               notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)) . EOL);
+                               notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)) . EOL);
                                break;
                        case UPLOAD_ERR_PARTIAL:
-                               notice(L10n::t('Image upload didn\'t complete, please try again') . EOL);
+                               notice(DI::l10n()->t('Image upload didn\'t complete, please try again') . EOL);
                                break;
                        case UPLOAD_ERR_NO_FILE:
-                               notice(L10n::t('Image file is missing') . EOL);
+                               notice(DI::l10n()->t('Image file is missing') . EOL);
                                break;
                        case UPLOAD_ERR_NO_TMP_DIR:
                        case UPLOAD_ERR_CANT_WRITE:
                        case UPLOAD_ERR_EXTENSION:
-                               notice(L10n::t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
+                               notice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator') . EOL);
                                break;
                }
                @unlink($src);
@@ -700,7 +700,7 @@ function photos_post(App $a)
        $maximagesize = Config::get('system', 'maximagesize');
 
        if ($maximagesize && ($filesize > $maximagesize)) {
-               notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
+               notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
                @unlink($src);
                $foo = 0;
                Hook::callAll('photo_post_end', $foo);
@@ -708,7 +708,7 @@ function photos_post(App $a)
        }
 
        if (!$filesize) {
-               notice(L10n::t('Image file is empty.') . EOL);
+               notice(DI::l10n()->t('Image file is empty.') . EOL);
                @unlink($src);
                $foo = 0;
                Hook::callAll('photo_post_end', $foo);
@@ -723,7 +723,7 @@ function photos_post(App $a)
 
        if (!$image->isValid()) {
                Logger::log('mod/photos.php: photos_post(): unable to process image' , Logger::DEBUG);
-               notice(L10n::t('Unable to process image.') . EOL);
+               notice(DI::l10n()->t('Unable to process image.') . EOL);
                @unlink($src);
                $foo = 0;
                Hook::callAll('photo_post_end',$foo);
@@ -752,7 +752,7 @@ function photos_post(App $a)
 
        if (!$r) {
                Logger::log('mod/photos.php: photos_post(): image store failed', Logger::DEBUG);
-               notice(L10n::t('Image upload failed.') . EOL);
+               notice(DI::l10n()->t('Image upload failed.') . EOL);
                return;
        }
 
@@ -835,12 +835,12 @@ function photos_content(App $a)
        // photos/name/image/xxxxx/drop
 
        if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
-               notice(L10n::t('Public access denied.') . EOL);
+               notice(DI::l10n()->t('Public access denied.') . EOL);
                return;
        }
 
        if (empty($a->data['user'])) {
-               notice(L10n::t('No photos selected') . EOL);
+               notice(DI::l10n()->t('No photos selected') . EOL);
                return;
        }
 
@@ -906,7 +906,7 @@ function photos_content(App $a)
        }
 
        if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
-               notice(L10n::t('Access to this item is restricted.') . EOL);
+               notice(DI::l10n()->t('Access to this item is restricted.') . EOL);
                return;
        }
 
@@ -921,7 +921,7 @@ function photos_content(App $a)
        // Display upload form
        if ($datatype === 'upload') {
                if (!$can_post) {
-                       notice(L10n::t('Permission denied.'));
+                       notice(DI::l10n()->t('Permission denied.'));
                        return;
                }
 
@@ -932,7 +932,7 @@ function photos_content(App $a)
                $albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '>&lt;current year&gt;</option>';
                if (!empty($a->data['albums'])) {
                        foreach ($a->data['albums'] as $album) {
-                               if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === L10n::t('Contact Photos'))) {
+                               if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === DI::l10n()->t('Contact Photos'))) {
                                        continue;
                                }
                                $selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
@@ -950,7 +950,7 @@ function photos_content(App $a)
 
                $default_upload_box = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_box.tpl'), []);
                $default_upload_submit = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_submit.tpl'), [
-                       '$submit' => L10n::t('Submit'),
+                       '$submit' => DI::l10n()->t('Submit'),
                ]);
 
                $usage_message = '';
@@ -960,15 +960,15 @@ function photos_content(App $a)
                $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML(DI::page(), $a->user));
 
                $o .= Renderer::replaceMacros($tpl,[
-                       '$pagename' => L10n::t('Upload Photos'),
+                       '$pagename' => DI::l10n()->t('Upload Photos'),
                        '$sessid' => session_id(),
                        '$usage' => $usage_message,
                        '$nickname' => $a->data['user']['nickname'],
-                       '$newalbum' => L10n::t('New album name: '),
-                       '$existalbumtext' => L10n::t('or select existing album:'),
-                       '$nosharetext' => L10n::t('Do not show a status post for this upload'),
+                       '$newalbum' => DI::l10n()->t('New album name: '),
+                       '$existalbumtext' => DI::l10n()->t('or select existing album:'),
+                       '$nosharetext' => DI::l10n()->t('Do not show a status post for this upload'),
                        '$albumselect' => $albumselect,
-                       '$permissions' => L10n::t('Permissions'),
+                       '$permissions' => DI::l10n()->t('Permissions'),
                        '$aclselect' => $aclselect_e,
                        '$lockstate' => is_array($a->user)
                                        && (strlen($a->user['allow_cid'])
@@ -982,8 +982,8 @@ function photos_content(App $a)
                        '$uploadurl' => $ret['post_url'],
 
                        // ACL permissions box
-                       '$group_perms' => L10n::t('Show to Groups'),
-                       '$contact_perms' => L10n::t('Show to Contacts'),
+                       '$group_perms' => DI::l10n()->t('Show to Groups'),
+                       '$contact_perms' => DI::l10n()->t('Show to Contacts'),
                        '$return_path' => DI::args()->getQueryString(),
                ]);
 
@@ -1034,44 +1034,44 @@ function photos_content(App $a)
 
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'post',
-                               '$message' => L10n::t('Do you really want to delete this photo album and all its photos?'),
+                               '$message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
                                '$extra_inputs' => [],
-                               '$confirm' => L10n::t('Delete Album'),
+                               '$confirm' => DI::l10n()->t('Delete Album'),
                                '$confirm_url' => $drop_url,
                                '$confirm_name' => 'dropalbum',
-                               '$cancel' => L10n::t('Cancel'),
+                               '$cancel' => DI::l10n()->t('Cancel'),
                        ]);
                }
 
                // edit album name
                if ($cmd === 'edit') {
-                       if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos'))) {
+                       if (($album !== DI::l10n()->t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== DI::l10n()->t('Contact Photos'))) {
                                if ($can_post) {
                                        $edit_tpl = Renderer::getMarkupTemplate('album_edit.tpl');
 
                                        $album_e = $album;
 
                                        $o .= Renderer::replaceMacros($edit_tpl,[
-                                               '$nametext' => L10n::t('New album name: '),
+                                               '$nametext' => DI::l10n()->t('New album name: '),
                                                '$nickname' => $a->data['user']['nickname'],
                                                '$album' => $album_e,
                                                '$hexalbum' => bin2hex($album),
-                                               '$submit' => L10n::t('Submit'),
-                                               '$dropsubmit' => L10n::t('Delete Album')
+                                               '$submit' => DI::l10n()->t('Submit'),
+                                               '$dropsubmit' => DI::l10n()->t('Delete Album')
                                        ]);
                                }
                        }
                } else {
-                       if (($album !== L10n::t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== L10n::t('Contact Photos')) && $can_post) {
-                               $edit = [L10n::t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
-                               $drop = [L10n::t('Drop Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/drop'];
+                       if (($album !== DI::l10n()->t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== DI::l10n()->t('Contact Photos')) && $can_post) {
+                               $edit = [DI::l10n()->t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
+                               $drop = [DI::l10n()->t('Drop Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/drop'];
                        }
                }
 
                if ($order_field === 'posted') {
-                       $order =  [L10n::t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album), 'oldest'];
+                       $order =  [DI::l10n()->t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album), 'oldest'];
                } else {
-                       $order = [L10n::t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?order=posted', 'newest'];
+                       $order = [DI::l10n()->t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?order=posted', 'newest'];
                }
 
                $photos = [];
@@ -1092,7 +1092,7 @@ function photos_content(App $a)
                                        'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
                                        'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
                                                . ($order_field === 'posted' ? '?order=posted' : ''),
-                                       'title' => L10n::t('View Photo'),
+                                       'title' => DI::l10n()->t('View Photo'),
                                        'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' .$ext,
                                        'alt' => $imgalt_e,
                                        'desc'=> $desc_e,
@@ -1107,7 +1107,7 @@ function photos_content(App $a)
                        '$photos' => $photos,
                        '$album' => $album,
                        '$can_post' => $can_post,
-                       '$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
+                       '$upload' => [DI::l10n()->t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
                        '$order' => $order,
                        '$edit' => $edit,
                        '$drop' => $drop,
@@ -1129,9 +1129,9 @@ function photos_content(App $a)
 
                if (!DBA::isResult($ph)) {
                        if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) {
-                               notice(L10n::t('Permission denied. Access to this item may be restricted.'));
+                               notice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
                        } else {
-                               notice(L10n::t('Photo not available') . EOL);
+                               notice(DI::l10n()->t('Photo not available') . EOL);
                        }
                        return;
                }
@@ -1141,12 +1141,12 @@ function photos_content(App $a)
 
                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'post',
-                               '$message' => L10n::t('Do you really want to delete this photo?'),
+                               '$message' => DI::l10n()->t('Do you really want to delete this photo?'),
                                '$extra_inputs' => [],
-                               '$confirm' => L10n::t('Delete Photo'),
+                               '$confirm' => DI::l10n()->t('Delete Photo'),
                                '$confirm_url' => $drop_url,
                                '$confirm_name' => 'delete',
-                               '$cancel' => L10n::t('Cancel'),
+                               '$cancel' => DI::l10n()->t('Cancel'),
                        ]);
                }
 
@@ -1234,24 +1234,24 @@ function photos_content(App $a)
                if ($can_post && ($ph[0]['uid'] == $owner_uid)) {
                        $tools = [];
                        if ($cmd === 'edit') {
-                               $tools['view'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum, L10n::t('View photo')];
+                               $tools['view'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum, DI::l10n()->t('View photo')];
                        } else {
-                               $tools['edit'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/edit', L10n::t('Edit photo')];
-                               $tools['delete'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/drop', L10n::t('Delete photo')];
-                               $tools['profile'] = ['profile_photo/use/'.$ph[0]['resource-id'], L10n::t('Use as profile photo')];
+                               $tools['edit'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/edit', DI::l10n()->t('Edit photo')];
+                               $tools['delete'] = ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/drop', DI::l10n()->t('Delete photo')];
+                               $tools['profile'] = ['profile_photo/use/'.$ph[0]['resource-id'], DI::l10n()->t('Use as profile photo')];
                        }
 
                        if (
                                $ph[0]['uid'] == local_user()
                                && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid']))
                        ) {
-                               $tools['lock'] = L10n::t('Private Photo');
+                               $tools['lock'] = DI::l10n()->t('Private Photo');
                        }
                }
 
                $photo = [
                        'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
-                       'title'=> L10n::t('View Full Size'),
+                       'title'=> DI::l10n()->t('View Full Size'),
                        'src'  => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?_u=' . DateTimeFormat::utcNow('ymdhis'),
                        'height' => $hires['height'],
                        'width' => $hires['width'],
@@ -1311,10 +1311,10 @@ function photos_content(App $a)
                                        'removeurl' => '/tagrm/' . $link_item['id'] . '/' . bin2hex($tag)
                                ];
                        }
-                       $tags = ['title' => L10n::t('Tags: '), 'tags' => $tag_arr];
+                       $tags = ['title' => DI::l10n()->t('Tags: '), 'tags' => $tag_arr];
                        if ($cmd === 'edit') {
                                $tags['removeanyurl'] = 'tagrm/' . $link_item['id'];
-                               $tags['removetitle'] = L10n::t('[Select tags to remove]');
+                               $tags['removetitle'] = DI::l10n()->t('[Select tags to remove]');
                        }
                }
 
@@ -1329,25 +1329,25 @@ function photos_content(App $a)
 
                        $edit = Renderer::replaceMacros($edit_tpl, [
                                '$id' => $ph[0]['id'],
-                               '$album' => ['albname', L10n::t('New album name'), $album_e,''],
-                               '$caption' => ['desc', L10n::t('Caption'), $caption_e, ''],
-                               '$tags' => ['newtag', L10n::t('Add a Tag'), "", L10n::t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')],
-                               '$rotate_none' => ['rotate', L10n::t('Do not rotate'),0,'', true],
-                               '$rotate_cw' => ['rotate', L10n::t("Rotate CW \x28right\x29"),1,''],
-                               '$rotate_ccw' => ['rotate', L10n::t("Rotate CCW \x28left\x29"),2,''],
+                               '$album' => ['albname', DI::l10n()->t('New album name'), $album_e,''],
+                               '$caption' => ['desc', DI::l10n()->t('Caption'), $caption_e, ''],
+                               '$tags' => ['newtag', DI::l10n()->t('Add a Tag'), "", DI::l10n()->t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')],
+                               '$rotate_none' => ['rotate', DI::l10n()->t('Do not rotate'),0,'', true],
+                               '$rotate_cw' => ['rotate', DI::l10n()->t("Rotate CW \x28right\x29"),1,''],
+                               '$rotate_ccw' => ['rotate', DI::l10n()->t("Rotate CCW \x28left\x29"),2,''],
 
                                '$nickname' => $a->data['user']['nickname'],
                                '$resource_id' => $ph[0]['resource-id'],
-                               '$permissions' => L10n::t('Permissions'),
+                               '$permissions' => DI::l10n()->t('Permissions'),
                                '$aclselect' => $aclselect_e,
 
                                '$item_id' => $link_item['id'] ?? 0,
-                               '$submit' => L10n::t('Submit'),
-                               '$delete' => L10n::t('Delete Photo'),
+                               '$submit' => DI::l10n()->t('Submit'),
+                               '$delete' => DI::l10n()->t('Delete Photo'),
 
                                // ACL permissions box
-                               '$group_perms' => L10n::t('Show to Groups'),
-                               '$contact_perms' => L10n::t('Show to Contacts'),
+                               '$group_perms' => DI::l10n()->t('Show to Groups'),
+                               '$contact_perms' => DI::l10n()->t('Show to Contacts'),
                                '$return_path' => DI::args()->getQueryString(),
                        ]);
                }
@@ -1368,9 +1368,9 @@ function photos_content(App $a)
                                $like_tpl = Renderer::getMarkupTemplate('like_noshare.tpl');
                                $likebuttons = Renderer::replaceMacros($like_tpl, [
                                        '$id' => $link_item['id'],
-                                       '$likethis' => L10n::t("I like this \x28toggle\x29"),
-                                       '$nolike' => L10n::t("I don't like this \x28toggle\x29"),
-                                       '$wait' => L10n::t('Please wait'),
+                                       '$likethis' => DI::l10n()->t("I like this \x28toggle\x29"),
+                                       '$nolike' => DI::l10n()->t("I don't like this \x28toggle\x29"),
+                                       '$wait' => DI::l10n()->t('Please wait'),
                                        '$return_path' => DI::args()->getQueryString(),
                                ]);
                        }
@@ -1384,12 +1384,12 @@ function photos_content(App $a)
                                                '$parent' => $link_item['id'],
                                                '$profile_uid' =>  $owner_uid,
                                                '$mylink' => $contact['url'],
-                                               '$mytitle' => L10n::t('This is you'),
+                                               '$mytitle' => DI::l10n()->t('This is you'),
                                                '$myphoto' => $contact['thumb'],
-                                               '$comment' => L10n::t('Comment'),
-                                               '$submit' => L10n::t('Submit'),
-                                               '$preview' => L10n::t('Preview'),
-                                               '$sourceapp' => L10n::t($a->sourcename),
+                                               '$comment' => DI::l10n()->t('Comment'),
+                                               '$submit' => DI::l10n()->t('Submit'),
+                                               '$preview' => DI::l10n()->t('Preview'),
+                                               '$sourceapp' => DI::l10n()->t($a->sourcename),
                                                '$ww' => '',
                                                '$rand_num' => Crypto::randomDigits(12)
                                        ]);
@@ -1397,8 +1397,8 @@ function photos_content(App $a)
                        }
 
                        $conv_responses = [
-                               'like' => ['title' => L10n::t('Likes','title')],'dislike' => ['title' => L10n::t('Dislikes','title')],
-                               'attendyes' => ['title' => L10n::t('Attending','title')], 'attendno' => ['title' => L10n::t('Not attending','title')], 'attendmaybe' => ['title' => L10n::t('Might attend','title')]
+                               'like' => ['title' => DI::l10n()->t('Likes','title')],'dislike' => ['title' => DI::l10n()->t('Dislikes','title')],
+                               'attendyes' => ['title' => DI::l10n()->t('Attending','title')], 'attendno' => ['title' => DI::l10n()->t('Not attending','title')], 'attendmaybe' => ['title' => DI::l10n()->t('Might attend','title')]
                        ];
 
                        // display comments
@@ -1423,12 +1423,12 @@ function photos_content(App $a)
                                                '$parent' => $link_item['id'],
                                                '$profile_uid' =>  $owner_uid,
                                                '$mylink' => $contact['url'],
-                                               '$mytitle' => L10n::t('This is you'),
+                                               '$mytitle' => DI::l10n()->t('This is you'),
                                                '$myphoto' => $contact['thumb'],
-                                               '$comment' => L10n::t('Comment'),
-                                               '$submit' => L10n::t('Submit'),
-                                               '$preview' => L10n::t('Preview'),
-                                               '$sourceapp' => L10n::t($a->sourcename),
+                                               '$comment' => DI::l10n()->t('Comment'),
+                                               '$submit' => DI::l10n()->t('Submit'),
+                                               '$preview' => DI::l10n()->t('Preview'),
+                                               '$sourceapp' => DI::l10n()->t($a->sourcename),
                                                '$ww' => '',
                                                '$rand_num' => Crypto::randomDigits(12)
                                        ]);
@@ -1458,8 +1458,8 @@ function photos_content(App $a)
                                        $drop = [
                                                'dropping' => $dropping,
                                                'pagedrop' => false,
-                                               'select' => L10n::t('Select'),
-                                               'delete' => L10n::t('Delete'),
+                                               'select' => DI::l10n()->t('Select'),
+                                               'delete' => DI::l10n()->t('Delete'),
                                        ];
 
                                        $title_e = $item['title'];
@@ -1487,12 +1487,12 @@ function photos_content(App $a)
                                                        '$parent' => $item['parent'],
                                                        '$profile_uid' =>  $owner_uid,
                                                        '$mylink' => $contact['url'],
-                                                       '$mytitle' => L10n::t('This is you'),
+                                                       '$mytitle' => DI::l10n()->t('This is you'),
                                                        '$myphoto' => $contact['thumb'],
-                                                       '$comment' => L10n::t('Comment'),
-                                                       '$submit' => L10n::t('Submit'),
-                                                       '$preview' => L10n::t('Preview'),
-                                                       '$sourceapp' => L10n::t($a->sourcename),
+                                                       '$comment' => DI::l10n()->t('Comment'),
+                                                       '$submit' => DI::l10n()->t('Submit'),
+                                                       '$preview' => DI::l10n()->t('Preview'),
+                                                       '$sourceapp' => DI::l10n()->t($a->sourcename),
                                                        '$ww' => '',
                                                        '$rand_num' => Crypto::randomDigits(12)
                                                ]);
@@ -1518,7 +1518,7 @@ function photos_content(App $a)
                        '$tags' => $tags,
                        '$edit' => $edit,
                        '$map' => $map,
-                       '$map_text' => L10n::t('Map'),
+                       '$map_text' => DI::l10n()->t('Map'),
                        '$likebuttons' => $likebuttons,
                        '$like' => $like,
                        '$dislike' => $dislike,
@@ -1543,7 +1543,7 @@ function photos_content(App $a)
                $sql_extra GROUP BY `resource-id`",
                intval($a->data['user']['uid']),
                DBA::escape('Contact Photos'),
-               DBA::escape(L10n::t('Contact Photos'))
+               DBA::escape(DI::l10n()->t('Contact Photos'))
        );
        if (DBA::isResult($r)) {
                $total = count($r);
@@ -1558,7 +1558,7 @@ function photos_content(App $a)
                $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
                intval($a->data['user']['uid']),
                DBA::escape('Contact Photos'),
-               DBA::escape(L10n::t('Contact Photos')),
+               DBA::escape(DI::l10n()->t('Contact Photos')),
                $pager->getStart(),
                $pager->getItemsPerPage()
        );
@@ -1569,7 +1569,7 @@ function photos_content(App $a)
                $twist = false;
                foreach ($r as $rr) {
                        //hide profile photos to others
-                       if (!$is_owner && !Session::getRemoteContactID($owner_uid) && ($rr['album'] == L10n::t('Profile Photos'))) {
+                       if (!$is_owner && !Session::getRemoteContactID($owner_uid) && ($rr['album'] == DI::l10n()->t('Profile Photos'))) {
                                continue;
                        }
 
@@ -1583,13 +1583,13 @@ function photos_content(App $a)
                                'id'    => $rr['id'],
                                'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
                                'link'  => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
-                               'title' => L10n::t('View Photo'),
+                               'title' => DI::l10n()->t('View Photo'),
                                'src'   => 'photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
                                'alt'   => $alt_e,
                                'album' => [
                                        'link' => 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
                                        'name' => $name_e,
-                                       'alt'  => L10n::t('View Album'),
+                                       'alt'  => DI::l10n()->t('View Album'),
                                ],
 
                        ];
@@ -1598,9 +1598,9 @@ function photos_content(App $a)
 
        $tpl = Renderer::getMarkupTemplate('photos_recent.tpl');
        $o .= Renderer::replaceMacros($tpl, [
-               '$title' => L10n::t('Recent Photos'),
+               '$title' => DI::l10n()->t('Recent Photos'),
                '$can_post' => $can_post,
-               '$upload' => [L10n::t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'],
+               '$upload' => [DI::l10n()->t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'],
                '$photos' => $photos,
                '$paginate' => $pager->renderFull($total),
        ]);
index 8aa65b7e19d1de166579261cf8634ecd8fdab0aa..57b55a0f9b3303cb1139f4f76aba0dd69ef69c1e 100644 (file)
@@ -268,7 +268,7 @@ function ping_init(App $a)
                                        'photo'   => $intro['photo'],
                                        'date'    => $intro['datetime'],
                                        'seen'    => false,
-                                       'message' => L10n::t('{0} wants to be your friend'),
+                                       'message' => DI::l10n()->t('{0} wants to be your friend'),
                                ];
                                $notifs[] = $notif;
                        }
@@ -284,7 +284,7 @@ function ping_init(App $a)
                                        'photo'   => $reg['micro'],
                                        'date'    => $reg['created'],
                                        'seen'    => false,
-                                       'message' => L10n::t('{0} requested registration'),
+                                       'message' => DI::l10n()->t('{0} requested registration'),
                                ];
                                $notifs[] = $notif;
                        }
index 900aa8e759ac8a2d42ad22b136c4619bbee77a4a..ea968f7bd0b9c8e3fcb0cfe31a2cafa6daac421b 100644 (file)
@@ -122,7 +122,7 @@ function poke_init(App $a)
        $arr['object-type']   = Activity\ObjectType::PERSON;
 
        $arr['origin']        = 1;
-       $arr['body']          = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . L10n::t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
+       $arr['body']          = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . DI::l10n()->t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
 
        $arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $target['name'] . '</title><id>' . $target['url'] . '</id>';
        $arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
@@ -140,7 +140,7 @@ function poke_init(App $a)
 function poke_content(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -176,14 +176,14 @@ function poke_content(App $a)
        $tpl = Renderer::getMarkupTemplate('poke_content.tpl');
 
        $o = Renderer::replaceMacros($tpl,[
-               '$title' => L10n::t('Poke/Prod'),
-               '$desc' => L10n::t('poke, prod or do other things to somebody'),
-               '$clabel' => L10n::t('Recipient'),
-               '$choice' => L10n::t('Choose what you wish to do to recipient'),
+               '$title' => DI::l10n()->t('Poke/Prod'),
+               '$desc' => DI::l10n()->t('poke, prod or do other things to somebody'),
+               '$clabel' => DI::l10n()->t('Recipient'),
+               '$choice' => DI::l10n()->t('Choose what you wish to do to recipient'),
                '$verbs' => $shortlist,
                '$parent' => $parent,
-               '$prv_desc' => L10n::t('Make this post private'),
-               '$submit' => L10n::t('Submit'),
+               '$prv_desc' => DI::l10n()->t('Make this post private'),
+               '$submit' => DI::l10n()->t('Submit'),
                '$name' => $name,
                '$id' => $id
        ]);
index acdf90985dcf4c4ba208c2f910762d5c72bb0c27..dddd1957dc564292c642039785a4c36124fc23a5 100644 (file)
@@ -29,7 +29,7 @@ function profile_photo_init(App $a)
 function profile_photo_post(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -55,7 +55,7 @@ function profile_photo_post(App $a)
                // phase 2 - we have finished cropping
 
                if ($a->argc != 2) {
-                       notice(L10n::t('Image uploaded but image cropping failed.') . EOL);
+                       notice(DI::l10n()->t('Image uploaded but image cropping failed.') . EOL);
                        return;
                }
 
@@ -82,28 +82,28 @@ function profile_photo_post(App $a)
                                $Image->crop(300, $srcX, $srcY, $srcW, $srcH);
 
                                $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'], $base_image['filename'],
-                                               L10n::t('Profile Photos'), 4, $is_default_profile);
+                                               DI::l10n()->t('Profile Photos'), 4, $is_default_profile);
 
                                if ($r === false) {
-                                       notice(L10n::t('Image size reduction [%s] failed.', "300") . EOL);
+                                       notice(DI::l10n()->t('Image size reduction [%s] failed.', "300") . EOL);
                                }
 
                                $Image->scaleDown(80);
 
                                $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'], $base_image['filename'],
-                                               L10n::t('Profile Photos'), 5, $is_default_profile);
+                                               DI::l10n()->t('Profile Photos'), 5, $is_default_profile);
 
                                if ($r === false) {
-                                       notice(L10n::t('Image size reduction [%s] failed.', "80") . EOL);
+                                       notice(DI::l10n()->t('Image size reduction [%s] failed.', "80") . EOL);
                                }
 
                                $Image->scaleDown(48);
 
                                $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'], $base_image['filename'],
-                                               L10n::t('Profile Photos'), 6, $is_default_profile);
+                                               DI::l10n()->t('Profile Photos'), 6, $is_default_profile);
 
                                if ($r === false) {
-                                       notice(L10n::t('Image size reduction [%s] failed.', "48") . EOL);
+                                       notice(DI::l10n()->t('Image size reduction [%s] failed.', "48") . EOL);
                                }
 
                                // If setting for the default profile, unset the profile photo flag from any other photos I own
@@ -122,7 +122,7 @@ function profile_photo_post(App $a)
 
                                Contact::updateSelfFromUserID(local_user(), true);
 
-                               info(L10n::t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
+                               info(DI::l10n()->t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL);
                                // Update global directory in background
                                if ($path && strlen(Config::get('system', 'directory'))) {
                                        Worker::add(PRIORITY_LOW, "Directory", DI::baseUrl()->get() . '/' . $path);
@@ -130,7 +130,7 @@ function profile_photo_post(App $a)
 
                                Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
                        } else {
-                               notice(L10n::t('Unable to process image') . EOL);
+                               notice(DI::l10n()->t('Unable to process image') . EOL);
                        }
                }
 
@@ -149,7 +149,7 @@ function profile_photo_post(App $a)
        $maximagesize = Config::get('system', 'maximagesize');
 
        if (($maximagesize) && ($filesize > $maximagesize)) {
-               notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
+               notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
                @unlink($src);
                return;
        }
@@ -158,7 +158,7 @@ function profile_photo_post(App $a)
        $ph = new Image($imagedata, $filetype);
 
        if (!$ph->isValid()) {
-               notice(L10n::t('Unable to process image.') . EOL);
+               notice(DI::l10n()->t('Unable to process image.') . EOL);
                @unlink($src);
                return;
        }
@@ -174,7 +174,7 @@ function profile_photo_content(App $a)
 {
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -194,7 +194,7 @@ function profile_photo_content(App $a)
 
                $r = Photo::selectToArray([], ["resource-id" => $resource_id, "uid" => local_user()], ["order" => ["scale" => false]]);
                if (!DBA::isResult($r)) {
-                       notice(L10n::t('Permission denied.') . EOL);
+                       notice(DI::l10n()->t('Permission denied.') . EOL);
                        return;
                }
 
@@ -207,7 +207,7 @@ function profile_photo_content(App $a)
 
                // set an already uloaded photo as profile photo
                // if photo is in 'Profile Photos', change it in db
-               if (($r[0]['album'] == L10n::t('Profile Photos')) && ($havescale)) {
+               if (($r[0]['album'] == DI::l10n()->t('Profile Photos')) && ($havescale)) {
                        q("UPDATE `photo` SET `profile`=0 WHERE `profile`=1 AND `uid`=%d", intval(local_user()));
 
                        q("UPDATE `photo` SET `profile`=1 WHERE `uid` = %d AND `resource-id` = '%s'", intval(local_user()),
@@ -241,14 +241,14 @@ function profile_photo_content(App $a)
                $o = Renderer::replaceMacros($tpl,
                        [
                        '$user' => $a->user['nickname'],
-                       '$lbl_upfile' => L10n::t('Upload File:'),
-                       '$lbl_profiles' => L10n::t('Select a profile:'),
-                       '$title' => L10n::t('Upload Profile Photo'),
-                       '$submit' => L10n::t('Upload'),
+                       '$lbl_upfile' => DI::l10n()->t('Upload File:'),
+                       '$lbl_profiles' => DI::l10n()->t('Select a profile:'),
+                       '$title' => DI::l10n()->t('Upload Profile Photo'),
+                       '$submit' => DI::l10n()->t('Upload'),
                        '$profiles' => $profiles,
                        '$form_security_token' => BaseModule::getFormSecurityToken("profile_photo"),
-                       '$select' => sprintf('%s %s', L10n::t('or'),
-                               ($newuser) ? '<a href="' . DI::baseUrl() . '">' . L10n::t('skip this step') . '</a>' : '<a href="' . DI::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . L10n::t('select a photo from your photo albums') . '</a>')
+                       '$select' => sprintf('%s %s', DI::l10n()->t('or'),
+                               ($newuser) ? '<a href="' . DI::baseUrl() . '">' . DI::l10n()->t('skip this step') . '</a>' : '<a href="' . DI::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . DI::l10n()->t('select a photo from your photo albums') . '</a>')
                ]);
 
                return $o;
@@ -261,10 +261,10 @@ function profile_photo_content(App $a)
                        '$profile'   => (isset($_REQUEST['profile']) ? intval($_REQUEST['profile']) : 0),
                        '$resource'  => $imagecrop['hash'] . '-' . $imagecrop['resolution'],
                        '$image_url' => DI::baseUrl() . '/photo/' . $filename,
-                       '$title'     => L10n::t('Crop Image'),
-                       '$desc'      => L10n::t('Please adjust the image cropping for optimum viewing.'),
+                       '$title'     => DI::l10n()->t('Crop Image'),
+                       '$desc'      => DI::l10n()->t('Please adjust the image cropping for optimum viewing.'),
                        '$form_security_token' => BaseModule::getFormSecurityToken("profile_photo"),
-                       '$done'      => L10n::t('Done Editing')
+                       '$done'      => DI::l10n()->t('Done Editing')
                ]);
                return $o;
        }
@@ -295,20 +295,20 @@ function profile_photo_crop_ui_head(Image $image)
        $smallest = 0;
        $filename = '';
 
-       $r = Photo::store($image, local_user(), 0, $hash, $filename, L10n::t('Profile Photos'), 0);
+       $r = Photo::store($image, local_user(), 0, $hash, $filename, DI::l10n()->t('Profile Photos'), 0);
 
        if ($r) {
-               info(L10n::t('Image uploaded successfully.') . EOL);
+               info(DI::l10n()->t('Image uploaded successfully.') . EOL);
        } else {
-               notice(L10n::t('Image upload failed.') . EOL);
+               notice(DI::l10n()->t('Image upload failed.') . EOL);
        }
 
        if ($width > 640 || $height > 640) {
                $image->scaleDown(640);
-               $r = Photo::store($image, local_user(), 0, $hash, $filename, L10n::t('Profile Photos'), 1);
+               $r = Photo::store($image, local_user(), 0, $hash, $filename, DI::l10n()->t('Profile Photos'), 1);
 
                if ($r === false) {
-                       notice(L10n::t('Image size reduction [%s] failed.', "640") . EOL);
+                       notice(DI::l10n()->t('Image size reduction [%s] failed.', "640") . EOL);
                } else {
                        $smallest = 1;
                }
index f333e302f0b5c2a3f946ef86aa6fe3770aa9f927..2e530a17527adbafeb61a7d4db869fc6bc47390c 100644 (file)
@@ -39,7 +39,7 @@ function profiles_init(App $a) {
                        intval(local_user())
                );
                if (! DBA::isResult($r)) {
-                       notice(L10n::t('Profile not found.') . EOL);
+                       notice(DI::l10n()->t('Profile not found.') . EOL);
                        DI::baseUrl()->redirect('profiles');
                        return; // NOTREACHED
                }
@@ -58,7 +58,7 @@ function profiles_init(App $a) {
                        intval(local_user())
                );
                if (DBA::isResult($r)) {
-                       info(L10n::t('Profile deleted.').EOL);
+                       info(DI::l10n()->t('Profile deleted.').EOL);
                }
 
                DI::baseUrl()->redirect('profiles');
@@ -74,7 +74,7 @@ function profiles_init(App $a) {
 
                $num_profiles = (DBA::isResult($r0) ? count($r0) : 0);
 
-               $name = L10n::t('Profile-') . ($num_profiles + 1);
+               $name = DI::l10n()->t('Profile-') . ($num_profiles + 1);
 
                $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
                        intval(local_user()));
@@ -93,7 +93,7 @@ function profiles_init(App $a) {
                        DBA::escape($name)
                );
 
-               info(L10n::t('New profile created.') . EOL);
+               info(DI::l10n()->t('New profile created.') . EOL);
                if (DBA::isResult($r3) && count($r3) == 1) {
                        DI::baseUrl()->redirect('profiles/' . $r3[0]['id']);
                }
@@ -110,13 +110,13 @@ function profiles_init(App $a) {
 
                $num_profiles = (DBA::isResult($r0) ? count($r0) : 0);
 
-               $name = L10n::t('Profile-') . ($num_profiles + 1);
+               $name = DI::l10n()->t('Profile-') . ($num_profiles + 1);
                $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
                        intval(local_user()),
                        intval($a->argv[2])
                );
                if(! DBA::isResult($r1)) {
-                       notice(L10n::t('Profile unavailable to clone.') . EOL);
+                       notice(DI::l10n()->t('Profile unavailable to clone.') . EOL);
                        exit();
                }
                unset($r1[0]['id']);
@@ -131,7 +131,7 @@ function profiles_init(App $a) {
                        intval(local_user()),
                        DBA::escape($name)
                );
-               info(L10n::t('New profile created.') . EOL);
+               info(DI::l10n()->t('New profile created.') . EOL);
                if ((DBA::isResult($r3)) && (count($r3) == 1)) {
                        DI::baseUrl()->redirect('profiles/'.$r3[0]['id']);
                }
@@ -148,7 +148,7 @@ function profiles_init(App $a) {
                        intval(local_user())
                );
                if (! DBA::isResult($r)) {
-                       notice(L10n::t('Profile not found.') . EOL);
+                       notice(DI::l10n()->t('Profile not found.') . EOL);
                        exit();
                }
 
@@ -178,7 +178,7 @@ function profile_clean_keywords($keywords)
 function profiles_post(App $a) {
 
        if (! local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -192,7 +192,7 @@ function profiles_post(App $a) {
                        intval(local_user())
                );
                if (! DBA::isResult($orig)) {
-                       notice(L10n::t('Profile not found.') . EOL);
+                       notice(DI::l10n()->t('Profile not found.') . EOL);
                        return;
                }
 
@@ -202,7 +202,7 @@ function profiles_post(App $a) {
 
                $profile_name = Strings::escapeTags(trim($_POST['profile_name']));
                if (! strlen($profile_name)) {
-                       notice(L10n::t('Profile Name is required.') . EOL);
+                       notice(DI::l10n()->t('Profile Name is required.') . EOL);
                        return;
                }
 
@@ -342,50 +342,50 @@ function profiles_post(App $a) {
                $changes = [];
                if ($is_default) {
                        if ($marital != $orig[0]['marital']) {
-                               $changes[] = '[color=#ff0000]&hearts;[/color] ' . L10n::t('Marital Status');
+                               $changes[] = '[color=#ff0000]&hearts;[/color] ' . DI::l10n()->t('Marital Status');
                        }
                        if ($withchanged) {
-                               $changes[] = '[color=#ff0000]&hearts;[/color] ' . L10n::t('Romantic Partner');
+                               $changes[] = '[color=#ff0000]&hearts;[/color] ' . DI::l10n()->t('Romantic Partner');
                        }
                        if ($likes != $orig[0]['likes']) {
-                               $changes[] = L10n::t('Likes');
+                               $changes[] = DI::l10n()->t('Likes');
                        }
                        if ($dislikes != $orig[0]['dislikes']) {
-                               $changes[] = L10n::t('Dislikes');
+                               $changes[] = DI::l10n()->t('Dislikes');
                        }
                        if ($work != $orig[0]['work']) {
-                               $changes[] = L10n::t('Work/Employment');
+                               $changes[] = DI::l10n()->t('Work/Employment');
                        }
                        if ($religion != $orig[0]['religion']) {
-                               $changes[] = L10n::t('Religion');
+                               $changes[] = DI::l10n()->t('Religion');
                        }
                        if ($politic != $orig[0]['politic']) {
-                               $changes[] = L10n::t('Political Views');
+                               $changes[] = DI::l10n()->t('Political Views');
                        }
                        if ($gender != $orig[0]['gender']) {
-                               $changes[] = L10n::t('Gender');
+                               $changes[] = DI::l10n()->t('Gender');
                        }
                        if ($sexual != $orig[0]['sexual']) {
-                               $changes[] = L10n::t('Sexual Preference');
+                               $changes[] = DI::l10n()->t('Sexual Preference');
                        }
                        if ($xmpp != $orig[0]['xmpp']) {
-                               $changes[] = L10n::t('XMPP');
+                               $changes[] = DI::l10n()->t('XMPP');
                        }
                        if ($homepage != $orig[0]['homepage']) {
-                               $changes[] = L10n::t('Homepage');
+                               $changes[] = DI::l10n()->t('Homepage');
                        }
                        if ($interest != $orig[0]['interest']) {
-                               $changes[] = L10n::t('Interests');
+                               $changes[] = DI::l10n()->t('Interests');
                        }
                        if ($address != $orig[0]['address']) {
-                               $changes[] = L10n::t('Address');
+                               $changes[] = DI::l10n()->t('Address');
                                // New address not sent in notifications, potential privacy issues
                                // in case this leaks to unintended recipients. Yes, it's in the public
                                // profile but that doesn't mean we have to broadcast it to everybody.
                        }
                        if ($locality != $orig[0]['locality'] || $region != $orig[0]['region']
                                || $country_name != $orig[0]['country-name']) {
-                               $changes[] = L10n::t('Location');
+                               $changes[] = DI::l10n()->t('Location');
                        }
                }
 
@@ -465,7 +465,7 @@ function profiles_post(App $a) {
 
                /// @TODO decide to use DBA::isResult() here and check $r
                if ($r) {
-                       info(L10n::t('Profile updated.') . EOL);
+                       info(DI::l10n()->t('Profile updated.') . EOL);
                }
 
                if ($is_default) {
@@ -495,7 +495,7 @@ function profiles_post(App $a) {
 function profiles_content(App $a) {
 
        if (! local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return Login::form();
        }
 
@@ -507,7 +507,7 @@ function profiles_content(App $a) {
                        intval(local_user())
                );
                if (! DBA::isResult($r)) {
-                       notice(L10n::t('Profile not found.') . EOL);
+                       notice(DI::l10n()->t('Profile not found.') . EOL);
                        return;
                }
 
@@ -519,14 +519,14 @@ function profiles_content(App $a) {
                $hide_friends = Renderer::replaceMacros($opt_tpl,[
                        '$yesno' => [
                                'hide-friends', //Name
-                               L10n::t('Hide contacts and friends:'), //Label
+                               DI::l10n()->t('Hide contacts and friends:'), //Label
                                !!$r[0]['hide-friends'], //Value
                                '', //Help string
-                               [L10n::t('No'), L10n::t('Yes')] //Off - On strings
+                               [DI::l10n()->t('No'), DI::l10n()->t('Yes')] //Off - On strings
                        ],
-                       '$desc' => L10n::t('Hide your contact/friend list from viewers of this profile?'),
-                       '$yes_str' => L10n::t('Yes'),
-                       '$no_str' => L10n::t('No'),
+                       '$desc' => DI::l10n()->t('Hide your contact/friend list from viewers of this profile?'),
+                       '$yes_str' => DI::l10n()->t('Yes'),
+                       '$no_str' => DI::l10n()->t('No'),
                        '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
                        '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
                ]);
@@ -544,10 +544,10 @@ function profiles_content(App $a) {
 
                        '$details' => [
                                'detailed_profile', //Name
-                               L10n::t('Show more profile fields:'), //Label
+                               DI::l10n()->t('Show more profile fields:'), //Label
                                $detailed_profile, //Value
                                '', //Help string
-                               [L10n::t('No'), L10n::t('Yes')] //Off - On strings
+                               [DI::l10n()->t('No'), DI::l10n()->t('Yes')] //Off - On strings
                        ],
 
                        '$multi_profiles'               => Feature::isEnabled(local_user(), 'multi_profiles'),
@@ -556,75 +556,75 @@ function profiles_content(App $a) {
                        '$profile_clone_link'           => ((Feature::isEnabled(local_user(), 'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . BaseModule::getFormSecurityToken("profile_clone") : ""),
                        '$profile_drop_link'            => 'profiles/drop/' . $r[0]['id'] . '?t=' . BaseModule::getFormSecurityToken("profile_drop"),
 
-                       '$profile_action' => L10n::t('Profile Actions'),
-                       '$banner'       => L10n::t('Edit Profile Details'),
-                       '$submit'       => L10n::t('Submit'),
-                       '$profpic'      => L10n::t('Change Profile Photo'),
+                       '$profile_action' => DI::l10n()->t('Profile Actions'),
+                       '$banner'       => DI::l10n()->t('Edit Profile Details'),
+                       '$submit'       => DI::l10n()->t('Submit'),
+                       '$profpic'      => DI::l10n()->t('Change Profile Photo'),
                        '$profpiclink'  => '/photos/' . $a->user['nickname'],
-                       '$viewprof'     => L10n::t('View this profile'),
-                       '$viewallprof'  => L10n::t('View all profiles'),
-                       '$editvis'      => L10n::t('Edit visibility'),
-                       '$cr_prof'      => L10n::t('Create a new profile using these settings'),
-                       '$cl_prof'      => L10n::t('Clone this profile'),
-                       '$del_prof'     => L10n::t('Delete this profile'),
-
-                       '$lbl_basic_section' => L10n::t('Basic information'),
-                       '$lbl_picture_section' => L10n::t('Profile picture'),
-                       '$lbl_location_section' => L10n::t('Location'),
-                       '$lbl_preferences_section' => L10n::t('Preferences'),
-                       '$lbl_status_section' => L10n::t('Status information'),
-                       '$lbl_about_section' => L10n::t('Additional information'),
-                       '$lbl_interests_section' => L10n::t('Interests'),
-                       '$lbl_personal_section' => L10n::t('Personal'),
-                       '$lbl_relation_section' => L10n::t('Relation'),
-                       '$lbl_miscellaneous_section' => L10n::t('Miscellaneous'),
-
-                       '$lbl_profile_photo' => L10n::t('Upload Profile Photo'),
-                       '$lbl_gender' => L10n::t('Your Gender:'),
-                       '$lbl_marital' => L10n::t('<span class="heart">&hearts;</span> Marital Status:'),
-                       '$lbl_sexual' => L10n::t('Sexual Preference:'),
-                       '$lbl_ex2' => L10n::t('Example: fishing photography software'),
+                       '$viewprof'     => DI::l10n()->t('View this profile'),
+                       '$viewallprof'  => DI::l10n()->t('View all profiles'),
+                       '$editvis'      => DI::l10n()->t('Edit visibility'),
+                       '$cr_prof'      => DI::l10n()->t('Create a new profile using these settings'),
+                       '$cl_prof'      => DI::l10n()->t('Clone this profile'),
+                       '$del_prof'     => DI::l10n()->t('Delete this profile'),
+
+                       '$lbl_basic_section' => DI::l10n()->t('Basic information'),
+                       '$lbl_picture_section' => DI::l10n()->t('Profile picture'),
+                       '$lbl_location_section' => DI::l10n()->t('Location'),
+                       '$lbl_preferences_section' => DI::l10n()->t('Preferences'),
+                       '$lbl_status_section' => DI::l10n()->t('Status information'),
+                       '$lbl_about_section' => DI::l10n()->t('Additional information'),
+                       '$lbl_interests_section' => DI::l10n()->t('Interests'),
+                       '$lbl_personal_section' => DI::l10n()->t('Personal'),
+                       '$lbl_relation_section' => DI::l10n()->t('Relation'),
+                       '$lbl_miscellaneous_section' => DI::l10n()->t('Miscellaneous'),
+
+                       '$lbl_profile_photo' => DI::l10n()->t('Upload Profile Photo'),
+                       '$lbl_gender' => DI::l10n()->t('Your Gender:'),
+                       '$lbl_marital' => DI::l10n()->t('<span class="heart">&hearts;</span> Marital Status:'),
+                       '$lbl_sexual' => DI::l10n()->t('Sexual Preference:'),
+                       '$lbl_ex2' => DI::l10n()->t('Example: fishing photography software'),
 
                        '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
                        '$baseurl' => DI::baseUrl()->get(true),
                        '$profile_id' => $r[0]['id'],
-                       '$profile_name' => ['profile_name', L10n::t('Profile Name:'), $r[0]['profile-name'], L10n::t('Required'), '*'],
+                       '$profile_name' => ['profile_name', DI::l10n()->t('Profile Name:'), $r[0]['profile-name'], DI::l10n()->t('Required'), '*'],
                        '$is_default'   => $is_default,
-                       '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . L10n::t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
-                       '$name' => ['name', L10n::t('Your Full Name:'), $r[0]['name']],
-                       '$pdesc' => ['pdesc', L10n::t('Title/Description:'), $r[0]['pdesc']],
+                       '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . DI::l10n()->t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
+                       '$name' => ['name', DI::l10n()->t('Your Full Name:'), $r[0]['name']],
+                       '$pdesc' => ['pdesc', DI::l10n()->t('Title/Description:'), $r[0]['pdesc']],
                        '$dob' => Temporal::getDateofBirthField($r[0]['dob'], $a->user['timezone']),
                        '$hide_friends' => $hide_friends,
-                       '$address' => ['address', L10n::t('Street Address:'), $r[0]['address']],
-                       '$locality' => ['locality', L10n::t('Locality/City:'), $r[0]['locality']],
-                       '$region' => ['region', L10n::t('Region/State:'), $r[0]['region']],
-                       '$postal_code' => ['postal_code', L10n::t('Postal/Zip Code:'), $r[0]['postal-code']],
-                       '$country_name' => ['country_name', L10n::t('Country:'), $r[0]['country-name']],
-                       '$age' => ((intval($r[0]['dob'])) ? '(' . L10n::t('Age: ') . Temporal::getAgeByTimezone($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
-                       '$gender' => L10n::t(ContactSelector::gender($r[0]['gender'])),
-                       '$marital' => ['selector' => ContactSelector::maritalStatus($r[0]['marital']), 'value' => L10n::t($r[0]['marital'])],
-                       '$with' => ['with', L10n::t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), L10n::t('Examples: cathy123, Cathy Williams, cathy@example.com')],
-                       '$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= DBA::NULL_DATETIME ? '' : DateTimeFormat::local($r[0]['howlong']))],
-                       '$sexual' => ['selector' => ContactSelector::sexualPreference($r[0]['sexual']), 'value' => L10n::t($r[0]['sexual'])],
-                       '$about' => ['about', L10n::t('Tell us about yourself...'), $r[0]['about']],
-                       '$xmpp' => ['xmpp', L10n::t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], L10n::t("The XMPP address will be propagated to your contacts so that they can follow you.")],
-                       '$homepage' => ['homepage', L10n::t('Homepage URL:'), $r[0]['homepage']],
-                       '$hometown' => ['hometown', L10n::t('Hometown:'), $r[0]['hometown']],
-                       '$politic' => ['politic', L10n::t('Political Views:'), $r[0]['politic']],
-                       '$religion' => ['religion', L10n::t('Religious Views:'), $r[0]['religion']],
-                       '$pub_keywords' => ['pub_keywords', L10n::t('Public Keywords:'), $r[0]['pub_keywords'], L10n::t("\x28Used for suggesting potential friends, can be seen by others\x29")],
-                       '$prv_keywords' => ['prv_keywords', L10n::t('Private Keywords:'), $r[0]['prv_keywords'], L10n::t("\x28Used for searching profiles, never shown to others\x29")],
-                       '$likes' => ['likes', L10n::t('Likes:'), $r[0]['likes']],
-                       '$dislikes' => ['dislikes', L10n::t('Dislikes:'), $r[0]['dislikes']],
-                       '$music' => ['music', L10n::t('Musical interests'), $r[0]['music']],
-                       '$book' => ['book', L10n::t('Books, literature'), $r[0]['book']],
-                       '$tv' => ['tv', L10n::t('Television'), $r[0]['tv']],
-                       '$film' => ['film', L10n::t('Film/dance/culture/entertainment'), $r[0]['film']],
-                       '$interest' => ['interest', L10n::t('Hobbies/Interests'), $r[0]['interest']],
-                       '$romance' => ['romance', L10n::t('Love/romance'), $r[0]['romance']],
-                       '$work' => ['work', L10n::t('Work/employment'), $r[0]['work']],
-                       '$education' => ['education', L10n::t('School/education'), $r[0]['education']],
-                       '$contact' => ['contact', L10n::t('Contact information and Social Networks'), $r[0]['contact']],
+                       '$address' => ['address', DI::l10n()->t('Street Address:'), $r[0]['address']],
+                       '$locality' => ['locality', DI::l10n()->t('Locality/City:'), $r[0]['locality']],
+                       '$region' => ['region', DI::l10n()->t('Region/State:'), $r[0]['region']],
+                       '$postal_code' => ['postal_code', DI::l10n()->t('Postal/Zip Code:'), $r[0]['postal-code']],
+                       '$country_name' => ['country_name', DI::l10n()->t('Country:'), $r[0]['country-name']],
+                       '$age' => ((intval($r[0]['dob'])) ? '(' . DI::l10n()->t('Age: ') . Temporal::getAgeByTimezone($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
+                       '$gender' => DI::l10n()->t(ContactSelector::gender($r[0]['gender'])),
+                       '$marital' => ['selector' => ContactSelector::maritalStatus($r[0]['marital']), 'value' => DI::l10n()->t($r[0]['marital'])],
+                       '$with' => ['with', DI::l10n()->t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), DI::l10n()->t('Examples: cathy123, Cathy Williams, cathy@example.com')],
+                       '$howlong' => ['howlong', DI::l10n()->t('Since [date]:'), ($r[0]['howlong'] <= DBA::NULL_DATETIME ? '' : DateTimeFormat::local($r[0]['howlong']))],
+                       '$sexual' => ['selector' => ContactSelector::sexualPreference($r[0]['sexual']), 'value' => DI::l10n()->t($r[0]['sexual'])],
+                       '$about' => ['about', DI::l10n()->t('Tell us about yourself...'), $r[0]['about']],
+                       '$xmpp' => ['xmpp', DI::l10n()->t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], DI::l10n()->t("The XMPP address will be propagated to your contacts so that they can follow you.")],
+                       '$homepage' => ['homepage', DI::l10n()->t('Homepage URL:'), $r[0]['homepage']],
+                       '$hometown' => ['hometown', DI::l10n()->t('Hometown:'), $r[0]['hometown']],
+                       '$politic' => ['politic', DI::l10n()->t('Political Views:'), $r[0]['politic']],
+                       '$religion' => ['religion', DI::l10n()->t('Religious Views:'), $r[0]['religion']],
+                       '$pub_keywords' => ['pub_keywords', DI::l10n()->t('Public Keywords:'), $r[0]['pub_keywords'], DI::l10n()->t("\x28Used for suggesting potential friends, can be seen by others\x29")],
+                       '$prv_keywords' => ['prv_keywords', DI::l10n()->t('Private Keywords:'), $r[0]['prv_keywords'], DI::l10n()->t("\x28Used for searching profiles, never shown to others\x29")],
+                       '$likes' => ['likes', DI::l10n()->t('Likes:'), $r[0]['likes']],
+                       '$dislikes' => ['dislikes', DI::l10n()->t('Dislikes:'), $r[0]['dislikes']],
+                       '$music' => ['music', DI::l10n()->t('Musical interests'), $r[0]['music']],
+                       '$book' => ['book', DI::l10n()->t('Books, literature'), $r[0]['book']],
+                       '$tv' => ['tv', DI::l10n()->t('Television'), $r[0]['tv']],
+                       '$film' => ['film', DI::l10n()->t('Film/dance/culture/entertainment'), $r[0]['film']],
+                       '$interest' => ['interest', DI::l10n()->t('Hobbies/Interests'), $r[0]['interest']],
+                       '$romance' => ['romance', DI::l10n()->t('Love/romance'), $r[0]['romance']],
+                       '$work' => ['work', DI::l10n()->t('Work/employment'), $r[0]['work']],
+                       '$education' => ['education', DI::l10n()->t('School/education'), $r[0]['education']],
+                       '$contact' => ['contact', DI::l10n()->t('Contact information and Social Networks'), $r[0]['contact']],
                ]);
 
                $arr = ['profile' => $r[0], 'entry' => $o];
@@ -655,18 +655,18 @@ function profiles_content(App $a) {
                                $profiles .= Renderer::replaceMacros($tpl, [
                                        '$photo'        => DI::baseUrl()->remove($rr['thumb']),
                                        '$id'           => $rr['id'],
-                                       '$alt'          => L10n::t('Profile Image'),
+                                       '$alt'          => DI::l10n()->t('Profile Image'),
                                        '$profile_name' => $rr['profile-name'],
-                                       '$visible'      => (($rr['is-default']) ? '<strong>' . L10n::t('visible to everybody') . '</strong>'
-                                               : '<a href="'.'profperm/'.$rr['id'].'" />' . L10n::t('Edit visibility') . '</a>')
+                                       '$visible'      => (($rr['is-default']) ? '<strong>' . DI::l10n()->t('visible to everybody') . '</strong>'
+                                               : '<a href="'.'profperm/'.$rr['id'].'" />' . DI::l10n()->t('Edit visibility') . '</a>')
                                ]);
                        }
 
                        $tpl_header = Renderer::getMarkupTemplate('profile_listing_header.tpl');
                        $o .= Renderer::replaceMacros($tpl_header,[
-                               '$header'      => L10n::t('Edit/Manage Profiles'),
-                               '$chg_photo'   => L10n::t('Change profile photo'),
-                               '$cr_new'      => L10n::t('Create New Profile'),
+                               '$header'      => DI::l10n()->t('Edit/Manage Profiles'),
+                               '$chg_photo'   => DI::l10n()->t('Change profile photo'),
+                               '$cr_new'      => DI::l10n()->t('Create New Profile'),
                                '$cr_new_link' => 'profiles/new?t=' . BaseModule::getFormSecurityToken("profile_new"),
                                '$profiles'    => $profiles
                        ]);
index a79358c819266853dbc977f3ee7cacc328561842..5c4325048d2dfd34975e1365754b1844895930f7 100644 (file)
@@ -27,13 +27,13 @@ function profperm_init(App $a)
 function profperm_content(App $a) {
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied') . EOL);
+               notice(DI::l10n()->t('Permission denied') . EOL);
                return;
        }
 
 
        if ($a->argc < 2) {
-               notice(L10n::t('Invalid profile identifier.') . EOL );
+               notice(DI::l10n()->t('Invalid profile identifier.') . EOL );
                return;
        }
 
@@ -66,7 +66,7 @@ function profperm_content(App $a) {
                        intval(local_user())
                );
                if (!DBA::isResult($r)) {
-                       notice(L10n::t('Invalid profile identifier.') . EOL );
+                       notice(DI::l10n()->t('Invalid profile identifier.') . EOL );
                        return;
                }
                $profile = $r[0];
@@ -112,11 +112,11 @@ function profperm_content(App $a) {
                                        $ingroup[] = $member['id'];
                }
 
-               $o .= '<h2>' . L10n::t('Profile Visibility Editor') . '</h2>';
+               $o .= '<h2>' . DI::l10n()->t('Profile Visibility Editor') . '</h2>';
 
-               $o .= '<h3>' . L10n::t('Profile') . ' \'' . $profile['profile-name'] . '\'</h3>';
+               $o .= '<h3>' . DI::l10n()->t('Profile') . ' \'' . $profile['profile-name'] . '\'</h3>';
 
-               $o .= '<div id="prof-edit-desc">' . L10n::t('Click on a contact to add or remove.') . '</div>';
+               $o .= '<div id="prof-edit-desc">' . DI::l10n()->t('Click on a contact to add or remove.') . '</div>';
 
        }
 
@@ -125,7 +125,7 @@ function profperm_content(App $a) {
                $o = '';
 
        $o .= '<div id="prof-members-title">';
-       $o .= '<h3>' . L10n::t('Visible To') . '</h3>';
+       $o .= '<h3>' . DI::l10n()->t('Visible To') . '</h3>';
        $o .= '</div>';
        $o .= '<div id="prof-members">';
 
@@ -141,7 +141,7 @@ function profperm_content(App $a) {
        $o .= '<hr id="prof-separator" />';
 
        $o .= '<div id="prof-all-contcts-title">';
-       $o .= '<h3>' . L10n::t("All Contacts \x28with secure profile access\x29") . '</h3>';
+       $o .= '<h3>' . DI::l10n()->t("All Contacts \x28with secure profile access\x29") . '</h3>';
        $o .= '</div>';
        $o .= '<div id="prof-all-contacts">';
 
index 4c687e40d328ac88facd3fe9ab19f9bc487f0edb..990ebc194e2811f892fa678d18b26b3cb2fc5c3e 100644 (file)
@@ -30,7 +30,7 @@ function redir_init(App $a) {
                $fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name', 'network', 'poll', 'issued-id', 'dfrn-id', 'duplex', 'pending'];
                $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
                if (!DBA::isResult($contact)) {
-                       notice(L10n::t('Contact not found.'));
+                       notice(DI::l10n()->t('Contact not found.'));
                        DI::baseUrl()->redirect();
                }
 
@@ -120,7 +120,7 @@ function redir_init(App $a) {
                $a->redirect($url);
        }
 
-       notice(L10n::t('Contact not found.'));
+       notice(DI::l10n()->t('Contact not found.'));
        DI::baseUrl()->redirect();
 }
 
@@ -135,7 +135,7 @@ function redir_magic($a, $cid, $url)
        if (!DBA::isResult($contact)) {
                Logger::info('Contact not found', ['id' => $cid]);
                // Shouldn't happen under normal conditions
-               notice(L10n::t('Contact not found.'));
+               notice(DI::l10n()->t('Contact not found.'));
                if (!empty($url)) {
                        System::externalRedirect($url);
                } else {
index 49845e873191405bfef373066760ede30061d843..4cdd0384587d933739ddfd310909a7581daccba7 100644 (file)
@@ -47,7 +47,7 @@ function user_allow($hash)
        );
 
        if ($res) {
-               info(L10n::t('Account approved.') . EOL);
+               info(DI::l10n()->t('Account approved.') . EOL);
                return true;
        }
 }
@@ -71,19 +71,19 @@ function user_deny($hash)
 
        Register::deleteByHash($register['hash']);
 
-       notice(L10n::t('Registration revoked for %s', $user['username']) . EOL);
+       notice(DI::l10n()->t('Registration revoked for %s', $user['username']) . EOL);
        return true;
 }
 
 function regmod_content(App $a)
 {
        if (!local_user()) {
-               info(L10n::t('Please login.') . EOL);
+               info(DI::l10n()->t('Please login.') . EOL);
                return Login::form(DI::args()->getQueryString(), intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 0 : 1);
        }
 
        if (!is_site_admin() || !empty($_SESSION['submanage'])) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return '';
        }
 
index ecf65c04c1969747ef9462c1296dd6b14eb20973..85b0eaa11c8793ddcafacb2651e382650fd8c8ec 100644 (file)
@@ -44,9 +44,9 @@ function removeme_post(App $a)
                }
                notification([
                        'type'         => SYSTEM_EMAIL,
-                       'subject'      => L10n::t('[Friendica System Notify]') . ' ' . L10n::t('User deleted their account'),
-                       'preamble'     => L10n::t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
-                       'body'         => L10n::t('The user id is %d', local_user()),
+                       'subject'      => DI::l10n()->t('[Friendica System Notify]') . ' ' . DI::l10n()->t('User deleted their account'),
+                       'preamble'     => DI::l10n()->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
+                       'body'         => DI::l10n()->t('The user id is %d', local_user()),
                        'to_email'     => $admin['email'],
                        'to_name'      => $admin['username'],
                        'uid'          => $admin['uid'],
@@ -82,10 +82,10 @@ function removeme_content(App $a)
        $o = Renderer::replaceMacros($tpl, [
                '$basedir' => DI::baseUrl()->get(),
                '$hash' => $hash,
-               '$title' => L10n::t('Remove My Account'),
-               '$desc' => L10n::t('This will completely remove your account. Once this has been done it is not recoverable.'),
-               '$passwd' => L10n::t('Please enter your password for verification:'),
-               '$submit' => L10n::t('Remove My Account')
+               '$title' => DI::l10n()->t('Remove My Account'),
+               '$desc' => DI::l10n()->t('This will completely remove your account. Once this has been done it is not recoverable.'),
+               '$passwd' => DI::l10n()->t('Please enter your password for verification:'),
+               '$submit' => DI::l10n()->t('Remove My Account')
        ]);
 
        return $o;
index a4ba0b72ee1230a0f7669cf0e6ca791fe923481e..8ae9f3b266d33d62dc30c7ce7f954b5cbf1caf17 100644 (file)
@@ -13,12 +13,12 @@ use Friendica\Model\Contact;
 function repair_ostatus_content(App $a) {
 
        if (! local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                DI::baseUrl()->redirect('ostatus_repair');
                // NOTREACHED
        }
 
-       $o = "<h2>".L10n::t("Resubscribing to OStatus contacts")."</h2>";
+       $o = "<h2>".DI::l10n()->t("Resubscribing to OStatus contacts")."</h2>";
 
        $uid = local_user();
 
@@ -32,7 +32,7 @@ function repair_ostatus_content(App $a) {
                intval(Contact::SHARING));
 
        if (!DBA::isResult($r)) {
-               return ($o . L10n::t("Error"));
+               return ($o . DI::l10n()->t("Error"));
        }
 
        $total = $r[0]["total"];
@@ -47,13 +47,13 @@ function repair_ostatus_content(App $a) {
                intval(Contact::SHARING), $counter++);
 
        if (!DBA::isResult($r)) {
-               $o .= L10n::t("Done");
+               $o .= DI::l10n()->t("Done");
                return $o;
        }
 
        $o .= "<p>".$counter."/".$total.": ".$r[0]["url"]."</p>";
 
-       $o .= "<p>".L10n::t("Keep this window open until done.")."</p>";
+       $o .= "<p>".DI::l10n()->t("Keep this window open until done.")."</p>";
 
        Contact::createFromProbe($uid, $r[0]["url"], true);
 
index 8213fda7c9b4b40cce17cf910653b333572fde9c..412748aab570d6ad367cd03d8bf8f0a5a821a53e 100644 (file)
@@ -47,7 +47,7 @@ function get_theme_config_file($theme)
 function settings_init(App $a)
 {
        if (!local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -55,12 +55,12 @@ function settings_init(App $a)
 
        $tpl = Renderer::getMarkupTemplate('settings/head.tpl');
        DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-               '$ispublic' => L10n::t('everybody')
+               '$ispublic' => DI::l10n()->t('everybody')
        ]);
 
        $tabs = [
                [
-                       'label' => L10n::t('Account'),
+                       'label' => DI::l10n()->t('Account'),
                        'url'   => 'settings',
                        'selected'      =>  (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''),
                        'accesskey' => 'o',
@@ -68,14 +68,14 @@ function settings_init(App $a)
        ];
 
        $tabs[] = [
-               'label' => L10n::t('Two-factor authentication'),
+               'label' => DI::l10n()->t('Two-factor authentication'),
                'url' => 'settings/2fa',
                'selected' => (($a->argc > 1) && ($a->argv[1] === '2fa') ? 'active' : ''),
                'accesskey' => 'o',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Profiles'),
+               'label' => DI::l10n()->t('Profiles'),
                'url'   => 'profiles',
                'selected'      => (($a->argc == 1) && ($a->argv[0] === 'profiles')?'active':''),
                'accesskey' => 'p',
@@ -83,7 +83,7 @@ function settings_init(App $a)
 
        if (Feature::get()) {
                $tabs[] =       [
-                                       'label' => L10n::t('Additional features'),
+                                       'label' => DI::l10n()->t('Additional features'),
                                        'url'   => 'settings/features',
                                        'selected'      => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
                                        'accesskey' => 't',
@@ -91,49 +91,49 @@ function settings_init(App $a)
        }
 
        $tabs[] =       [
-               'label' => L10n::t('Display'),
+               'label' => DI::l10n()->t('Display'),
                'url'   => 'settings/display',
                'selected'      => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
                'accesskey' => 'i',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Social Networks'),
+               'label' => DI::l10n()->t('Social Networks'),
                'url'   => 'settings/connectors',
                'selected'      => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
                'accesskey' => 'w',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Addons'),
+               'label' => DI::l10n()->t('Addons'),
                'url'   => 'settings/addon',
                'selected'      => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
                'accesskey' => 'l',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Delegations'),
+               'label' => DI::l10n()->t('Delegations'),
                'url'   => 'settings/delegation',
                'selected'      => (($a->argc > 1) && ($a->argv[1] === 'delegation')?'active':''),
                'accesskey' => 'd',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Connected apps'),
+               'label' => DI::l10n()->t('Connected apps'),
                'url' => 'settings/oauth',
                'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
                'accesskey' => 'b',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Export personal data'),
+               'label' => DI::l10n()->t('Export personal data'),
                'url' => 'settings/userexport',
                'selected' => (($a->argc > 1) && ($a->argv[1] === 'userexport')?'active':''),
                'accesskey' => 'e',
        ];
 
        $tabs[] =       [
-               'label' => L10n::t('Remove account'),
+               'label' => DI::l10n()->t('Remove account'),
                'url' => 'removeme',
                'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''),
                'accesskey' => 'r',
@@ -142,7 +142,7 @@ function settings_init(App $a)
 
        $tabtpl = Renderer::getMarkupTemplate("generic_links_widget.tpl");
        DI::page()['aside'] = Renderer::replaceMacros($tabtpl, [
-               '$title' => L10n::t('Settings'),
+               '$title' => DI::l10n()->t('Settings'),
                '$class' => 'settings-widget',
                '$items' => $tabs,
        ]);
@@ -160,7 +160,7 @@ function settings_post(App $a)
        }
 
        if (count($a->user) && !empty($a->user['uid']) && $a->user['uid'] != local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -185,9 +185,9 @@ function settings_post(App $a)
                $icon     = $_POST['icon']     ?? '';
 
                if ($name == "" || $key == "" || $secret == "") {
-                       notice(L10n::t("Missing some important data!"));
+                       notice(DI::l10n()->t("Missing some important data!"));
                } else {
-                       if ($_POST['submit'] == L10n::t("Update")) {
+                       if ($_POST['submit'] == DI::l10n()->t("Update")) {
                                q("UPDATE clients SET
                                                        client_id='%s',
                                                        pw='%s',
@@ -295,12 +295,12 @@ function settings_post(App $a)
                                                unset($dcrpass);
                                                if (!$mbox) {
                                                        $failed = true;
-                                                       notice(L10n::t('Failed to connect with email account using the settings provided.') . EOL);
+                                                       notice(DI::l10n()->t('Failed to connect with email account using the settings provided.') . EOL);
                                                }
                                        }
                                }
                                if (!$failed) {
-                                       info(L10n::t('Email settings updated.') . EOL);
+                                       info(DI::l10n()->t('Email settings updated.') . EOL);
                                }
                        }
                }
@@ -316,7 +316,7 @@ function settings_post(App $a)
                                DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
                        }
                }
-               info(L10n::t('Features updated') . EOL);
+               info(DI::l10n()->t('Features updated') . EOL);
                return;
        }
 
@@ -377,7 +377,7 @@ function settings_post(App $a)
                                DBA::update('user', ['theme' => $theme], ['uid' => local_user()]);
                        }
                } else {
-                       notice(L10n::t('The theme you chose isn\'t available.'));
+                       notice(DI::l10n()->t('The theme you chose isn\'t available.'));
                }
 
                Hook::callAll('display_settings_post', $_POST);
@@ -393,7 +393,7 @@ function settings_post(App $a)
                        // was there an error
                        if ($_FILES['importcontact-filename']['error'] > 0) {
                                Logger::notice('Contact CSV file upload error');
-                               info(L10n::t('Contact CSV file upload error'));
+                               info(DI::l10n()->t('Contact CSV file upload error'));
                        } else {
                                $csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name']));
                                // import contacts
@@ -407,7 +407,7 @@ function settings_post(App $a)
                                                $arr = Contact::createFromProbe($_SESSION['uid'], $csvRow[0], '', false);
                                        }
                                }
-                               info(L10n::t('Importing Contacts done'));
+                               info(DI::l10n()->t('Importing Contacts done'));
                                // delete temp file
                                unlink($filename);
                        }
@@ -416,7 +416,7 @@ function settings_post(App $a)
 
        if (!empty($_POST['resend_relocate'])) {
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
-               info(L10n::t("Relocate message has been send to your contacts"));
+               info(DI::l10n()->t("Relocate message has been send to your contacts"));
                DI::baseUrl()->redirect('settings');
        }
 
@@ -428,7 +428,7 @@ function settings_post(App $a)
 
                try {
                        if ($newpass != $confirm) {
-                               throw new Exception(L10n::t('Passwords do not match.'));
+                               throw new Exception(DI::l10n()->t('Passwords do not match.'));
                        }
 
                        //  check if the old password was supplied correctly before changing it to the new value
@@ -436,13 +436,13 @@ function settings_post(App $a)
 
                        $result = User::updatePassword(local_user(), $newpass);
                        if (!DBA::isResult($result)) {
-                               throw new Exception(L10n::t('Password update failed. Please try again.'));
+                               throw new Exception(DI::l10n()->t('Password update failed. Please try again.'));
                        }
 
-                       info(L10n::t('Password changed.'));
+                       info(DI::l10n()->t('Password changed.'));
                } catch (Exception $e) {
                        notice($e->getMessage());
-                       notice(L10n::t('Password unchanged.'));
+                       notice(DI::l10n()->t('Password unchanged.'));
                }
        }
 
@@ -524,28 +524,28 @@ function settings_post(App $a)
 
        if ($username != $a->user['username']) {
                if (strlen($username) > 40) {
-                       $err .= L10n::t(' Please use a shorter name.');
+                       $err .= DI::l10n()->t(' Please use a shorter name.');
                }
                if (strlen($username) < 3) {
-                       $err .= L10n::t(' Name too short.');
+                       $err .= DI::l10n()->t(' Name too short.');
                }
        }
 
        if ($email != $a->user['email']) {
                //  check for the correct password
                if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
-                       $err .= L10n::t('Wrong Password') . EOL;
+                       $err .= DI::l10n()->t('Wrong Password') . EOL;
                        $email = $a->user['email'];
                }
                //  check the email is valid
                if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
-                       $err .= L10n::t('Invalid email.');
+                       $err .= DI::l10n()->t('Invalid email.');
                }
                //  ensure new email is not the admin mail
                if (Config::get('config', 'admin_email')) {
                        $adminlist = explode(",", str_replace(" ", "", strtolower(Config::get('config', 'admin_email'))));
                        if (in_array(strtolower($email), $adminlist)) {
-                               $err .= L10n::t('Cannot change to that email.');
+                               $err .= DI::l10n()->t('Cannot change to that email.');
                                $email = $a->user['email'];
                        }
                }
@@ -582,10 +582,10 @@ function settings_post(App $a)
                $hidewall = 1;
                if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) {
                        if ($def_gid) {
-                               info(L10n::t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
+                               info(DI::l10n()->t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
                                $str_group_allow = '<' . $def_gid . '>';
                        } else {
-                               notice(L10n::t('Private forum has no privacy permissions and no default privacy group.') . EOL);
+                               notice(DI::l10n()->t('Private forum has no privacy permissions and no default privacy group.') . EOL);
                        }
                }
        }
@@ -602,7 +602,7 @@ function settings_post(App $a)
        }
 
        if (DBA::update('user', $fields, ['uid' => local_user()])) {
-               info(L10n::t('Settings updated.') . EOL);
+               info(DI::l10n()->t('Settings updated.') . EOL);
        }
 
        // clear session language
@@ -647,12 +647,12 @@ function settings_content(App $a)
        Nav::setSelected('settings');
 
        if (!local_user()) {
-               //notice(L10n::t('Permission denied.') . EOL);
+               //notice(DI::l10n()->t('Permission denied.') . EOL);
                return Login::form();
        }
 
        if (!empty($_SESSION['submanage'])) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -661,14 +661,14 @@ function settings_content(App $a)
                        $tpl = Renderer::getMarkupTemplate('settings/oauth_edit.tpl');
                        $o .= Renderer::replaceMacros($tpl, [
                                '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                               '$title'        => L10n::t('Add application'),
-                               '$submit'       => L10n::t('Save Settings'),
-                               '$cancel'       => L10n::t('Cancel'),
-                               '$name'         => ['name', L10n::t('Name'), '', ''],
-                               '$key'          => ['key', L10n::t('Consumer Key'), '', ''],
-                               '$secret'       => ['secret', L10n::t('Consumer Secret'), '', ''],
-                               '$redirect'     => ['redirect', L10n::t('Redirect'), '', ''],
-                               '$icon'         => ['icon', L10n::t('Icon url'), '', ''],
+                               '$title'        => DI::l10n()->t('Add application'),
+                               '$submit'       => DI::l10n()->t('Save Settings'),
+                               '$cancel'       => DI::l10n()->t('Cancel'),
+                               '$name'         => ['name', DI::l10n()->t('Name'), '', ''],
+                               '$key'          => ['key', DI::l10n()->t('Consumer Key'), '', ''],
+                               '$secret'       => ['secret', DI::l10n()->t('Consumer Secret'), '', ''],
+                               '$redirect'     => ['redirect', DI::l10n()->t('Redirect'), '', ''],
+                               '$icon'         => ['icon', DI::l10n()->t('Icon url'), '', ''],
                        ]);
                        return $o;
                }
@@ -679,7 +679,7 @@ function settings_content(App $a)
                                        local_user());
 
                        if (!DBA::isResult($r)) {
-                               notice(L10n::t("You can't edit this application."));
+                               notice(DI::l10n()->t("You can't edit this application."));
                                return;
                        }
                        $app = $r[0];
@@ -687,14 +687,14 @@ function settings_content(App $a)
                        $tpl = Renderer::getMarkupTemplate('settings/oauth_edit.tpl');
                        $o .= Renderer::replaceMacros($tpl, [
                                '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                               '$title'        => L10n::t('Add application'),
-                               '$submit'       => L10n::t('Update'),
-                               '$cancel'       => L10n::t('Cancel'),
-                               '$name'         => ['name', L10n::t('Name'), $app['name'] , ''],
-                               '$key'          => ['key', L10n::t('Consumer Key'), $app['client_id'], ''],
-                               '$secret'       => ['secret', L10n::t('Consumer Secret'), $app['pw'], ''],
-                               '$redirect'     => ['redirect', L10n::t('Redirect'), $app['redirect_uri'], ''],
-                               '$icon'         => ['icon', L10n::t('Icon url'), $app['icon'], ''],
+                               '$title'        => DI::l10n()->t('Add application'),
+                               '$submit'       => DI::l10n()->t('Update'),
+                               '$cancel'       => DI::l10n()->t('Cancel'),
+                               '$name'         => ['name', DI::l10n()->t('Name'), $app['name'] , ''],
+                               '$key'          => ['key', DI::l10n()->t('Consumer Key'), $app['client_id'], ''],
+                               '$secret'       => ['secret', DI::l10n()->t('Consumer Secret'), $app['pw'], ''],
+                               '$redirect'     => ['redirect', DI::l10n()->t('Redirect'), $app['redirect_uri'], ''],
+                               '$icon'         => ['icon', DI::l10n()->t('Icon url'), $app['icon'], ''],
                        ]);
                        return $o;
                }
@@ -720,13 +720,13 @@ function settings_content(App $a)
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
                        '$baseurl'      => DI::baseUrl()->get(true),
-                       '$title'        => L10n::t('Connected Apps'),
-                       '$add'          => L10n::t('Add application'),
-                       '$edit'         => L10n::t('Edit'),
-                       '$delete'               => L10n::t('Delete'),
-                       '$consumerkey' => L10n::t('Client key starts with'),
-                       '$noname'       => L10n::t('No name'),
-                       '$remove'       => L10n::t('Remove authorization'),
+                       '$title'        => DI::l10n()->t('Connected Apps'),
+                       '$add'          => DI::l10n()->t('Add application'),
+                       '$edit'         => DI::l10n()->t('Edit'),
+                       '$delete'               => DI::l10n()->t('Delete'),
+                       '$consumerkey' => DI::l10n()->t('Client key starts with'),
+                       '$noname'       => DI::l10n()->t('No name'),
+                       '$remove'       => DI::l10n()->t('Remove authorization'),
                        '$apps'         => $r,
                ]);
                return $o;
@@ -737,7 +737,7 @@ function settings_content(App $a)
 
                $r = q("SELECT * FROM `hook` WHERE `hook` = 'addon_settings' ");
                if (!DBA::isResult($r)) {
-                       $settings_addons = L10n::t('No Addon settings configured');
+                       $settings_addons = DI::l10n()->t('No Addon settings configured');
                }
 
                Hook::callAll('addon_settings', $settings_addons);
@@ -746,7 +746,7 @@ function settings_content(App $a)
                $tpl = Renderer::getMarkupTemplate('settings/addons.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_addon"),
-                       '$title'        => L10n::t('Addon Settings'),
+                       '$title'        => DI::l10n()->t('Addon Settings'),
                        '$settings_addons' => $settings_addons
                ]);
                return $o;
@@ -760,16 +760,16 @@ function settings_content(App $a)
                        $arr[$fname] = [];
                        $arr[$fname][0] = $fdata[0];
                        foreach (array_slice($fdata,1) as $f) {
-                               $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[L10n::t('Off'), L10n::t('On')]];
+                               $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[DI::l10n()->t('Off'), DI::l10n()->t('On')]];
                        }
                }
 
                $tpl = Renderer::getMarkupTemplate('settings/features.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_features"),
-                       '$title'               => L10n::t('Additional Features'),
+                       '$title'               => DI::l10n()->t('Additional Features'),
                        '$features'            => $arr,
-                       '$submit'              => L10n::t('Save Settings'),
+                       '$submit'              => DI::l10n()->t('Save Settings'),
                ]);
                return $o;
        }
@@ -792,8 +792,8 @@ function settings_content(App $a)
                Hook::callAll('connector_settings', $settings_connectors);
 
                if (is_site_admin()) {
-                       $diasp_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? L10n::t('enabled') : L10n::t('disabled')));
-                       $ostat_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t("GNU Social \x28OStatus\x29"), ((Config::get('system', 'ostatus_disabled')) ? L10n::t('disabled') : L10n::t('enabled')));
+                       $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled')));
+                       $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t("GNU Social \x28OStatus\x29"), ((Config::get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled')));
                } else {
                        $diasp_enabled = "";
                        $ostat_enabled = "";
@@ -824,50 +824,50 @@ function settings_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('settings/connectors.tpl');
 
-               $mail_disabled_message = ($mail_disabled ? L10n::t('Email access is disabled on this site.') : '');
+               $mail_disabled_message = ($mail_disabled ? DI::l10n()->t('Email access is disabled on this site.') : '');
 
                $ssl_options = ['TLS' => 'TLS', 'SSL' => 'SSL'];
 
                if (Config::get('system', 'insecure_imap')) {
-                       $ssl_options['notls'] = L10n::t('None');
+                       $ssl_options['notls'] = DI::l10n()->t('None');
                }
 
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_connectors"),
 
-                       '$title'        => L10n::t('Social Networks'),
+                       '$title'        => DI::l10n()->t('Social Networks'),
 
                        '$diasp_enabled' => $diasp_enabled,
                        '$ostat_enabled' => $ostat_enabled,
 
-                       '$general_settings' => L10n::t('General Social Media Settings'),
-                       '$accept_only_sharer' => ['accept_only_sharer', L10n::t('Accept only top level posts by contacts you follow'), $accept_only_sharer, L10n::t('The system does an auto completion of threads when a comment arrives. This has got the side effect that you can receive posts that had been started by a non-follower but had been commented by someone you follow. This setting deactivates this behaviour. When activated, you strictly only will receive posts from people you really do follow.')],
-                       '$disable_cw' => ['disable_cw', L10n::t('Disable Content Warning'), $disable_cw, L10n::t('Users on networks like Mastodon or Pleroma are able to set a content warning field which collapse their post by default. This disables the automatic collapsing and sets the content warning as the post title. Doesn\'t affect any other content filtering you eventually set up.')],
-                       '$no_intelligent_shortening' => ['no_intelligent_shortening', L10n::t('Disable intelligent shortening'), $no_intelligent_shortening, L10n::t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
-                       '$attach_link_title' => ['attach_link_title', L10n::t('Attach the link title'), $attach_link_title, L10n::t('When activated, the title of the attached link will be added as a title on posts to Diaspora. This is mostly helpful with "remote-self" contacts that share feed content.')],
-                       '$ostatus_autofriend' => ['snautofollow', L10n::t("Automatically follow any GNU Social \x28OStatus\x29 followers/mentioners"), $ostatus_autofriend, L10n::t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
-                       '$default_group' => Group::displayGroupSelection(local_user(), $default_group, L10n::t("Default group for OStatus contacts")),
-                       '$legacy_contact' => ['legacy_contact', L10n::t('Your legacy GNU Social account'), $legacy_contact, L10n::t("If you enter your old GNU Social/Statusnet account name here \x28in the format user@domain.tld\x29, your contacts will be added automatically. The field will be emptied when done.")],
+                       '$general_settings' => DI::l10n()->t('General Social Media Settings'),
+                       '$accept_only_sharer' => ['accept_only_sharer', DI::l10n()->t('Accept only top level posts by contacts you follow'), $accept_only_sharer, DI::l10n()->t('The system does an auto completion of threads when a comment arrives. This has got the side effect that you can receive posts that had been started by a non-follower but had been commented by someone you follow. This setting deactivates this behaviour. When activated, you strictly only will receive posts from people you really do follow.')],
+                       '$disable_cw' => ['disable_cw', DI::l10n()->t('Disable Content Warning'), $disable_cw, DI::l10n()->t('Users on networks like Mastodon or Pleroma are able to set a content warning field which collapse their post by default. This disables the automatic collapsing and sets the content warning as the post title. Doesn\'t affect any other content filtering you eventually set up.')],
+                       '$no_intelligent_shortening' => ['no_intelligent_shortening', DI::l10n()->t('Disable intelligent shortening'), $no_intelligent_shortening, DI::l10n()->t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
+                       '$attach_link_title' => ['attach_link_title', DI::l10n()->t('Attach the link title'), $attach_link_title, DI::l10n()->t('When activated, the title of the attached link will be added as a title on posts to Diaspora. This is mostly helpful with "remote-self" contacts that share feed content.')],
+                       '$ostatus_autofriend' => ['snautofollow', DI::l10n()->t("Automatically follow any GNU Social \x28OStatus\x29 followers/mentioners"), $ostatus_autofriend, DI::l10n()->t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
+                       '$default_group' => Group::displayGroupSelection(local_user(), $default_group, DI::l10n()->t("Default group for OStatus contacts")),
+                       '$legacy_contact' => ['legacy_contact', DI::l10n()->t('Your legacy GNU Social account'), $legacy_contact, DI::l10n()->t("If you enter your old GNU Social/Statusnet account name here \x28in the format user@domain.tld\x29, your contacts will be added automatically. The field will be emptied when done.")],
 
                        '$repair_ostatus_url' => DI::baseUrl() . '/repair_ostatus',
-                       '$repair_ostatus_text' => L10n::t('Repair OStatus subscriptions'),
+                       '$repair_ostatus_text' => DI::l10n()->t('Repair OStatus subscriptions'),
 
                        '$settings_connectors' => $settings_connectors,
 
-                       '$h_imap' => L10n::t('Email/Mailbox Setup'),
-                       '$imap_desc' => L10n::t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
-                       '$imap_lastcheck' => ['imap_lastcheck', L10n::t('Last successful email check:'), $mail_chk, ''],
+                       '$h_imap' => DI::l10n()->t('Email/Mailbox Setup'),
+                       '$imap_desc' => DI::l10n()->t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
+                       '$imap_lastcheck' => ['imap_lastcheck', DI::l10n()->t('Last successful email check:'), $mail_chk, ''],
                        '$mail_disabled' => $mail_disabled_message,
-                       '$mail_server'  => ['mail_server',      L10n::t('IMAP server name:'), $mail_server, ''],
-                       '$mail_port'    => ['mail_port',        L10n::t('IMAP port:'), $mail_port, ''],
-                       '$mail_ssl'     => ['mail_ssl',         L10n::t('Security:'), strtoupper($mail_ssl), '', $ssl_options],
-                       '$mail_user'    => ['mail_user',        L10n::t('Email login name:'), $mail_user, ''],
-                       '$mail_pass'    => ['mail_pass',        L10n::t('Email password:'), '', ''],
-                       '$mail_replyto' => ['mail_replyto',     L10n::t('Reply-to address:'), $mail_replyto, 'Optional'],
-                       '$mail_pubmail' => ['mail_pubmail',     L10n::t('Send public posts to all email contacts:'), $mail_pubmail, ''],
-                       '$mail_action'  => ['mail_action',      L10n::t('Action after import:'), $mail_action, '', [0 => L10n::t('None'), 1 => L10n::t('Delete'), 2 => L10n::t('Mark as seen'), 3 => L10n::t('Move to folder')]],
-                       '$mail_movetofolder' => ['mail_movetofolder', L10n::t('Move to folder:'), $mail_movetofolder, ''],
-                       '$submit' => L10n::t('Save Settings'),
+                       '$mail_server'  => ['mail_server',      DI::l10n()->t('IMAP server name:'), $mail_server, ''],
+                       '$mail_port'    => ['mail_port',        DI::l10n()->t('IMAP port:'), $mail_port, ''],
+                       '$mail_ssl'     => ['mail_ssl',         DI::l10n()->t('Security:'), strtoupper($mail_ssl), '', $ssl_options],
+                       '$mail_user'    => ['mail_user',        DI::l10n()->t('Email login name:'), $mail_user, ''],
+                       '$mail_pass'    => ['mail_pass',        DI::l10n()->t('Email password:'), '', ''],
+                       '$mail_replyto' => ['mail_replyto',     DI::l10n()->t('Reply-to address:'), $mail_replyto, 'Optional'],
+                       '$mail_pubmail' => ['mail_pubmail',     DI::l10n()->t('Send public posts to all email contacts:'), $mail_pubmail, ''],
+                       '$mail_action'  => ['mail_action',      DI::l10n()->t('Action after import:'), $mail_action, '', [0 => DI::l10n()->t('None'), 1 => DI::l10n()->t('Delete'), 2 => DI::l10n()->t('Mark as seen'), 3 => DI::l10n()->t('Move to folder')]],
+                       '$mail_movetofolder' => ['mail_movetofolder', DI::l10n()->t('Move to folder:'), $mail_movetofolder, ''],
+                       '$submit' => DI::l10n()->t('Save Settings'),
                ]);
 
                Hook::callAll('display_settings', $o);
@@ -890,7 +890,7 @@ function settings_content(App $a)
                $allowed_themes = Theme::getAllowedList();
 
                $themes = [];
-               $mobile_themes = ["---" => L10n::t('No special theme for mobile devices')];
+               $mobile_themes = ["---" => DI::l10n()->t('No special theme for mobile devices')];
                foreach ($allowed_themes as $theme) {
                        $is_experimental = file_exists('view/theme/' . $theme . '/experimental');
                        $is_unsupported  = file_exists('view/theme/' . $theme . '/unsupported');
@@ -898,9 +898,9 @@ function settings_content(App $a)
                        if (!$is_experimental || ($is_experimental && (Config::get('experimentals', 'exp_themes')==1 || is_null(Config::get('experimentals', 'exp_themes'))))) {
                                $theme_name = ucfirst($theme);
                                if ($is_unsupported) {
-                                       $theme_name = L10n::t('%s - (Unsupported)', $theme_name);
+                                       $theme_name = DI::l10n()->t('%s - (Unsupported)', $theme_name);
                                } elseif ($is_experimental) {
-                                       $theme_name = L10n::t('%s - (Experimental)', $theme_name);
+                                       $theme_name = DI::l10n()->t('%s - (Experimental)', $theme_name);
                                }
 
                                if ($is_mobile) {
@@ -928,7 +928,7 @@ function settings_content(App $a)
 
                $nosmile = DI::pConfig()->get(local_user(), 'system', 'no_smilies', 0);
                $first_day_of_week = DI::pConfig()->get(local_user(), 'system', 'first_day_of_week', 0);
-               $weekdays = [0 => L10n::t("Sunday"), 1 => L10n::t("Monday")];
+               $weekdays = [0 => DI::l10n()->t("Sunday"), 1 => DI::l10n()->t("Monday")];
 
                $noinfo = DI::pConfig()->get(local_user(), 'system', 'ignore_info', 0);
                $infinite_scroll = DI::pConfig()->get(local_user(), 'system', 'infinite_scroll', 0);
@@ -944,31 +944,31 @@ function settings_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('settings/display.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$ptitle'       => L10n::t('Display Settings'),
+                       '$ptitle'       => DI::l10n()->t('Display Settings'),
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_display"),
-                       '$submit'       => L10n::t('Save Settings'),
+                       '$submit'       => DI::l10n()->t('Save Settings'),
                        '$baseurl' => DI::baseUrl()->get(true),
                        '$uid' => local_user(),
 
-                       '$theme'        => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes, true],
-                       '$mobile_theme' => ['mobile_theme', L10n::t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
-                       '$nowarn_insecure' => ['nowarn_insecure',  L10n::t('Suppress warning of insecure networks'), $nowarn_insecure, L10n::t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
-                       '$ajaxint'   => ['browser_update',  L10n::t("Update browser every xx seconds"), $browser_update, L10n::t('Minimum of 10 seconds. Enter -1 to disable it.')],
-                       '$itemspage_network'   => ['itemspage_network',  L10n::t("Number of items to display per page:"), $itemspage_network, L10n::t('Maximum of 100 items')],
-                       '$itemspage_mobile_network'   => ['itemspage_mobile_network',  L10n::t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, L10n::t('Maximum of 100 items')],
-                       '$nosmile'      => ['nosmile', L10n::t("Don't show emoticons"), $nosmile, ''],
-                       '$calendar_title' => L10n::t('Calendar'),
-                       '$first_day_of_week'    => ['first_day_of_week', L10n::t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
-                       '$noinfo'       => ['noinfo', L10n::t("Don't show notices"), $noinfo, ''],
-                       '$infinite_scroll'      => ['infinite_scroll', L10n::t("Infinite scroll"), $infinite_scroll, ''],
-                       '$no_auto_update'       => ['no_auto_update', L10n::t("Automatic updates only at the top of the network page"), $no_auto_update, L10n::t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
-                       '$bandwidth_saver' => ['bandwidth_saver', L10n::t('Bandwidth Saver Mode'), $bandwidth_saver, L10n::t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
-                       '$no_smart_threading' => ['no_smart_threading', L10n::t('Disable Smart Threading'), $no_smart_threading, L10n::t('Disable the automatic suppression of extraneous thread indentation.')],
-
-                       '$d_tset' => L10n::t('General Theme Settings'),
-                       '$d_ctset' => L10n::t('Custom Theme Settings'),
-                       '$d_cset' => L10n::t('Content Settings'),
-                       'stitle' => L10n::t('Theme settings'),
+                       '$theme'        => ['theme', DI::l10n()->t('Display Theme:'), $theme_selected, '', $themes, true],
+                       '$mobile_theme' => ['mobile_theme', DI::l10n()->t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
+                       '$nowarn_insecure' => ['nowarn_insecure',  DI::l10n()->t('Suppress warning of insecure networks'), $nowarn_insecure, DI::l10n()->t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
+                       '$ajaxint'   => ['browser_update',  DI::l10n()->t("Update browser every xx seconds"), $browser_update, DI::l10n()->t('Minimum of 10 seconds. Enter -1 to disable it.')],
+                       '$itemspage_network'   => ['itemspage_network',  DI::l10n()->t("Number of items to display per page:"), $itemspage_network, DI::l10n()->t('Maximum of 100 items')],
+                       '$itemspage_mobile_network'   => ['itemspage_mobile_network',  DI::l10n()->t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, DI::l10n()->t('Maximum of 100 items')],
+                       '$nosmile'      => ['nosmile', DI::l10n()->t("Don't show emoticons"), $nosmile, ''],
+                       '$calendar_title' => DI::l10n()->t('Calendar'),
+                       '$first_day_of_week'    => ['first_day_of_week', DI::l10n()->t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
+                       '$noinfo'       => ['noinfo', DI::l10n()->t("Don't show notices"), $noinfo, ''],
+                       '$infinite_scroll'      => ['infinite_scroll', DI::l10n()->t("Infinite scroll"), $infinite_scroll, ''],
+                       '$no_auto_update'       => ['no_auto_update', DI::l10n()->t("Automatic updates only at the top of the network page"), $no_auto_update, DI::l10n()->t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
+                       '$bandwidth_saver' => ['bandwidth_saver', DI::l10n()->t('Bandwidth Saver Mode'), $bandwidth_saver, DI::l10n()->t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
+                       '$no_smart_threading' => ['no_smart_threading', DI::l10n()->t('Disable Smart Threading'), $no_smart_threading, DI::l10n()->t('Disable the automatic suppression of extraneous thread indentation.')],
+
+                       '$d_tset' => DI::l10n()->t('General Theme Settings'),
+                       '$d_ctset' => DI::l10n()->t('Custom Theme Settings'),
+                       '$d_cset' => DI::l10n()->t('Content Settings'),
+                       'stitle' => DI::l10n()->t('Theme settings'),
                        '$theme_config' => $theme_config,
                ]);
 
@@ -982,7 +982,7 @@ function settings_content(App $a)
 
        $profile = DBA::selectFirst('profile', [], ['is-default' => true, 'uid' => local_user()]);
        if (!DBA::isResult($profile)) {
-               notice(L10n::t('Unable to find your profile. Please contact your admin.') . EOL);
+               notice(DI::l10n()->t('Unable to find your profile. Please contact your admin.') . EOL);
                return;
        }
 
@@ -1021,49 +1021,49 @@ function settings_content(App $a)
        $pageset_tpl = Renderer::getMarkupTemplate('settings/pagetypes.tpl');
 
        $pagetype = Renderer::replaceMacros($pageset_tpl, [
-               '$account_types'        => L10n::t("Account Types"),
-               '$user'                 => L10n::t("Personal Page Subtypes"),
-               '$community'            => L10n::t("Community Forum Subtypes"),
+               '$account_types'        => DI::l10n()->t("Account Types"),
+               '$user'                 => DI::l10n()->t("Personal Page Subtypes"),
+               '$community'            => DI::l10n()->t("Community Forum Subtypes"),
                '$account_type'         => $a->user['account-type'],
                '$type_person'          => User::ACCOUNT_TYPE_PERSON,
                '$type_organisation'    => User::ACCOUNT_TYPE_ORGANISATION,
                '$type_news'            => User::ACCOUNT_TYPE_NEWS,
                '$type_community'       => User::ACCOUNT_TYPE_COMMUNITY,
 
-               '$account_person'       => ['account-type', L10n::t('Personal Page'), User::ACCOUNT_TYPE_PERSON,
-                                                                       L10n::t('Account for a personal profile.'),
+               '$account_person'       => ['account-type', DI::l10n()->t('Personal Page'), User::ACCOUNT_TYPE_PERSON,
+                                                                       DI::l10n()->t('Account for a personal profile.'),
                                                                        ($a->user['account-type'] == User::ACCOUNT_TYPE_PERSON)],
 
-               '$account_organisation' => ['account-type', L10n::t('Organisation Page'), User::ACCOUNT_TYPE_ORGANISATION,
-                                                                       L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
+               '$account_organisation' => ['account-type', DI::l10n()->t('Organisation Page'), User::ACCOUNT_TYPE_ORGANISATION,
+                                                                       DI::l10n()->t('Account for an organisation that automatically approves contact requests as "Followers".'),
                                                                        ($a->user['account-type'] == User::ACCOUNT_TYPE_ORGANISATION)],
 
-               '$account_news'         => ['account-type', L10n::t('News Page'), User::ACCOUNT_TYPE_NEWS,
-                                                                       L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
+               '$account_news'         => ['account-type', DI::l10n()->t('News Page'), User::ACCOUNT_TYPE_NEWS,
+                                                                       DI::l10n()->t('Account for a news reflector that automatically approves contact requests as "Followers".'),
                                                                        ($a->user['account-type'] == User::ACCOUNT_TYPE_NEWS)],
 
-               '$account_community'    => ['account-type', L10n::t('Community Forum'), User::ACCOUNT_TYPE_COMMUNITY,
-                                                                       L10n::t('Account for community discussions.'),
+               '$account_community'    => ['account-type', DI::l10n()->t('Community Forum'), User::ACCOUNT_TYPE_COMMUNITY,
+                                                                       DI::l10n()->t('Account for community discussions.'),
                                                                        ($a->user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)],
 
-               '$page_normal'          => ['page-flags', L10n::t('Normal Account Page'), User::PAGE_FLAGS_NORMAL,
-                                                                       L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
+               '$page_normal'          => ['page-flags', DI::l10n()->t('Normal Account Page'), User::PAGE_FLAGS_NORMAL,
+                                                                       DI::l10n()->t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
                                                                        ($a->user['page-flags'] == User::PAGE_FLAGS_NORMAL)],
 
-               '$page_soapbox'         => ['page-flags', L10n::t('Soapbox Page'), User::PAGE_FLAGS_SOAPBOX,
-                                                                       L10n::t('Account for a public profile that automatically approves contact requests as "Followers".'),
+               '$page_soapbox'         => ['page-flags', DI::l10n()->t('Soapbox Page'), User::PAGE_FLAGS_SOAPBOX,
+                                                                       DI::l10n()->t('Account for a public profile that automatically approves contact requests as "Followers".'),
                                                                        ($a->user['page-flags'] == User::PAGE_FLAGS_SOAPBOX)],
 
-               '$page_community'       => ['page-flags', L10n::t('Public Forum'), User::PAGE_FLAGS_COMMUNITY,
-                                                                       L10n::t('Automatically approves all contact requests.'),
+               '$page_community'       => ['page-flags', DI::l10n()->t('Public Forum'), User::PAGE_FLAGS_COMMUNITY,
+                                                                       DI::l10n()->t('Automatically approves all contact requests.'),
                                                                        ($a->user['page-flags'] == User::PAGE_FLAGS_COMMUNITY)],
 
-               '$page_freelove'        => ['page-flags', L10n::t('Automatic Friend Page'), User::PAGE_FLAGS_FREELOVE,
-                                                                       L10n::t('Account for a popular profile that automatically approves contact requests as "Friends".'),
+               '$page_freelove'        => ['page-flags', DI::l10n()->t('Automatic Friend Page'), User::PAGE_FLAGS_FREELOVE,
+                                                                       DI::l10n()->t('Account for a popular profile that automatically approves contact requests as "Friends".'),
                                                                        ($a->user['page-flags'] == User::PAGE_FLAGS_FREELOVE)],
 
-               '$page_prvgroup'        => ['page-flags', L10n::t('Private Forum [Experimental]'), User::PAGE_FLAGS_PRVGROUP,
-                                                                       L10n::t('Requires manual approval of contact requests.'),
+               '$page_prvgroup'        => ['page-flags', DI::l10n()->t('Private Forum [Experimental]'), User::PAGE_FLAGS_PRVGROUP,
+                                                                       DI::l10n()->t('Requires manual approval of contact requests.'),
                                                                        ($a->user['page-flags'] == User::PAGE_FLAGS_PRVGROUP)],
 
 
@@ -1074,7 +1074,7 @@ function settings_content(App $a)
        if ($noid) {
                $openid_field = false;
        } else {
-               $openid_field = ['openid_url', L10n::t('OpenID:'), $openid, L10n::t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "readonly", "url"];
+               $openid_field = ['openid_url', DI::l10n()->t('OpenID:'), $openid, DI::l10n()->t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "readonly", "url"];
        }
 
        $opt_tpl = Renderer::getMarkupTemplate("field_yesno.tpl");
@@ -1082,64 +1082,64 @@ function settings_content(App $a)
                $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
        } else {
                $profile_in_dir = Renderer::replaceMacros($opt_tpl, [
-                       '$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', DI::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]]
+                       '$field' => ['profile_in_directory', DI::l10n()->t('Publish your default profile in your local site directory?'), $profile['publish'], DI::l10n()->t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', DI::baseUrl().'/directory'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]]
                ]);
        }
 
        if (strlen(Config::get('system', 'directory'))) {
                $profile_in_net_dir = Renderer::replaceMacros($opt_tpl, [
-                       '$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], L10n::t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', Config::get('system', 'directory'), Config::get('system', 'directory'))     . " " . L10n::t("This setting also determines whether Friendica will inform search engines that your profile should be indexed or not. Third-party search engines may or may not respect this setting."), [L10n::t('No'), L10n::t('Yes')]]
+                       '$field' => ['profile_in_netdirectory', DI::l10n()->t('Publish your default profile in the global social directory?'), $profile['net-publish'], DI::l10n()->t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', Config::get('system', 'directory'), Config::get('system', 'directory')) . " " . DI::l10n()->t("This setting also determines whether Friendica will inform search engines that your profile should be indexed or not. Third-party search engines may or may not respect this setting."), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]]
                ]);
        } else {
                $profile_in_net_dir = '';
        }
 
        $hide_friends = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['hide-friends', L10n::t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], L10n::t('Your contact list won\'t be shown in your default profile page. You can decide to show your contact list separately for each additional profile you create'), [L10n::t('No'), L10n::t('Yes')]],
+               '$field' => ['hide-friends', DI::l10n()->t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], DI::l10n()->t('Your contact list won\'t be shown in your default profile page. You can decide to show your contact list separately for each additional profile you create'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ]);
 
        $hide_wall = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['hidewall', L10n::t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], L10n::t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.'), [L10n::t('No'), L10n::t('Yes')]],
+               '$field' => ['hidewall', DI::l10n()->t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], DI::l10n()->t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ]);
 
        $blockwall = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['blockwall', L10n::t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), L10n::t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts'), [L10n::t('No'), L10n::t('Yes')]],
+               '$field' => ['blockwall', DI::l10n()->t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), DI::l10n()->t('Your contacts may write posts on your profile wall. These posts will be distributed to your contacts'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ]);
 
        $blocktags = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['blocktags', L10n::t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), L10n::t('Your contacts can add additional tags to your posts.'), [L10n::t('No'), L10n::t('Yes')]],
+               '$field' => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ]);
 
        $suggestme = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['suggestme', L10n::t('Allow us to suggest you as a potential friend to new members?'), $suggestme, L10n::t('If you like, Friendica may suggest new members to add you as a contact.'), [L10n::t('No'), L10n::t('Yes')]],
+               '$field' => ['suggestme', DI::l10n()->t('Allow us to suggest you as a potential friend to new members?'), $suggestme, DI::l10n()->t('If you like, Friendica may suggest new members to add you as a contact.'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ]);
 
        $unkmail = Renderer::replaceMacros($opt_tpl, [
-               '$field' => ['unkmail', L10n::t('Permit unknown people to send you private mail?'), $unkmail, L10n::t('Friendica network users may send you private messages even if they are not in your contact list.'), [L10n::t('No'), L10n::t('Yes')]],
+               '$field' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.'), [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ]);
 
        if (!$profile['publish'] && !$profile['net-publish']) {
-               info(L10n::t('Profile is <strong>not published</strong>.') . EOL);
+               info(DI::l10n()->t('Profile is <strong>not published</strong>.') . EOL);
        }
 
        $tpl_addr = Renderer::getMarkupTemplate('settings/nick_set.tpl');
 
        $prof_addr = Renderer::replaceMacros($tpl_addr,[
-               '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHostname() . DI::baseUrl()->getUrlPath(), DI::baseUrl() . '/profile/' . $nickname),
+               '$desc' => DI::l10n()->t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHostname() . DI::baseUrl()->getUrlPath(), DI::baseUrl() . '/profile/' . $nickname),
                '$basepath' => DI::baseUrl()->getHostname()
        ]);
 
        $stpl = Renderer::getMarkupTemplate('settings/settings.tpl');
 
        $expire_arr = [
-               'days' => ['expire',  L10n::t("Automatically expire posts after this many days:"), $expire, L10n::t('If empty, posts will not expire. Expired posts will be deleted')],
-               'advanced' => L10n::t('Advanced expiration settings'),
-               'label' => L10n::t('Advanced Expiration'),
-               'items' => ['expire_items',  L10n::t("Expire posts:"), $expire_items, '', [L10n::t('No'), L10n::t('Yes')]],
-               'notes' => ['expire_notes',  L10n::t("Expire personal notes:"), $expire_notes, '', [L10n::t('No'), L10n::t('Yes')]],
-               'starred' => ['expire_starred',  L10n::t("Expire starred posts:"), $expire_starred, '', [L10n::t('No'), L10n::t('Yes')]],
-               'photos' => ['expire_photos',  L10n::t("Expire photos:"), $expire_photos, '', [L10n::t('No'), L10n::t('Yes')]],
-               'network_only' => ['expire_network_only',  L10n::t("Only expire posts by others:"), $expire_network_only, '', [L10n::t('No'), L10n::t('Yes')]],
+               'days' => ['expire',  DI::l10n()->t("Automatically expire posts after this many days:"), $expire, DI::l10n()->t('If empty, posts will not expire. Expired posts will be deleted')],
+               'advanced' => DI::l10n()->t('Advanced expiration settings'),
+               'label' => DI::l10n()->t('Advanced Expiration'),
+               'items' => ['expire_items',  DI::l10n()->t("Expire posts:"), $expire_items, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
+               'notes' => ['expire_notes',  DI::l10n()->t("Expire personal notes:"), $expire_notes, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
+               'starred' => ['expire_starred',  DI::l10n()->t("Expire starred posts:"), $expire_starred, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
+               'photos' => ['expire_photos',  DI::l10n()->t("Expire photos:"), $expire_photos, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
+               'network_only' => ['expire_network_only',  DI::l10n()->t("Only expire posts by others:"), $expire_network_only, '', [DI::l10n()->t('No'), DI::l10n()->t('Yes')]],
        ];
 
        $group_select = Group::displayGroupSelection(local_user(), $a->user['def_gid']);
@@ -1169,52 +1169,52 @@ function settings_content(App $a)
 
        /// @TODO Fix indending (or so)
        $o .= Renderer::replaceMacros($stpl, [
-               '$ptitle'       => L10n::t('Account Settings'),
+               '$ptitle'       => DI::l10n()->t('Account Settings'),
 
-               '$submit'       => L10n::t('Save Settings'),
+               '$submit'       => DI::l10n()->t('Save Settings'),
                '$baseurl' => DI::baseUrl()->get(true),
                '$uid' => local_user(),
                '$form_security_token' => BaseModule::getFormSecurityToken("settings"),
                '$nickname_block' => $prof_addr,
 
-               '$h_pass'       => L10n::t('Password Settings'),
-               '$password1'=> ['password', L10n::t('New Password:'), '', L10n::t('Allowed characters are a-z, A-Z, 0-9 and special characters except white spaces, accentuated letters and colon (:).')],
-               '$password2'=> ['confirm', L10n::t('Confirm:'), '', L10n::t('Leave password fields blank unless changing')],
-               '$password3'=> ['opassword', L10n::t('Current Password:'), '', L10n::t('Your current password to confirm the changes')],
-               '$password4'=> ['mpassword', L10n::t('Password:'), '', L10n::t('Your current password to confirm the changes')],
+               '$h_pass'       => DI::l10n()->t('Password Settings'),
+               '$password1'=> ['password', DI::l10n()->t('New Password:'), '', DI::l10n()->t('Allowed characters are a-z, A-Z, 0-9 and special characters except white spaces, accentuated letters and colon (:).')],
+               '$password2'=> ['confirm', DI::l10n()->t('Confirm:'), '', DI::l10n()->t('Leave password fields blank unless changing')],
+               '$password3'=> ['opassword', DI::l10n()->t('Current Password:'), '', DI::l10n()->t('Your current password to confirm the changes')],
+               '$password4'=> ['mpassword', DI::l10n()->t('Password:'), '', DI::l10n()->t('Your current password to confirm the changes')],
                '$oid_enable' => (!Config::get('system', 'no_openid')),
                '$openid'       => $openid_field,
-               '$delete_openid' => ['delete_openid', L10n::t('Delete OpenID URL'), false, ''],
+               '$delete_openid' => ['delete_openid', DI::l10n()->t('Delete OpenID URL'), false, ''],
 
-               '$h_basic'      => L10n::t('Basic Settings'),
-               '$username' => ['username',  L10n::t('Full Name:'), $username, ''],
-               '$email'        => ['email', L10n::t('Email Address:'), $email, '', '', '', 'email'],
-               '$timezone' => ['timezone_select' , L10n::t('Your Timezone:'), Temporal::getTimezoneSelect($timezone), ''],
-               '$language' => ['language', L10n::t('Your Language:'), $language, L10n::t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
-               '$defloc'       => ['defloc', L10n::t('Default Post Location:'), $defloc, ''],
-               '$allowloc' => ['allow_location', L10n::t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
+               '$h_basic'      => DI::l10n()->t('Basic Settings'),
+               '$username' => ['username',  DI::l10n()->t('Full Name:'), $username, ''],
+               '$email'        => ['email', DI::l10n()->t('Email Address:'), $email, '', '', '', 'email'],
+               '$timezone' => ['timezone_select' , DI::l10n()->t('Your Timezone:'), Temporal::getTimezoneSelect($timezone), ''],
+               '$language' => ['language', DI::l10n()->t('Your Language:'), $language, DI::l10n()->t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
+               '$defloc'       => ['defloc', DI::l10n()->t('Default Post Location:'), $defloc, ''],
+               '$allowloc' => ['allow_location', DI::l10n()->t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
 
 
-               '$h_prv'        => L10n::t('Security and Privacy Settings'),
+               '$h_prv'        => DI::l10n()->t('Security and Privacy Settings'),
 
-               '$maxreq'       => ['maxreq', L10n::t('Maximum Friend Requests/Day:'), $maxreq , L10n::t("\x28to prevent spam abuse\x29")],
-               '$permissions' => L10n::t('Default Post Permissions'),
-               '$permdesc' => L10n::t("\x28click to open/close\x29"),
+               '$maxreq'       => ['maxreq', DI::l10n()->t('Maximum Friend Requests/Day:'), $maxreq , DI::l10n()->t("\x28to prevent spam abuse\x29")],
+               '$permissions' => DI::l10n()->t('Default Post Permissions'),
+               '$permdesc' => DI::l10n()->t("\x28click to open/close\x29"),
                '$visibility' => $profile['net-publish'],
                '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user),
                '$suggestme' => $suggestme,
-               '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''),
-               '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''),
+               '$blockwall'=> $blockwall, // array('blockwall', DI::l10n()->t('Allow friends to post to your profile page:'), !$blockwall, ''),
+               '$blocktags'=> $blocktags, // array('blocktags', DI::l10n()->t('Allow friends to tag your posts:'), !$blocktags, ''),
 
                // ACL permissions box
-               '$group_perms' => L10n::t('Show to Groups'),
-               '$contact_perms' => L10n::t('Show to Contacts'),
-               '$private' => L10n::t('Default Private Post'),
-               '$public' => L10n::t('Default Public Post'),
+               '$group_perms' => DI::l10n()->t('Show to Groups'),
+               '$contact_perms' => DI::l10n()->t('Show to Contacts'),
+               '$private' => DI::l10n()->t('Default Private Post'),
+               '$public' => DI::l10n()->t('Default Public Post'),
                '$is_private' => $private_post,
                '$return_path' => $query_str,
                '$public_link' => $public_post_link,
-               '$settings_perms' => L10n::t('Default Permissions for New Posts'),
+               '$settings_perms' => DI::l10n()->t('Default Permissions for New Posts'),
 
                '$group_select' => $group_select,
 
@@ -1226,41 +1226,41 @@ function settings_content(App $a)
                '$hide_friends' => $hide_friends,
                '$hide_wall' => $hide_wall,
                '$unkmail' => $unkmail,
-               '$cntunkmail'   => ['cntunkmail', L10n::t('Maximum private messages per day from unknown people:'), $cntunkmail , L10n::t("\x28to prevent spam abuse\x29")],
+               '$cntunkmail'   => ['cntunkmail', DI::l10n()->t('Maximum private messages per day from unknown people:'), $cntunkmail , DI::l10n()->t("\x28to prevent spam abuse\x29")],
 
 
-               '$h_not'        => L10n::t('Notification Settings'),
-               '$lbl_not'      => L10n::t('Send a notification email when:'),
-               '$notify1'      => ['notify1', L10n::t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
-               '$notify2'      => ['notify2', L10n::t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
-               '$notify3'      => ['notify3', L10n::t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
-               '$notify4'      => ['notify4', L10n::t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
-               '$notify5'      => ['notify5', L10n::t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
-               '$notify6'  => ['notify6', L10n::t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
-               '$notify7'  => ['notify7', L10n::t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
-               '$notify8'  => ['notify8', L10n::t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
+               '$h_not'        => DI::l10n()->t('Notification Settings'),
+               '$lbl_not'      => DI::l10n()->t('Send a notification email when:'),
+               '$notify1'      => ['notify1', DI::l10n()->t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
+               '$notify2'      => ['notify2', DI::l10n()->t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
+               '$notify3'      => ['notify3', DI::l10n()->t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
+               '$notify4'      => ['notify4', DI::l10n()->t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
+               '$notify5'      => ['notify5', DI::l10n()->t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
+               '$notify6'  => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
+               '$notify7'  => ['notify7', DI::l10n()->t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
+               '$notify8'  => ['notify8', DI::l10n()->t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
 
-               '$desktop_notifications' => ['desktop_notifications', L10n::t('Activate desktop notifications') , false, L10n::t('Show desktop popup on new notifications')],
+               '$desktop_notifications' => ['desktop_notifications', DI::l10n()->t('Activate desktop notifications') , false, DI::l10n()->t('Show desktop popup on new notifications')],
 
-               '$email_textonly' => ['email_textonly', L10n::t('Text-only notification emails'),
+               '$email_textonly' => ['email_textonly', DI::l10n()->t('Text-only notification emails'),
                                                                        DI::pConfig()->get(local_user(), 'system', 'email_textonly'),
-                                                                       L10n::t('Send text only notification emails, without the html part')],
+                                                                       DI::l10n()->t('Send text only notification emails, without the html part')],
 
-               '$detailed_notif' => ['detailed_notif', L10n::t('Show detailled notifications'),
+               '$detailed_notif' => ['detailed_notif', DI::l10n()->t('Show detailled notifications'),
                                                                        DI::pConfig()->get(local_user(), 'system', 'detailed_notif'),
-                                                                       L10n::t('Per default, notifications are condensed to a single notification per item. When enabled every notification is displayed.')],
+                                                                       DI::l10n()->t('Per default, notifications are condensed to a single notification per item. When enabled every notification is displayed.')],
 
-               '$h_advn' => L10n::t('Advanced Account/Page Type Settings'),
-               '$h_descadvn' => L10n::t('Change the behaviour of this account for special situations'),
+               '$h_advn' => DI::l10n()->t('Advanced Account/Page Type Settings'),
+               '$h_descadvn' => DI::l10n()->t('Change the behaviour of this account for special situations'),
                '$pagetype' => $pagetype,
 
-               '$importcontact' => L10n::t('Import Contacts'),
-               '$importcontact_text' => L10n::t('Upload a CSV file that contains the handle of your followed accounts in the first column you exported from the old account.'),
-               '$importcontact_button' => L10n::t('Upload File'),
+               '$importcontact' => DI::l10n()->t('Import Contacts'),
+               '$importcontact_text' => DI::l10n()->t('Upload a CSV file that contains the handle of your followed accounts in the first column you exported from the old account.'),
+               '$importcontact_button' => DI::l10n()->t('Upload File'),
                '$importcontact_maxsize' => Config::get('system', 'max_csv_file_size', 30720), 
-               '$relocate' => L10n::t('Relocate'),
-               '$relocate_text' => L10n::t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
-               '$relocate_button' => L10n::t("Resend relocate message to contacts"),
+               '$relocate' => DI::l10n()->t('Relocate'),
+               '$relocate_text' => DI::l10n()->t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
+               '$relocate_button' => DI::l10n()->t("Resend relocate message to contacts"),
 
        ]);
 
index 02d5cdcce53efb82bda3ee7556ddd826b6197499..5068437346a380f85343767a374582446da39266 100644 (file)
@@ -89,7 +89,7 @@ function subthread_content(App $a) {
 
        $uri = Item::newURI($owner_uid);
 
-       $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
+       $post_type = (($item['resource-id']) ? DI::l10n()->t('photo') : DI::l10n()->t('status'));
        $objtype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
        $link = XML::escape('<link rel="alternate" type="text/html" href="' . DI::baseUrl() . '/display/' . $item['guid'] . '" />' . "\n");
        $body = $item['body'];
@@ -105,7 +105,7 @@ function subthread_content(App $a) {
                <content>$body</content>
        </object>
 EOT;
-       $bodyverb = L10n::t('%1$s is following %2$s\'s %3$s');
+       $bodyverb = DI::l10n()->t('%1$s is following %2$s\'s %3$s');
 
        if (!isset($bodyverb)) {
                return;
index 31f02fa4ce6640e04550a94d61237fe0a248359d..ec8c9ce780c1ac082e633f46434ca84957e74b7d 100644 (file)
@@ -25,7 +25,7 @@ function suggest_post(App $a)
 {
        if (!empty($_POST['ignore']) && !empty($_POST['confirm'])) {
                DBA::insert('gcign', ['uid' => local_user(), 'gcid' => $_POST['ignore']]);
-               notice(L10n::t('Contact suggestion successfully ignored.'));
+               notice(DI::l10n()->t('Contact suggestion successfully ignored.'));
        }
 
        DI::baseUrl()->redirect('suggest');
@@ -36,7 +36,7 @@ function suggest_content(App $a)
        $o = '';
 
        if (! local_user()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -49,7 +49,7 @@ function suggest_content(App $a)
        $r = GContact::suggestionQuery(local_user());
 
        if (! DBA::isResult($r)) {
-               $o .= L10n::t('No suggestions available. If this is a new site, please try again in 24 hours.');
+               $o .= DI::l10n()->t('No suggestions available. If this is a new site, please try again in 24 hours.');
                return $o;
        }
 
@@ -68,12 +68,12 @@ function suggest_content(App $a)
 
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                        '$method' => 'post',
-                       '$message' => L10n::t('Do you really want to delete this suggestion?'),
+                       '$message' => DI::l10n()->t('Do you really want to delete this suggestion?'),
                        '$extra_inputs' => $inputs,
-                       '$confirm' => L10n::t('Yes'),
+                       '$confirm' => DI::l10n()->t('Yes'),
                        '$confirm_url' => $query['base'],
                        '$confirm_name' => 'confirm',
-                       '$cancel' => L10n::t('Cancel'),
+                       '$cancel' => DI::l10n()->t('Cancel'),
                ]);
        }
 
@@ -84,9 +84,9 @@ function suggest_content(App $a)
                $connlnk = DI::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
                $ignlnk = DI::baseUrl() . '/suggest?ignore=' . $rr['id'];
                $photo_menu = [
-                       'profile' => [L10n::t("View Profile"), Contact::magicLink($rr["url"])],
-                       'follow' => [L10n::t("Connect/Follow"), $connlnk],
-                       'hide' => [L10n::t('Ignore/Hide'), $ignlnk]
+                       'profile' => [DI::l10n()->t("View Profile"), Contact::magicLink($rr["url"])],
+                       'follow' => [DI::l10n()->t("Connect/Follow"), $connlnk],
+                       'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk]
                ];
 
                $contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
@@ -103,10 +103,10 @@ function suggest_content(App $a)
                        'account_type'  => Contact::getAccountType($contact_details),
                        'ignlnk' => $ignlnk,
                        'ignid' => $rr['id'],
-                       'conntxt' => L10n::t('Connect'),
+                       'conntxt' => DI::l10n()->t('Connect'),
                        'connlnk' => $connlnk,
                        'photo_menu' => $photo_menu,
-                       'ignore' => L10n::t('Ignore/Hide'),
+                       'ignore' => DI::l10n()->t('Ignore/Hide'),
                        'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
                        'id' => ++$id,
                ];
@@ -116,7 +116,7 @@ function suggest_content(App $a)
        $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
 
        $o .= Renderer::replaceMacros($tpl,[
-               '$title' => L10n::t('Friend Suggestions'),
+               '$title' => DI::l10n()->t('Friend Suggestions'),
                '$contacts' => $entries,
        ]);
 
index a366976bd90f67e4c3cf6d4cd24e8be62370adc9..38a13df9c5b2241c863d283ea440a2fbb2f1fd6d 100644 (file)
@@ -70,7 +70,7 @@ function tagger_content(App $a) {
 
        $uri = Item::newURI($owner_uid);
        $xterm = XML::escape($term);
-       $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
+       $post_type = (($item['resource-id']) ? DI::l10n()->t('photo') : DI::l10n()->t('status'));
        $targettype = (($item['resource-id']) ? Activity\ObjectType::IMAGE : Activity\ObjectType::NOTE );
        $href = DI::baseUrl() . '/display/' . $item['guid'];
 
@@ -103,7 +103,7 @@ EOT;
        </object>
 EOT;
 
-       $bodyverb = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s');
+       $bodyverb = DI::l10n()->t('%1$s tagged %2$s\'s %3$s with %4$s');
 
        if (!isset($bodyverb)) {
                return;
index 267ee718cc04280ab01a5e163dbf8ba42c7cdeab..ebb9c50932f449ff1c1f820e2ce0e49fc4a4fbbc 100644 (file)
@@ -18,7 +18,7 @@ function tagrm_post(App $a)
                DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
-       if (!empty($_POST['submit']) && ($_POST['submit'] === L10n::t('Cancel'))) {
+       if (!empty($_POST['submit']) && ($_POST['submit'] === DI::l10n()->t('Cancel'))) {
                DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
@@ -29,7 +29,7 @@ function tagrm_post(App $a)
 
        $item_id = $_POST['item'] ?? 0;
        update_tags($item_id, $tags);
-       info(L10n::t('Tag(s) removed') . EOL);
+       info(DI::l10n()->t('Tag(s) removed') . EOL);
 
        DI::baseUrl()->redirect($_SESSION['photo_return']);
        // NOTREACHED
@@ -99,9 +99,9 @@ function tagrm_content(App $a)
                DI::baseUrl()->redirect($_SESSION['photo_return']);
        }
 
-       $o .= '<h3>' . L10n::t('Remove Item Tag') . '</h3>';
+       $o .= '<h3>' . DI::l10n()->t('Remove Item Tag') . '</h3>';
 
-       $o .= '<p id="tag-remove-desc">' . L10n::t('Select a tag to remove: ') . '</p>';
+       $o .= '<p id="tag-remove-desc">' . DI::l10n()->t('Select a tag to remove: ') . '</p>';
 
        $o .= '<form id="tagrm" action="tagrm" method="post" >';
        $o .= '<input type="hidden" name="item" value="' . $item_id . '" />';
@@ -112,8 +112,8 @@ function tagrm_content(App $a)
        }
 
        $o .= '</ul>';
-       $o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . L10n::t('Remove') .'" />';
-       $o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . L10n::t('Cancel') .'" />';
+       $o .= '<input id="tagrm-submit" type="submit" name="submit" value="' . DI::l10n()->t('Remove') .'" />';
+       $o .= '<input id="tagrm-cancel" type="submit" name="submit" value="' . DI::l10n()->t('Cancel') .'" />';
        $o .= '</form>';
 
        return $o;
index 66201161ab53aae52289b214db15c66f159a94e9..7bc2702ddeabad11d351b249efa085d80caf4d1a 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Core\Renderer;
 function uimport_post(App $a)
 {
        if ((Config::get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -27,7 +27,7 @@ function uimport_post(App $a)
 function uimport_content(App $a)
 {
        if ((Config::get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !is_site_admin()) {
-               notice(L10n::t('User imports on closed servers can only be done by an administrator.') . EOL);
+               notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.') . EOL);
                return;
        }
 
@@ -36,20 +36,20 @@ function uimport_content(App $a)
                $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
                if ($r && $r[0]['total'] >= $max_dailies) {
                        Logger::log('max daily registrations exceeded.');
-                       notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
+                       notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
                        return;
                }
        }
 
        $tpl = Renderer::getMarkupTemplate("uimport.tpl");
        return Renderer::replaceMacros($tpl, [
-               '$regbutt' => L10n::t('Import'),
+               '$regbutt' => DI::l10n()->t('Import'),
                '$import' => [
-                       'title' => L10n::t("Move account"),
-                       'intro' => L10n::t("You can import an account from another Friendica server."),
-                       'instruct' => L10n::t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
-                       'warn' => L10n::t("This feature is experimental. We can't import contacts from the OStatus network \x28GNU Social/Statusnet\x29 or from Diaspora"),
-                       'field' => ['accountfile', L10n::t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', L10n::t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
+                       'title' => DI::l10n()->t("Move account"),
+                       'intro' => DI::l10n()->t("You can import an account from another Friendica server."),
+                       'instruct' => DI::l10n()->t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
+                       'warn' => DI::l10n()->t("This feature is experimental. We can't import contacts from the OStatus network \x28GNU Social/Statusnet\x29 or from Diaspora"),
+                       'field' => ['accountfile', DI::l10n()->t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', DI::l10n()->t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
                ],
        ]);
 }
index 280ca164e6b7c3efb62dca042804fea50f1eb6c6..96dc06ab016ce48406068a081cec0c1c2b2cedb4 100644 (file)
@@ -19,7 +19,7 @@ function unfollow_post(App $a)
        $base_return_path = 'contact';
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.'));
+               notice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect('login');
                // NOTREACHED
        }
@@ -33,7 +33,7 @@ function unfollow_post(App $a)
        $contact = DBA::selectFirst('contact', [], $condition);
 
        if (!DBA::isResult($contact)) {
-               notice(L10n::t("You aren't following this contact."));
+               notice(DI::l10n()->t("You aren't following this contact."));
                DI::baseUrl()->redirect($base_return_path);
                // NOTREACHED
        }
@@ -43,7 +43,7 @@ function unfollow_post(App $a)
        }
 
        if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
-               notice(L10n::t('Unfollowing is currently not supported by your network.'));
+               notice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
                DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
                // NOTREACHED
        }
@@ -64,7 +64,7 @@ function unfollow_post(App $a)
                $return_path = $base_return_path . '/' . $contact['id'];
        }
 
-       info(L10n::t('Contact unfollowed'));
+       info(DI::l10n()->t('Contact unfollowed'));
        DI::baseUrl()->redirect($return_path);
        // NOTREACHED
 }
@@ -74,7 +74,7 @@ function unfollow_content(App $a)
        $base_return_path = 'contact';
 
        if (!local_user()) {
-               notice(L10n::t('Permission denied.'));
+               notice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect('login');
                // NOTREACHED
        }
@@ -89,13 +89,13 @@ function unfollow_content(App $a)
        $contact = DBA::selectFirst('contact', ['url', 'network', 'addr', 'name'], $condition);
 
        if (!DBA::isResult($contact)) {
-               notice(L10n::t("You aren't following this contact."));
+               notice(DI::l10n()->t("You aren't following this contact."));
                DI::baseUrl()->redirect($base_return_path);
                // NOTREACHED
        }
 
        if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
-               notice(L10n::t('Unfollowing is currently not supported by your network.'));
+               notice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
                DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
                // NOTREACHED
        }
@@ -106,7 +106,7 @@ function unfollow_content(App $a)
        $self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
 
        if (!DBA::isResult($self)) {
-               notice(L10n::t('Permission denied.'));
+               notice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($base_return_path);
                // NOTREACHED
        }
@@ -115,7 +115,7 @@ function unfollow_content(App $a)
        $_SESSION['fastlane'] = $contact['url'];
 
        $o = Renderer::replaceMacros($tpl, [
-               '$header'        => L10n::t('Disconnect/Unfollow'),
+               '$header'        => DI::l10n()->t('Disconnect/Unfollow'),
                '$desc'          => '',
                '$pls_answer'    => '',
                '$does_know_you' => '',
@@ -125,16 +125,16 @@ function unfollow_content(App $a)
                '$statusnet'     => '',
                '$diaspora'      => '',
                '$diasnote'      => '',
-               '$your_address'  => L10n::t('Your Identity Address:'),
+               '$your_address'  => DI::l10n()->t('Your Identity Address:'),
                '$invite_desc'   => '',
                '$emailnet'      => '',
-               '$submit'        => L10n::t('Submit Request'),
-               '$cancel'        => L10n::t('Cancel'),
+               '$submit'        => DI::l10n()->t('Submit Request'),
+               '$cancel'        => DI::l10n()->t('Cancel'),
                '$nickname'      => '',
                '$name'          => $contact['name'],
                '$url'           => $contact['url'],
                '$zrl'           => Contact::magicLink($contact['url']),
-               '$url_label'     => L10n::t('Profile URL'),
+               '$url_label'     => DI::l10n()->t('Profile URL'),
                '$myaddr'        => $self['url'],
                '$request'       => $request,
                '$keywords'      => '',
@@ -144,7 +144,7 @@ function unfollow_content(App $a)
        DI::page()['aside'] = '';
        Profile::load($a, '', 0, Contact::getDetailsByURL($contact['url']));
 
-       $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => L10n::t('Status Messages and Posts')]);
+       $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), ['$title' => DI::l10n()->t('Status Messages and Posts')]);
 
        // Show last public posts
        $o .= Contact::getPostsFromUrl($contact['url']);
index 2f23bb7deb97f7374d438611393bdbb64f96db4e..4f1cd263b8e769bf69ba62125f99891d24397d89 100644 (file)
@@ -20,7 +20,7 @@ function update_community_content(App $a) {
        }
 
        if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
-               $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
+               $replace = "<br />".DI::l10n()->t("[Embedded content - reload page to view]")."<br />";
                $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
                $text = preg_replace($pattern, $replace, $text);
                $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
index 5092dd835cb96ff3f1bd3b455f2ba622a017f33e..a347873da9ee713e9f76853e2ef9c25f4c965cbc 100644 (file)
@@ -20,7 +20,7 @@ function update_contact_content(App $a)
        }
 
        if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
-               $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
+               $replace = "<br />".DI::l10n()->t("[Embedded content - reload page to view]")."<br />";
                $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
                $text = preg_replace($pattern, $replace, $text);
                $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
index 569c76ab31f0433a43645cec12c73ccb2e079a92..9d725fed2676376233d41bd4cdad5cd6b28fb3d0 100644 (file)
@@ -21,7 +21,7 @@ function update_display_content(App $a)
        $text = display_content($a, true, $profile_uid);
 
        if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
-               $replace = "<br />" . L10n::t("[Embedded content - reload page to view]") . "<br />";
+               $replace = "<br />" . DI::l10n()->t("[Embedded content - reload page to view]") . "<br />";
                $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
                $text = preg_replace($pattern, $replace, $text);
                $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
index 2ae9ccb787084ea5ffdad2701fe3ab637100ae30..212b6a6b1ae746ef19ceb8841178e2033f97efc5 100644 (file)
@@ -30,7 +30,7 @@ function update_network_content(App $a)
        }
 
        if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
-               $replace = "<br />" . L10n::t("[Embedded content - reload page to view]") . "<br />";
+               $replace = "<br />" . DI::l10n()->t("[Embedded content - reload page to view]") . "<br />";
                $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
                $text = preg_replace($pattern, $replace, $text);
                $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
index 989af976a298e97d8a46ca72e2a4d2923b3e6252..4027d4a33d9087cd96135c644b54f81f18b8ea76 100644 (file)
@@ -33,7 +33,7 @@ function update_notes_content(App $a) {
        $text = notes_content($a, $profile_uid);
 
        if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
-               $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
+               $replace = "<br />".DI::l10n()->t("[Embedded content - reload page to view]")."<br />";
                $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
                $text = preg_replace($pattern, $replace, $text);
                $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
index 38802866d90bd46d63c5173d79320a9a8ceef5e4..8d94d34a1b68eecb26c11f66d50acff36b4d9ca7 100644 (file)
@@ -31,7 +31,7 @@ function update_profile_content(App $a) {
        $text = Profile::content([], $profile_uid);
 
        if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
-               $replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
+               $replace = "<br />".DI::l10n()->t("[Embedded content - reload page to view]")."<br />";
                $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
                $text = preg_replace($pattern, $replace, $text);
                $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
index ad3a27b00362c4180161c0793b7365dd0ce478c3..368eec3c9a5729e23f92a389cc1fc7264dd349e9 100644 (file)
@@ -110,12 +110,12 @@ function videos_content(App $a)
 
 
        if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
-               notice(L10n::t('Public access denied.') . EOL);
+               notice(DI::l10n()->t('Public access denied.') . EOL);
                return;
        }
 
        if (empty($a->data['user'])) {
-               notice(L10n::t('No videos selected') . EOL );
+               notice(DI::l10n()->t('No videos selected') . EOL );
                return;
        }
 
@@ -163,7 +163,7 @@ function videos_content(App $a)
        }
 
        if ($a->data['user']['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
-               notice(L10n::t('Access to this item is restricted.') . EOL);
+               notice(DI::l10n()->t('Access to this item is restricted.') . EOL);
                return;
        }
 
@@ -233,14 +233,14 @@ function videos_content(App $a)
                        $videos[] = [
                                'id'       => $rr['id'],
                                'link'     => DI::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['hash'],
-                               'title'    => L10n::t('View Video'),
+                               'title'    => DI::l10n()->t('View Video'),
                                'src'      => DI::baseUrl() . '/attach/' . $rr['id'] . '?attachment=0',
                                'alt'      => $alt_e,
                                'mime'     => $rr['filetype'],
                                'album' => [
                                        'link'  => DI::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
                                        'name'  => $name_e,
-                                       'alt'   => L10n::t('View Album'),
+                                       'alt'   => DI::l10n()->t('View Album'),
                                ],
                        ];
                }
@@ -248,9 +248,9 @@ function videos_content(App $a)
 
        $tpl = Renderer::getMarkupTemplate('videos_recent.tpl');
        $o .= Renderer::replaceMacros($tpl, [
-               '$title'      => L10n::t('Recent Videos'),
+               '$title'      => DI::l10n()->t('Recent Videos'),
                '$can_post'   => $can_post,
-               '$upload'     => [L10n::t('Upload New Videos'), DI::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/upload'],
+               '$upload'     => [DI::l10n()->t('Upload New Videos'), DI::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/upload'],
                '$videos'     => $videos,
                '$delete_url' => (($can_post) ? DI::baseUrl() . '/videos/' . $a->data['user']['nickname'] : false)
        ]);
index 0324a5581ca9a674d48ac08381edd6289e392964..a8f704cd995f780d584121a34758ad13f83e6acc 100644 (file)
@@ -24,14 +24,14 @@ function wall_attach_post(App $a) {
 
                if (! DBA::isResult($r)) {
                        if ($r_json) {
-                               echo json_encode(['error' => L10n::t('Invalid request.')]);
+                               echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                                exit();
                        }
                        return;
                }
        } else {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Invalid request.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                        exit();
                }
 
@@ -60,16 +60,16 @@ function wall_attach_post(App $a) {
 
        if (!$can_post) {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Permission denied.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Permission denied.')]);
                        exit();
                }
-               notice(L10n::t('Permission denied.') . EOL );
+               notice(DI::l10n()->t('Permission denied.') . EOL );
                exit();
        }
 
        if (empty($_FILES['userfile'])) {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Invalid request.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                }
                exit();
        }
@@ -87,7 +87,7 @@ function wall_attach_post(App $a) {
         */
 
        if ($filesize <= 0) {
-               $msg = L10n::t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(L10n::t('Or - did you try to upload an empty file?'));
+               $msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(DI::l10n()->t('Or - did you try to upload an empty file?'));
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
@@ -98,7 +98,7 @@ function wall_attach_post(App $a) {
        }
 
        if ($maxfilesize && $filesize > $maxfilesize) {
-               $msg = L10n::t('File exceeds size limit of %s', Strings::formatBytes($maxfilesize));
+               $msg = DI::l10n()->t('File exceeds size limit of %s', Strings::formatBytes($maxfilesize));
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
@@ -113,7 +113,7 @@ function wall_attach_post(App $a) {
        @unlink($src);
 
        if ($newid === false) {
-               $msg =  L10n::t('File upload failed.');
+               $msg =  DI::l10n()->t('File upload failed.');
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
index 5c5fd7f18204da4bb58fc9ae50b263a7f7a18947..814a32fd468c52d208125b2ab7b40c075737cd33 100644 (file)
@@ -40,7 +40,7 @@ function wall_upload_post(App $a, $desktopmode = true)
 
                        if (!DBA::isResult($r)) {
                                if ($r_json) {
-                                       echo json_encode(['error' => L10n::t('Invalid request.')]);
+                                       echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                                        exit();
                                }
                                return;
@@ -56,7 +56,7 @@ function wall_upload_post(App $a, $desktopmode = true)
                }
        } else {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Invalid request.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                        exit();
                }
                return;
@@ -92,16 +92,16 @@ function wall_upload_post(App $a, $desktopmode = true)
 
        if (!$can_post) {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Permission denied.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Permission denied.')]);
                        exit();
                }
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                exit();
        }
 
        if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Invalid request.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                }
                exit();
        }
@@ -152,10 +152,10 @@ function wall_upload_post(App $a, $desktopmode = true)
 
        if ($src == "") {
                if ($r_json) {
-                       echo json_encode(['error' => L10n::t('Invalid request.')]);
+                       echo json_encode(['error' => DI::l10n()->t('Invalid request.')]);
                        exit();
                }
-               notice(L10n::t('Invalid request.').EOL);
+               notice(DI::l10n()->t('Invalid request.').EOL);
                exit();
        }
 
@@ -183,7 +183,7 @@ function wall_upload_post(App $a, $desktopmode = true)
        $maximagesize = Config::get('system', 'maximagesize');
 
        if (($maximagesize) && ($filesize > $maximagesize)) {
-               $msg = L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
+               $msg = DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
@@ -197,7 +197,7 @@ function wall_upload_post(App $a, $desktopmode = true)
        $Image = new Image($imagedata, $filetype);
 
        if (!$Image->isValid()) {
-               $msg = L10n::t('Unable to process image.');
+               $msg = DI::l10n()->t('Unable to process image.');
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
@@ -228,7 +228,7 @@ function wall_upload_post(App $a, $desktopmode = true)
 
        // If we don't have an album name use the Wall Photos album
        if (!strlen($album)) {
-               $album = L10n::t('Wall Photos');
+               $album = DI::l10n()->t('Wall Photos');
        }
 
        $defperm = '<' . $default_cid . '>';
@@ -236,7 +236,7 @@ function wall_upload_post(App $a, $desktopmode = true)
        $r = Photo::store($Image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0, 0, $defperm);
 
        if (!$r) {
-               $msg = L10n::t('Image upload failed.');
+               $msg = DI::l10n()->t('Image upload failed.');
                if ($r_json) {
                        echo json_encode(['error' => $msg]);
                } else {
index 1d7af713606083137a66a96672db73456ecc7d4f..cf9759b714b74423e2c05e3105b057df46f543ba 100644 (file)
@@ -16,7 +16,7 @@ function wallmessage_post(App $a) {
 
        $replyto = Profile::getMyURL();
        if (!$replyto) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -40,7 +40,7 @@ function wallmessage_post(App $a) {
        $user = $r[0];
 
        if (! intval($user['unkmail'])) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -49,7 +49,7 @@ function wallmessage_post(App $a) {
        );
 
        if ($r[0]['total'] > $user['cntunkmail']) {
-               notice(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
+               notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
                return;
        }
 
@@ -57,19 +57,19 @@ function wallmessage_post(App $a) {
 
        switch ($ret) {
                case -1:
-                       notice(L10n::t('No recipient selected.') . EOL);
+                       notice(DI::l10n()->t('No recipient selected.') . EOL);
                        break;
                case -2:
-                       notice(L10n::t('Unable to check your home location.') . EOL);
+                       notice(DI::l10n()->t('Unable to check your home location.') . EOL);
                        break;
                case -3:
-                       notice(L10n::t('Message could not be sent.') . EOL);
+                       notice(DI::l10n()->t('Message could not be sent.') . EOL);
                        break;
                case -4:
-                       notice(L10n::t('Message collection failure.') . EOL);
+                       notice(DI::l10n()->t('Message collection failure.') . EOL);
                        break;
                default:
-                       info(L10n::t('Message sent.') . EOL);
+                       info(DI::l10n()->t('Message sent.') . EOL);
        }
 
        DI::baseUrl()->redirect('profile/'.$user['nickname']);
@@ -79,14 +79,14 @@ function wallmessage_post(App $a) {
 function wallmessage_content(App $a) {
 
        if (!Profile::getMyURL()) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
        $recipient = (($a->argc > 1) ? $a->argv[1] : '');
 
        if (!$recipient) {
-               notice(L10n::t('No recipient.') . EOL);
+               notice(DI::l10n()->t('No recipient.') . EOL);
                return;
        }
 
@@ -95,7 +95,7 @@ function wallmessage_content(App $a) {
        );
 
        if (! DBA::isResult($r)) {
-               notice(L10n::t('No recipient.') . EOL);
+               notice(DI::l10n()->t('No recipient.') . EOL);
                Logger::log('wallmessage: no recipient');
                return;
        }
@@ -103,7 +103,7 @@ function wallmessage_content(App $a) {
        $user = $r[0];
 
        if (!intval($user['unkmail'])) {
-               notice(L10n::t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.') . EOL);
                return;
        }
 
@@ -112,7 +112,7 @@ function wallmessage_content(App $a) {
        );
 
        if ($r[0]['total'] > $user['cntunkmail']) {
-               notice(L10n::t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
+               notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
                return;
        }
 
@@ -120,25 +120,25 @@ function wallmessage_content(App $a) {
        DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$baseurl' => DI::baseUrl()->get(true),
                '$nickname' => $user['nickname'],
-               '$linkurl' => L10n::t('Please enter a link URL:')
+               '$linkurl' => DI::l10n()->t('Please enter a link URL:')
        ]);
 
        $tpl = Renderer::getMarkupTemplate('wallmessage.tpl');
        $o = Renderer::replaceMacros($tpl, [
-               '$header'     => L10n::t('Send Private Message'),
-               '$subheader'  => L10n::t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
-               '$to'         => L10n::t('To:'),
-               '$subject'    => L10n::t('Subject:'),
+               '$header'     => DI::l10n()->t('Send Private Message'),
+               '$subheader'  => DI::l10n()->t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
+               '$to'         => DI::l10n()->t('To:'),
+               '$subject'    => DI::l10n()->t('Subject:'),
                '$recipname'  => $user['username'],
                '$nickname'   => $user['nickname'],
                '$subjtxt'    => $_REQUEST['subject'] ?? '',
                '$text'       => $_REQUEST['body'] ?? '',
                '$readonly'   => '',
-               '$yourmessage'=> L10n::t('Your message:'),
+               '$yourmessage'=> DI::l10n()->t('Your message:'),
                '$parent'     => '',
-               '$upload'     => L10n::t('Upload photo'),
-               '$insert'     => L10n::t('Insert web link'),
-               '$wait'       => L10n::t('Please wait')
+               '$upload'     => DI::l10n()->t('Upload photo'),
+               '$insert'     => DI::l10n()->t('Insert web link'),
+               '$wait'       => DI::l10n()->t('Please wait')
        ]);
 
        return $o;
index c9ba21bb3538e2df167dc74176652f2e4ab659c4..968855acb55582b690b41823cfe307a911bb6918 100644 (file)
@@ -181,9 +181,9 @@ class Router
                        $moduleClass = $routeInfo[1];
                        $this->parameters = $routeInfo[2];
                } elseif ($routeInfo[0] === Dispatcher::METHOD_NOT_ALLOWED) {
-                       throw new HTTPException\MethodNotAllowedException(L10n::t('Method not allowed for this module. Allowed method(s): %s', implode(', ', $routeInfo[1])));
+                       throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method not allowed for this module. Allowed method(s): %s', implode(', ', $routeInfo[1])));
                } else {
-                       throw new HTTPException\NotFoundException(L10n::t('Page not found.'));
+                       throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
                }
 
                return $moduleClass;
index a993a95ad80b31ba3883992cb01d09477ab7d4aa..666496ba96cdfd8c03cbae58d1d93d0203d0c6cb 100644 (file)
@@ -130,7 +130,7 @@ abstract class BaseModule
 
        public static function getFormSecurityStandardErrorMessage()
        {
-               return L10n::t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it.") . EOL;
+               return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it.") . EOL;
        }
 
        public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token')
index 4055e486699e6c749858583da0c0b5986615ad1e..e7a1f540ee8ccbe69ed90e81ceb57f14d07e7402 100644 (file)
@@ -83,7 +83,7 @@ HELP;
 
                $nurl = Strings::normaliseLink($this->getArgument(0));
                if (!$this->dba->exists('contact', ['nurl' => $nurl, 'archive' => false])) {
-                       throw new RuntimeException(L10n::t('Could not find any unarchived contact entry for this URL (%s)', $nurl));
+                       throw new RuntimeException(DI::l10n()->t('Could not find any unarchived contact entry for this URL (%s)', $nurl));
                }
                if ($this->dba->update('contact', ['archive' => true], ['nurl' => $nurl])) {
                        $this->out($this->l10n->t('The contact entries have been archived'));
index faba6269fe9fcdcaf73215ae1056c1156e4be954..f9d6b04941912a160000316241a44d157025b10f 100644 (file)
@@ -55,12 +55,12 @@ class ContactSelector
                $o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n";
 
                $rep = [
-                       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')
+                       0 => DI::l10n()->t('Frequently'),
+                       1 => DI::l10n()->t('Hourly'),
+                       2 => DI::l10n()->t('Twice daily'),
+                       3 => DI::l10n()->t('Daily'),
+                       4 => DI::l10n()->t('Weekly'),
+                       5 => DI::l10n()->t('Monthly')
                ];
 
                foreach ($rep as $k => $v) {
@@ -114,23 +114,23 @@ class ContactSelector
        public static function networkToName($network, $profile = '', $protocol = '')
        {
                $nets = [
-                       Protocol::DFRN      =>   L10n::t('DFRN'),
-                       Protocol::OSTATUS   =>   L10n::t('OStatus'),
-                       Protocol::FEED      =>   L10n::t('RSS/Atom'),
-                       Protocol::MAIL      =>   L10n::t('Email'),
-                       Protocol::DIASPORA  =>   L10n::t('Diaspora'),
-                       Protocol::ZOT       =>   L10n::t('Zot!'),
-                       Protocol::LINKEDIN  =>   L10n::t('LinkedIn'),
-                       Protocol::XMPP      =>   L10n::t('XMPP/IM'),
-                       Protocol::MYSPACE   =>   L10n::t('MySpace'),
-                       Protocol::GPLUS     =>   L10n::t('Google+'),
-                       Protocol::PUMPIO    =>   L10n::t('pump.io'),
-                       Protocol::TWITTER   =>   L10n::t('Twitter'),
-                       Protocol::DISCOURSE =>   L10n::t('Discourse'),
-                       Protocol::DIASPORA2 =>   L10n::t('Diaspora Connector'),
-                       Protocol::STATUSNET =>   L10n::t('GNU Social Connector'),
-                       Protocol::ACTIVITYPUB => L10n::t('ActivityPub'),
-                       Protocol::PNUT      =>   L10n::t('pnut'),
+                       Protocol::DFRN      =>   DI::l10n()->t('DFRN'),
+                       Protocol::OSTATUS   =>   DI::l10n()->t('OStatus'),
+                       Protocol::FEED      =>   DI::l10n()->t('RSS/Atom'),
+                       Protocol::MAIL      =>   DI::l10n()->t('Email'),
+                       Protocol::DIASPORA  =>   DI::l10n()->t('Diaspora'),
+                       Protocol::ZOT       =>   DI::l10n()->t('Zot!'),
+                       Protocol::LINKEDIN  =>   DI::l10n()->t('LinkedIn'),
+                       Protocol::XMPP      =>   DI::l10n()->t('XMPP/IM'),
+                       Protocol::MYSPACE   =>   DI::l10n()->t('MySpace'),
+                       Protocol::GPLUS     =>   DI::l10n()->t('Google+'),
+                       Protocol::PUMPIO    =>   DI::l10n()->t('pump.io'),
+                       Protocol::TWITTER   =>   DI::l10n()->t('Twitter'),
+                       Protocol::DISCOURSE =>   DI::l10n()->t('Discourse'),
+                       Protocol::DIASPORA2 =>   DI::l10n()->t('Diaspora Connector'),
+                       Protocol::STATUSNET =>   DI::l10n()->t('GNU Social Connector'),
+                       Protocol::ACTIVITYPUB => DI::l10n()->t('ActivityPub'),
+                       Protocol::PNUT      =>   DI::l10n()->t('pnut'),
                ];
 
                Hook::callAll('network_to_name', $nets);
@@ -164,7 +164,7 @@ class ContactSelector
                }
 
                if (!empty($protocol) && ($protocol != $network)) {
-                       $networkname = L10n::t('%s (via %s)', $networkname, self::networkToName($protocol));
+                       $networkname = DI::l10n()->t('%s (via %s)', $networkname, self::networkToName($protocol));
                }
 
                return $networkname;
@@ -233,21 +233,21 @@ class ContactSelector
        {
                $o = '';
                $select = [
-                       ''                 => L10n::t('No answer'),
-                       'Male'             => L10n::t('Male'),
-                       'Female'           => L10n::t('Female'),
-                       'Currently Male'   => L10n::t('Currently Male'),
-                       'Currently Female' => L10n::t('Currently Female'),
-                       'Mostly Male'      => L10n::t('Mostly Male'),
-                       'Mostly Female'    => L10n::t('Mostly Female'),
-                       'Transgender'      => L10n::t('Transgender'),
-                       'Intersex'         => L10n::t('Intersex'),
-                       'Transsexual'      => L10n::t('Transsexual'),
-                       'Hermaphrodite'    => L10n::t('Hermaphrodite'),
-                       'Neuter'           => L10n::t('Neuter'),
-                       'Non-specific'     => L10n::t('Non-specific'),
-                       'Other'            => L10n::t('Other'),
-                       'Undecided'        => L10n::t('Undecided'),
+                       ''                 => DI::l10n()->t('No answer'),
+                       'Male'             => DI::l10n()->t('Male'),
+                       'Female'           => DI::l10n()->t('Female'),
+                       'Currently Male'   => DI::l10n()->t('Currently Male'),
+                       'Currently Female' => DI::l10n()->t('Currently Female'),
+                       'Mostly Male'      => DI::l10n()->t('Mostly Male'),
+                       'Mostly Female'    => DI::l10n()->t('Mostly Female'),
+                       'Transgender'      => DI::l10n()->t('Transgender'),
+                       'Intersex'         => DI::l10n()->t('Intersex'),
+                       'Transsexual'      => DI::l10n()->t('Transsexual'),
+                       'Hermaphrodite'    => DI::l10n()->t('Hermaphrodite'),
+                       'Neuter'           => DI::l10n()->t('Neuter'),
+                       'Non-specific'     => DI::l10n()->t('Non-specific'),
+                       'Other'            => DI::l10n()->t('Other'),
+                       'Undecided'        => DI::l10n()->t('Undecided'),
                ];
 
                Hook::callAll('gender_selector', $select);
@@ -273,20 +273,20 @@ class ContactSelector
        {
                $o = '';
                $select = [
-                       ''              => L10n::t('No answer'),
-                       'Males'         => L10n::t('Males'),
-                       'Females'       => L10n::t('Females'),
-                       'Gay'           => L10n::t('Gay'),
-                       'Lesbian'       => L10n::t('Lesbian'),
-                       'No Preference' => L10n::t('No Preference'),
-                       'Bisexual'      => L10n::t('Bisexual'),
-                       'Autosexual'    => L10n::t('Autosexual'),
-                       'Abstinent'     => L10n::t('Abstinent'),
-                       'Virgin'        => L10n::t('Virgin'),
-                       'Deviant'       => L10n::t('Deviant'),
-                       'Fetish'        => L10n::t('Fetish'),
-                       'Oodles'        => L10n::t('Oodles'),
-                       'Nonsexual'     => L10n::t('Nonsexual'),
+                       ''              => DI::l10n()->t('No answer'),
+                       'Males'         => DI::l10n()->t('Males'),
+                       'Females'       => DI::l10n()->t('Females'),
+                       'Gay'           => DI::l10n()->t('Gay'),
+                       'Lesbian'       => DI::l10n()->t('Lesbian'),
+                       'No Preference' => DI::l10n()->t('No Preference'),
+                       'Bisexual'      => DI::l10n()->t('Bisexual'),
+                       'Autosexual'    => DI::l10n()->t('Autosexual'),
+                       'Abstinent'     => DI::l10n()->t('Abstinent'),
+                       'Virgin'        => DI::l10n()->t('Virgin'),
+                       'Deviant'       => DI::l10n()->t('Deviant'),
+                       'Fetish'        => DI::l10n()->t('Fetish'),
+                       'Oodles'        => DI::l10n()->t('Oodles'),
+                       'Nonsexual'     => DI::l10n()->t('Nonsexual'),
                ];
 
                Hook::callAll('sexpref_selector', $select);
@@ -311,37 +311,37 @@ class ContactSelector
        {
                $o = '';
                $select = [
-                       ''                     => L10n::t('No answer'),
-                       'Single'               => L10n::t('Single'),
-                       'Lonely'               => L10n::t('Lonely'),
-                       'In a relation'        => L10n::t('In a relation'),
-                       'Has crush'            => L10n::t('Has crush'),
-                       'Infatuated'           => L10n::t('Infatuated'),
-                       'Dating'               => L10n::t('Dating'),
-                       'Unfaithful'           => L10n::t('Unfaithful'),
-                       'Sex Addict'           => L10n::t('Sex Addict'),
-                       'Friends'              => L10n::t('Friends'),
-                       'Friends/Benefits'     => L10n::t('Friends/Benefits'),
-                       'Casual'               => L10n::t('Casual'),
-                       'Engaged'              => L10n::t('Engaged'),
-                       'Married'              => L10n::t('Married'),
-                       'Imaginarily married'  => L10n::t('Imaginarily married'),
-                       'Partners'             => L10n::t('Partners'),
-                       'Cohabiting'           => L10n::t('Cohabiting'),
-                       'Common law'           => L10n::t('Common law'),
-                       'Happy'                => L10n::t('Happy'),
-                       'Not looking'          => L10n::t('Not looking'),
-                       'Swinger'              => L10n::t('Swinger'),
-                       'Betrayed'             => L10n::t('Betrayed'),
-                       'Separated'            => L10n::t('Separated'),
-                       'Unstable'             => L10n::t('Unstable'),
-                       'Divorced'             => L10n::t('Divorced'),
-                       'Imaginarily divorced' => L10n::t('Imaginarily divorced'),
-                       'Widowed'              => L10n::t('Widowed'),
-                       'Uncertain'            => L10n::t('Uncertain'),
-                       'It\'s complicated'    => L10n::t('It\'s complicated'),
-                       'Don\'t care'          => L10n::t('Don\'t care'),
-                       'Ask me'               => L10n::t('Ask me'),
+                       ''                     => DI::l10n()->t('No answer'),
+                       'Single'               => DI::l10n()->t('Single'),
+                       'Lonely'               => DI::l10n()->t('Lonely'),
+                       'In a relation'        => DI::l10n()->t('In a relation'),
+                       'Has crush'            => DI::l10n()->t('Has crush'),
+                       'Infatuated'           => DI::l10n()->t('Infatuated'),
+                       'Dating'               => DI::l10n()->t('Dating'),
+                       'Unfaithful'           => DI::l10n()->t('Unfaithful'),
+                       'Sex Addict'           => DI::l10n()->t('Sex Addict'),
+                       'Friends'              => DI::l10n()->t('Friends'),
+                       'Friends/Benefits'     => DI::l10n()->t('Friends/Benefits'),
+                       'Casual'               => DI::l10n()->t('Casual'),
+                       'Engaged'              => DI::l10n()->t('Engaged'),
+                       'Married'              => DI::l10n()->t('Married'),
+                       'Imaginarily married'  => DI::l10n()->t('Imaginarily married'),
+                       'Partners'             => DI::l10n()->t('Partners'),
+                       'Cohabiting'           => DI::l10n()->t('Cohabiting'),
+                       'Common law'           => DI::l10n()->t('Common law'),
+                       'Happy'                => DI::l10n()->t('Happy'),
+                       'Not looking'          => DI::l10n()->t('Not looking'),
+                       'Swinger'              => DI::l10n()->t('Swinger'),
+                       'Betrayed'             => DI::l10n()->t('Betrayed'),
+                       'Separated'            => DI::l10n()->t('Separated'),
+                       'Unstable'             => DI::l10n()->t('Unstable'),
+                       'Divorced'             => DI::l10n()->t('Divorced'),
+                       'Imaginarily divorced' => DI::l10n()->t('Imaginarily divorced'),
+                       'Widowed'              => DI::l10n()->t('Widowed'),
+                       'Uncertain'            => DI::l10n()->t('Uncertain'),
+                       'It\'s complicated'    => DI::l10n()->t('It\'s complicated'),
+                       'Don\'t care'          => DI::l10n()->t('Don\'t care'),
+                       'Ask me'               => DI::l10n()->t('Ask me'),
                ];
 
                Hook::callAll('marital_selector', $select);
index af821e6c742f528c863f233589f13da17413f4ef..563c0ab929d1d5ea4f5ac2c3d82a7a3435aa89e9 100644 (file)
@@ -79,47 +79,47 @@ class Feature
 
                        // General
                        'general' => [
-                               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 \x28if present\x29 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)],
-                               ['trending_tags',   L10n::t('Trending Tags'),          L10n::t('Show a community page widget with a list of the most popular tags in recent public posts.'), false, Config::get('feature_lock', 'trending_tags', false)],
+                               DI::l10n()->t('General Features'),
+                               //array('expire',         DI::l10n()->t('Content Expiration'),          DI::l10n()->t('Remove old posts/comments after a period of time')),
+                               ['multi_profiles',  DI::l10n()->t('Multiple Profiles'),      DI::l10n()->t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
+                               ['photo_location',  DI::l10n()->t('Photo Location'),         DI::l10n()->t("Photo metadata is normally stripped. This extracts the location \x28if present\x29 prior to stripping metadata and links it to a map."), false, Config::get('feature_lock', 'photo_location', false)],
+                               ['export_calendar', DI::l10n()->t('Export Public Calendar'), DI::l10n()->t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
+                               ['trending_tags',   DI::l10n()->t('Trending Tags'),          DI::l10n()->t('Show a community page widget with a list of the most popular tags in recent public posts.'), false, Config::get('feature_lock', 'trending_tags', false)],
                        ],
 
                        // Post composition
                        'composition' => [
-                               L10n::t('Post Composition Features'),
-                               ['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)],
-                               ['explicit_mentions', L10n::t('Explicit Mentions'), L10n::t('Add explicit mentions to comment box for manual control over who gets mentioned in replies.'), false, Config::get('feature_lock', 'explicit_mentions', false)],
+                               DI::l10n()->t('Post Composition Features'),
+                               ['aclautomention', DI::l10n()->t('Auto-mention Forums'), DI::l10n()->t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
+                               ['explicit_mentions', DI::l10n()->t('Explicit Mentions'), DI::l10n()->t('Add explicit mentions to comment box for manual control over who gets mentioned in replies.'), false, Config::get('feature_lock', 'explicit_mentions', false)],
                        ],
 
                        // Network sidebar widgets
                        'widgets' => [
-                               L10n::t('Network Sidebar'),
-                               ['archives',         L10n::t('Archives'), L10n::t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
-                               ['networks',         L10n::t('Protocol Filter'), L10n::t('Enable widget to display Network posts only from selected protocols'), false, Config::get('feature_lock', 'networks', false)],
+                               DI::l10n()->t('Network Sidebar'),
+                               ['archives',         DI::l10n()->t('Archives'), DI::l10n()->t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
+                               ['networks',         DI::l10n()->t('Protocol Filter'), DI::l10n()->t('Enable widget to display Network posts only from selected protocols'), false, Config::get('feature_lock', 'networks', false)],
                        ],
 
                        // Network tabs
                        'net_tabs' => [
-                               L10n::t('Network Tabs'),
-                               ['new_tab',      L10n::t('Network New Tab'),          L10n::t("Enable tab to display only new Network posts \x28from the last 12 hours\x29"), 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)],
+                               DI::l10n()->t('Network Tabs'),
+                               ['new_tab',      DI::l10n()->t('Network New Tab'),          DI::l10n()->t("Enable tab to display only new Network posts \x28from the last 12 hours\x29"), false, Config::get('feature_lock', 'new_tab', false)],
+                               ['link_tab',     DI::l10n()->t('Network Shared Links Tab'), DI::l10n()->t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
                        ],
 
                        // Item tools
                        'tools' => [
-                               L10n::t('Post/Comment Tools'),
-                               ['categories',   L10n::t('Post Categories'),         L10n::t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
+                               DI::l10n()->t('Post/Comment Tools'),
+                               ['categories',   DI::l10n()->t('Post Categories'),         DI::l10n()->t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
                        ],
 
                        // Advanced Profile Settings
                        'advanced_profile' => [
-                               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)],
-                               ['profile_membersince', L10n::t('Display Membership Date'), L10n::t('Display membership date in profile'), false, Config::get('feature_lock', 'profile_membersince', false)],
+                               DI::l10n()->t('Advanced Profile Settings'),
+                               ['forumlist_profile',   DI::l10n()->t('List Forums'),             DI::l10n()->t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
+                               ['tagadelic',           DI::l10n()->t('Tag Cloud'),               DI::l10n()->t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
+                               ['profile_membersince', DI::l10n()->t('Display Membership Date'), DI::l10n()->t('Display membership date in profile'), false, Config::get('feature_lock', 'profile_membersince', false)],
                        ],
                ];
 
index 0c34cb94d498291e587f17bff8f4a0f40d2c760b..7c2061c47ca405f7a97e400dfaadb02dc8d1205f 100644 (file)
@@ -127,12 +127,12 @@ class ForumManager
                        $o .= Renderer::replaceMacros(
                                $tpl,
                                [
-                                       '$title'        => L10n::t('Forums'),
+                                       '$title'        => DI::l10n()->t('Forums'),
                                        '$forums'       => $entries,
-                                       '$link_desc'    => L10n::t('External link to forum'),
+                                       '$link_desc'    => DI::l10n()->t('External link to forum'),
                                        '$total'        => $total,
                                        '$visible_forums' => $visible_forums,
-                                       '$showmore'     => L10n::t('show more')]
+                                       '$showmore'     => DI::l10n()->t('show more')]
                        );
                }
 
index 2cb47710295c2dba9353fffc2033f12695d2cfda..30e4a1c0872df48f9bd3ca0bf2c433db2e2b6211 100644 (file)
@@ -71,12 +71,12 @@ class Nav
                        '$sitelocation' => $nav_info['sitelocation'],
                        '$nav'          => $nav_info['nav'],
                        '$banner'       => $nav_info['banner'],
-                       '$emptynotifications' => L10n::t('Nothing new here'),
+                       '$emptynotifications' => DI::l10n()->t('Nothing new here'),
                        '$userinfo'     => $nav_info['userinfo'],
                        '$sel'          => self::$selected,
                        '$apps'         => self::getAppMenu(),
-                       '$clear_notifs' => L10n::t('Clear notifications'),
-                       '$search_hint'  => L10n::t('@name, !forum, #tags, content')
+                       '$clear_notifs' => DI::l10n()->t('Clear notifications'),
+                       '$search_hint'  => DI::l10n()->t('@name, !forum, #tags, content')
                ]);
 
                Hook::callAll('page_header', $nav);
@@ -149,19 +149,19 @@ class Nav
                $userinfo = null;
 
                if (Session::isAuthenticated()) {
-                       $nav['logout'] = ['logout', L10n::t('Logout'), '', L10n::t('End this session')];
+                       $nav['logout'] = ['logout', DI::l10n()->t('Logout'), '', DI::l10n()->t('End this session')];
                } else {
-                       $nav['login'] = ['login', L10n::t('Login'), (DI::module()->getName() == 'login' ? 'selected' : ''), L10n::t('Sign in')];
+                       $nav['login'] = ['login', DI::l10n()->t('Login'), (DI::module()->getName() == 'login' ? 'selected' : ''), DI::l10n()->t('Sign in')];
                }
 
                if (local_user()) {
                        // user menu
-                       $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')];
+                       $nav['usermenu'][] = ['profile/' . $a->user['nickname'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
+                       $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
+                       $nav['usermenu'][] = ['photos/' . $a->user['nickname'], DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')];
+                       $nav['usermenu'][] = ['videos/' . $a->user['nickname'], DI::l10n()->t('Videos'), '', DI::l10n()->t('Your videos')];
+                       $nav['usermenu'][] = ['events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')];
+                       $nav['usermenu'][] = ['notes/', DI::l10n()->t('Personal notes'), '', DI::l10n()->t('Your personal notes')];
 
                        // user info
                        $contact = DBA::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
@@ -178,34 +178,34 @@ class Nav
                }
 
                if ((DI::module()->getName() != 'home') && (! (local_user()))) {
-                       $nav['home'] = [$homelink, L10n::t('Home'), '', L10n::t('Home Page')];
+                       $nav['home'] = [$homelink, DI::l10n()->t('Home'), '', DI::l10n()->t('Home Page')];
                }
 
                if (intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::OPEN && !Session::isAuthenticated()) {
-                       $nav['register'] = ['register', L10n::t('Register'), '', L10n::t('Create an account')];
+                       $nav['register'] = ['register', DI::l10n()->t('Register'), '', DI::l10n()->t('Create an account')];
                }
 
                $help_url = 'help';
 
                if (!Config::get('system', 'hide_help')) {
-                       $nav['help'] = [$help_url, L10n::t('Help'), '', L10n::t('Help and documentation')];
+                       $nav['help'] = [$help_url, DI::l10n()->t('Help'), '', DI::l10n()->t('Help and documentation')];
                }
 
                if (count(self::getAppMenu()) > 0) {
-                       $nav['apps'] = ['apps', L10n::t('Apps'), '', L10n::t('Addon applications, utilities, games')];
+                       $nav['apps'] = ['apps', DI::l10n()->t('Apps'), '', DI::l10n()->t('Addon applications, utilities, games')];
                }
 
                if (local_user() || !Config::get('system', 'local_search')) {
-                       $nav['search'] = ['search', L10n::t('Search'), '', L10n::t('Search site content')];
+                       $nav['search'] = ['search', DI::l10n()->t('Search'), '', DI::l10n()->t('Search site content')];
 
                        $nav['searchoption'] = [
-                               L10n::t('Full Text'),
-                               L10n::t('Tags'),
-                               L10n::t('Contacts')
+                               DI::l10n()->t('Full Text'),
+                               DI::l10n()->t('Tags'),
+                               DI::l10n()->t('Contacts')
                        ];
 
                        if (Config::get('system', 'poco_local_search')) {
-                               $nav['searchoption'][] = L10n::t('Forums');
+                               $nav['searchoption'][] = DI::l10n()->t('Forums');
                        }
                }
 
@@ -220,59 +220,59 @@ class Nav
 
                if ((local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) &&
                        !(Config::get('system', 'community_page_style') == CP_NO_INTERNAL_COMMUNITY)) {
-                       $nav['community'] = ['community', L10n::t('Community'), '', L10n::t('Conversations on this and other servers')];
+                       $nav['community'] = ['community', DI::l10n()->t('Community'), '', DI::l10n()->t('Conversations on this and other servers')];
                }
 
                if (local_user()) {
-                       $nav['events'] = ['events', L10n::t('Events'), '', L10n::t('Events and Calendar')];
+                       $nav['events'] = ['events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')];
                }
 
-               $nav['directory'] = [$gdirpath, L10n::t('Directory'), '', L10n::t('People directory')];
+               $nav['directory'] = [$gdirpath, DI::l10n()->t('Directory'), '', DI::l10n()->t('People directory')];
 
-               $nav['about'] = ['friendica', L10n::t('Information'), '', L10n::t('Information about this friendica instance')];
+               $nav['about'] = ['friendica', DI::l10n()->t('Information'), '', DI::l10n()->t('Information about this friendica instance')];
 
                if (Config::get('system', 'tosdisplay')) {
-                       $nav['tos'] = ['tos', L10n::t('Terms of Service'), '', L10n::t('Terms of Service of this Friendica instance')];
+                       $nav['tos'] = ['tos', DI::l10n()->t('Terms of Service'), '', DI::l10n()->t('Terms of Service of this Friendica instance')];
                }
 
                // The following nav links are only show to logged in users
                if (local_user()) {
-                       $nav['network'] = ['network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
+                       $nav['network'] = ['network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')];
 
-                       $nav['home'] = ['profile/' . $a->user['nickname'], L10n::t('Home'), '', L10n::t('Your posts and conversations')];
+                       $nav['home'] = ['profile/' . $a->user['nickname'], DI::l10n()->t('Home'), '', DI::l10n()->t('Your posts and conversations')];
 
                        // Don't show notifications for public communities
                        if (Session::get('page_flags', '') != User::PAGE_FLAGS_COMMUNITY) {
-                               $nav['introductions'] = ['notifications/intros', L10n::t('Introductions'), '', L10n::t('Friend Requests')];
-                               $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['introductions'] = ['notifications/intros', DI::l10n()->t('Introductions'), '', DI::l10n()->t('Friend Requests')];
+                               $nav['notifications'] = ['notifications',       DI::l10n()->t('Notifications'), '', DI::l10n()->t('Notifications')];
+                               $nav['notifications']['all'] = ['notifications/system', DI::l10n()->t('See all notifications'), '', ''];
+                               $nav['notifications']['mark'] = ['', DI::l10n()->t('Mark as seen'), '', DI::l10n()->t('Mark all system notifications seen')];
                        }
 
-                       $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')];
+                       $nav['messages'] = ['message', DI::l10n()->t('Messages'), '', DI::l10n()->t('Private mail')];
+                       $nav['messages']['inbox'] = ['message', DI::l10n()->t('Inbox'), '', DI::l10n()->t('Inbox')];
+                       $nav['messages']['outbox'] = ['message/sent', DI::l10n()->t('Outbox'), '', DI::l10n()->t('Outbox')];
+                       $nav['messages']['new'] = ['message/new', DI::l10n()->t('New Message'), '', DI::l10n()->t('New Message')];
 
                        if (is_array($a->identities) && count($a->identities) > 1) {
-                               $nav['delegation'] = ['delegation', L10n::t('Delegation'), '', L10n::t('Manage other pages')];
+                               $nav['delegation'] = ['delegation', DI::l10n()->t('Delegation'), '', DI::l10n()->t('Manage other pages')];
                        }
 
-                       $nav['settings'] = ['settings', L10n::t('Settings'), '', L10n::t('Account settings')];
+                       $nav['settings'] = ['settings', DI::l10n()->t('Settings'), '', DI::l10n()->t('Account settings')];
 
                        if (Feature::isEnabled(local_user(), 'multi_profiles')) {
-                               $nav['profiles'] = ['profiles', L10n::t('Profiles'), '', L10n::t('Manage/Edit Profiles')];
+                               $nav['profiles'] = ['profiles', DI::l10n()->t('Profiles'), '', DI::l10n()->t('Manage/Edit Profiles')];
                        }
 
-                       $nav['contacts'] = ['contact', L10n::t('Contacts'), '', L10n::t('Manage/edit friends and contacts')];
+                       $nav['contacts'] = ['contact', DI::l10n()->t('Contacts'), '', DI::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/', L10n::t('Admin'), '', L10n::t('Site setup and configuration')];
+                       $nav['admin'] = ['admin/', DI::l10n()->t('Admin'), '', DI::l10n()->t('Site setup and configuration')];
                }
 
-               $nav['navigation'] = ['navigation/', L10n::t('Navigation'), '', L10n::t('Site map')];
+               $nav['navigation'] = ['navigation/', DI::l10n()->t('Navigation'), '', DI::l10n()->t('Site map')];
 
                // Provide a banner/logo/whatever
                $banner = Config::get('system', 'banner');
index 64182c70e0c27acda45712bec15960df1beb329d..3eceb21c2189a68da527064acccb9e67191f443d 100644 (file)
@@ -251,7 +251,7 @@ class OEmbed
        {
                $stopoembed = Config::get("system", "no_oembed");
                if ($stopoembed == true) {
-                       return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . L10n::t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text);
+                       return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>" . DI::l10n()->t('Embedding disabled') . " : $1</i><!-- /oembed $1 -->", $text);
                }
                return preg_replace_callback("/\[embed\](.+?)\[\/embed\]/is", ['self', 'replaceCallback'], $text);
        }
@@ -373,7 +373,7 @@ class OEmbed
                $width = '100%';
 
                $src = DI::baseUrl() . '/oembed/' . Strings::base64UrlEncode($src);
-               return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . L10n::t('Embedded content') . '</iframe>';
+               return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . DI::l10n()->t('Embedded content') . '</iframe>';
        }
 
        /**
index 327272e2888fd7b423e897bfb3073a7fdc5f3ed4..f8dace08c403d9b26a0d806cc896558d548ea07f 100644 (file)
@@ -150,12 +150,12 @@ class Pager
                        'class' => 'pager',
                        'prev'  => [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() - 1)),
-                               'text'  => L10n::t('newer'),
+                               'text'  => DI::l10n()->t('newer'),
                                'class' => 'previous' . ($this->getPage() == 1 ? ' disabled' : '')
                        ],
                        'next'  => [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() + 1)),
-                               'text'  => L10n::t('older'),
+                               'text'  => DI::l10n()->t('older'),
                                'class' =>  'next' . ($displayedItemCount < $this->getItemsPerPage() ? ' disabled' : '')
                        ]
                ];
@@ -195,12 +195,12 @@ class Pager
                if ($totalItemCount > $this->getItemsPerPage()) {
                        $data['first'] = [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=1'),
-                               'text'  => L10n::t('first'),
+                               'text'  => DI::l10n()->t('first'),
                                'class' => $this->getPage() == 1 ? 'disabled' : ''
                        ];
                        $data['prev'] = [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() - 1)),
-                               'text'  => L10n::t('prev'),
+                               'text'  => DI::l10n()->t('prev'),
                                'class' => $this->getPage() == 1 ? 'disabled' : ''
                        ];
 
@@ -255,12 +255,12 @@ class Pager
 
                        $data['next'] = [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . ($this->getPage() + 1)),
-                               'text'  => L10n::t('next'),
+                               'text'  => DI::l10n()->t('next'),
                                'class' => $this->getPage() == $lastpage ? 'disabled' : ''
                        ];
                        $data['last'] = [
                                'url'   => Strings::ensureQueryParameter($this->baseQueryString . '&page=' . $lastpage),
-                               'text'  => L10n::t('last'),
+                               'text'  => DI::l10n()->t('last'),
                                'class' => $this->getPage() == $lastpage ? 'disabled' : ''
                        ];
                }
index c429a34d4c338fce62d0a6035b4de44c65c7ba55..4a0a329b4cd20df8aeba102273dc5374ab4de7b8 100644 (file)
@@ -907,7 +907,7 @@ class BBCode
                        // it loops over the array starting from the first element and going sequentially
                        // to the last element
                        $newbody = str_replace('[$#saved_image' . $cnt . '#$]',
-                               '<img src="' . self::proxyUrl($image) . '" alt="' . L10n::t('Image/photo') . '" />', $newbody);
+                               '<img src="' . self::proxyUrl($image) . '" alt="' . DI::l10n()->t('Image/photo') . '" />', $newbody);
                        $cnt++;
                }
 
@@ -1024,7 +1024,7 @@ class BBCode
                                break;
                        case 4:
                                $headline = '<p><b>' . html_entity_decode('&#x2672; ', ENT_QUOTES, 'UTF-8');
-                               $headline .= L10n::t('<a href="%1$s" target="_blank">%2$s</a> %3$s', $attributes['link'], $mention, $attributes['posted']);
+                               $headline .= DI::l10n()->t('<a href="%1$s" target="_blank">%2$s</a> %3$s', $attributes['link'], $mention, $attributes['posted']);
                                $headline .= ':</b></p>' . "\n";
 
                                $text = ($is_quote_share? '<hr />' : '') . $headline . '<blockquote class="shared_content">' . trim($content) . '</blockquote>' . "\n";
@@ -1521,7 +1521,7 @@ class BBCode
                $text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm", "<span style=\"font-family: $1;\">$2</span>", $text);
 
                // Declare the format for [spoiler] layout
-               $SpoilerLayout = '<details class="spoiler"><summary>' . L10n::t('Click to open/close') . '</summary>$1</details>';
+               $SpoilerLayout = '<details class="spoiler"><summary>' . DI::l10n()->t('Click to open/close') . '</summary>$1</details>';
 
                // Check for [spoiler] text
                // handle nested quotes
@@ -1552,7 +1552,7 @@ class BBCode
 
                // Check for [quote=Author] text
 
-               $t_wrote = L10n::t('$1 wrote:');
+               $t_wrote = DI::l10n()->t('$1 wrote:');
 
                // handle nested quotes
                $endlessloop = 0;
@@ -1603,12 +1603,12 @@ class BBCode
                        $text
                );
 
-               $text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . L10n::t('Image/photo') . '" />', $text);
-               $text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . L10n::t('Image/photo') . '" />', $text);
+               $text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . DI::l10n()->t('Image/photo') . '" />', $text);
+               $text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . DI::l10n()->t('Image/photo') . '" />', $text);
 
-               $text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . L10n::t('Encrypted content') . '" /><br />', $text);
-               $text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $text);
-               //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $Text);
+               $text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . DI::l10n()->t('Encrypted content') . '" title="' . DI::l10n()->t('Encrypted content') . '" /><br />', $text);
+               $text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . DI::l10n()->t('Encrypted content') . '" title="' . '$1' . ' ' . DI::l10n()->t('Encrypted content') . '" /><br />', $text);
+               //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . DI::l10n()->t('Encrypted content') . '" title="' . '$1' . ' ' . DI::l10n()->t('Encrypted content') . '" /><br />', $Text);
 
                // Simplify "video" element
                $text = preg_replace('(\[video.*?\ssrc\s?=\s?([^\s\]]+).*?\].*?\[/video\])ism', '[video]$1[/video]', $text);
@@ -1832,7 +1832,7 @@ class BBCode
                array_walk($allowed_src_protocols, function(&$value) { $value = preg_quote($value, '#');});
 
                $text = preg_replace('#<([^>]*?)(src)="(?!' . implode('|', $allowed_src_protocols) . ')(.*?)"(.*?)>#ism',
-                                        '<$1$2=""$4 data-original-src="$3" class="invalid-src" title="' . L10n::t('Invalid source protocol') . '">', $text);
+                                        '<$1$2=""$4 data-original-src="$3" class="invalid-src" title="' . DI::l10n()->t('Invalid source protocol') . '">', $text);
 
                // sanitize href attributes (only whitelisted protocols URLs)
                // default value for backward compatibility
@@ -1847,7 +1847,7 @@ class BBCode
                array_walk($allowed_link_protocols, function(&$value) { $value = preg_quote($value, '#');});
 
                $regex = '#<([^>]*?)(href)="(?!' . implode('|', $allowed_link_protocols) . ')(.*?)"(.*?)>#ism';
-               $text = preg_replace($regex, '<$1$2="javascript:void(0)"$4 data-original-href="$3" class="invalid-href" title="' . L10n::t('Invalid link protocol') . '">', $text);
+               $text = preg_replace($regex, '<$1$2="javascript:void(0)"$4 data-original-href="$3" class="invalid-href" title="' . DI::l10n()->t('Invalid link protocol') . '">', $text);
 
                // Shared content
                $text = self::convertShare(
index 65d971489acccf6628fb14a38d7c265f1affcb5f..1cd076139006be80c43718a5975beb0cbf757585 100644 (file)
@@ -799,8 +799,8 @@ class HTML
        {
                $tpl = Renderer::getMarkupTemplate("scroll_loader.tpl");
                return Renderer::replaceMacros($tpl, [
-                       'wait' => L10n::t('Loading more entries...'),
-                       'end' => L10n::t('The end')
+                       'wait' => DI::l10n()->t('Loading more entries...'),
+                       'end' => DI::l10n()->t('The end')
                ]);
        }
 
@@ -893,28 +893,28 @@ class HTML
                if (strpos($s, '#') === 0) {
                        $mode = 'tag';
                }
-               $save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow');
+               $save_label = $mode === 'text' ? DI::l10n()->t('Save') : DI::l10n()->t('Follow');
 
                $values = [
                        '$s'            => $s,
                        '$q'            => urlencode($s),
                        '$id'           => $id,
-                       '$search_label' => L10n::t('Search'),
+                       '$search_label' => DI::l10n()->t('Search'),
                        '$save_label'   => $save_label,
-                       '$search_hint'  => L10n::t('@name, !forum, #tags, content'),
+                       '$search_hint'  => DI::l10n()->t('@name, !forum, #tags, content'),
                        '$mode'         => $mode,
                        '$return_url'   => urlencode('search?q=' . urlencode($s)),
                ];
 
                if (!$aside) {
                        $values['$search_options'] = [
-                               'fulltext' => L10n::t('Full Text'),
-                               'tags'     => L10n::t('Tags'),
-                               'contacts' => L10n::t('Contacts')
+                               'fulltext' => DI::l10n()->t('Full Text'),
+                               'tags'     => DI::l10n()->t('Tags'),
+                               'contacts' => DI::l10n()->t('Contacts')
                        ];
 
                        if (Config::get('system', 'poco_local_search')) {
-                               $values['$searchoption']['forums'] = L10n::t('Forums');
+                               $values['$searchoption']['forums'] = DI::l10n()->t('Forums');
                        }
                }
 
@@ -951,7 +951,7 @@ class HTML
                        $html = Renderer::replaceMacros($tpl, [
                                '$reasons'   => $reasons,
                                '$rnd'       => Strings::getRandomHex(8),
-                               '$openclose' => L10n::t('Click to open/close'),
+                               '$openclose' => DI::l10n()->t('Click to open/close'),
                                '$html'      => $html
                        ]);
                }
index 2ae90ea76d2bfa6c420f4f21221fbccaeac3ca7c..7c412ae8fa933de4eaf16ca98cfd73ded84175ff 100644 (file)
@@ -34,11 +34,11 @@ class Widget
        public static function follow($value = "")
        {
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/follow.tpl'), array(
-                       '$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'),
+                       '$connect' => DI::l10n()->t('Add New Contact'),
+                       '$desc' => DI::l10n()->t('Enter address or web location'),
+                       '$hint' => DI::l10n()->t('Example: bob@example.com, http://example.com/barbara'),
                        '$value' => $value,
-                       '$follow' => L10n::t('Connect')
+                       '$follow' => DI::l10n()->t('Connect')
                ));
        }
 
@@ -59,18 +59,18 @@ class Widget
                }
 
                $nv = [];
-               $nv['findpeople'] = L10n::t('Find People');
-               $nv['desc'] = L10n::t('Enter name or interest');
-               $nv['label'] = L10n::t('Connect/Follow');
-               $nv['hint'] = L10n::t('Examples: Robert Morgenstein, Fishing');
-               $nv['findthem'] = L10n::t('Find');
-               $nv['suggest'] = L10n::t('Friend Suggestions');
-               $nv['similar'] = L10n::t('Similar Interests');
-               $nv['random'] = L10n::t('Random Profile');
-               $nv['inv'] = L10n::t('Invite Friends');
-               $nv['directory'] = L10n::t('Global Directory');
+               $nv['findpeople'] = DI::l10n()->t('Find People');
+               $nv['desc'] = DI::l10n()->t('Enter name or interest');
+               $nv['label'] = DI::l10n()->t('Connect/Follow');
+               $nv['hint'] = DI::l10n()->t('Examples: Robert Morgenstein, Fishing');
+               $nv['findthem'] = DI::l10n()->t('Find');
+               $nv['suggest'] = DI::l10n()->t('Friend Suggestions');
+               $nv['similar'] = DI::l10n()->t('Similar Interests');
+               $nv['random'] = DI::l10n()->t('Random Profile');
+               $nv['inv'] = DI::l10n()->t('Invite Friends');
+               $nv['directory'] = DI::l10n()->t('Global Directory');
                $nv['global_dir'] = $global_dir;
-               $nv['local_directory'] = L10n::t('Local Directory');
+               $nv['local_directory'] = DI::l10n()->t('Local Directory');
 
                $aside = [];
                $aside['$nv'] = $nv;
@@ -191,16 +191,16 @@ class Widget
                }
 
                $options = [
-                       ['ref' => 'followers', 'name' => L10n::t('Followers')],
-                       ['ref' => 'following', 'name' => L10n::t('Following')],
-                       ['ref' => 'mutuals', 'name' => L10n::t('Mutual friends')],
+                       ['ref' => 'followers', 'name' => DI::l10n()->t('Followers')],
+                       ['ref' => 'following', 'name' => DI::l10n()->t('Following')],
+                       ['ref' => 'mutuals', 'name' => DI::l10n()->t('Mutual friends')],
                ];
 
                return self::filter(
                        'rel',
-                       L10n::t('Relationships'),
+                       DI::l10n()->t('Relationships'),
                        '',
-                       L10n::t('All Contacts'),
+                       DI::l10n()->t('All Contacts'),
                        $baseurl,
                        $options,
                        $selected
@@ -243,9 +243,9 @@ class Widget
 
                return self::filter(
                        'nets',
-                       L10n::t('Protocols'),
+                       DI::l10n()->t('Protocols'),
                        '',
-                       L10n::t('All Protocols'),
+                       DI::l10n()->t('All Protocols'),
                        $baseurl,
                        $nets,
                        $selected
@@ -282,9 +282,9 @@ class Widget
 
                return self::filter(
                        'file',
-                       L10n::t('Saved Folders'),
+                       DI::l10n()->t('Saved Folders'),
                        '',
-                       L10n::t('Everything'),
+                       DI::l10n()->t('Everything'),
                        $baseurl,
                        $terms,
                        $selected
@@ -321,9 +321,9 @@ class Widget
 
                return self::filter(
                        'category',
-                       L10n::t('Categories'),
+                       DI::l10n()->t('Categories'),
                        '',
-                       L10n::t('Everything'),
+                       DI::l10n()->t('Everything'),
                        $baseurl,
                        $terms,
                        $selected
@@ -403,7 +403,7 @@ class Widget
                        '$uid'      => $profile_uid,
                        '$cid'      => (($cid) ? $cid : '0'),
                        '$linkmore' => (($t > 5) ? 'true' : ''),
-                       '$more'     => L10n::t('show more'),
+                       '$more'     => DI::l10n()->t('show more'),
                        '$items'    => $entries
                ]);
        }
@@ -496,13 +496,13 @@ class Widget
                $cutoff = array_key_exists($cutoff_year, $ret);
 
                $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/posted_date.tpl'),[
-                       '$title' => L10n::t('Archives'),
+                       '$title' => DI::l10n()->t('Archives'),
                        '$size' => $visible_years,
                        '$cutoff_year' => $cutoff_year,
                        '$cutoff' => $cutoff,
                        '$url' => $url,
                        '$dates' => $ret,
-                       '$showmore' => L10n::t('show more')
+                       '$showmore' => DI::l10n()->t('show more')
                ]);
 
                return $o;
index ff3d3f4b8681ac51c513ad81ef0e7c71504d5bc8..293f9ae0e6e31b44eb3fce24fe3fa04b4b21b679 100644 (file)
@@ -62,9 +62,9 @@ class CalendarExport
 
                $tpl = Renderer::getMarkupTemplate("widget/events.tpl");
                $return = Renderer::replaceMacros($tpl, [
-                       '$etitle'      => L10n::t("Export"),
-                       '$export_ical' => L10n::t("Export calendar as ical"),
-                       '$export_csv'  => L10n::t("Export calendar as csv"),
+                       '$etitle'      => DI::l10n()->t("Export"),
+                       '$export_ical' => DI::l10n()->t("Export calendar as ical"),
+                       '$export_csv'  => DI::l10n()->t("Export calendar as csv"),
                        '$user'        => $user
                ]);
 
index bd4d10fd397f855cbd24d9a545e33dfc808a6537..67f8d9ac51d73ebeaf0d9a48af488bc731d9e33e 100644 (file)
@@ -55,7 +55,7 @@ class ContactBlock
                        'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA, Protocol::FEED],
                ]);
 
-               $contacts_title = L10n::t('No contacts');
+               $contacts_title = DI::l10n()->t('No contacts');
 
                $micropro = [];
 
@@ -106,7 +106,7 @@ class ContactBlock
                $o = Renderer::replaceMacros($tpl, [
                        '$contacts' => $contacts_title,
                        '$nickname' => $profile['nickname'],
-                       '$viewcontacts' => L10n::t('View Contacts'),
+                       '$viewcontacts' => DI::l10n()->t('View Contacts'),
                        '$micropro' => $micropro,
                ]);
 
index 7f7c171e09af7768d2b266ff9b90ce94a351526c..69d667caa2709767f516e6e1b704eb9f12736050 100644 (file)
@@ -26,7 +26,7 @@ class SavedSearches
                                        'id'          => $saved_search['id'],
                                        'term'        => $saved_search['term'],
                                        'encodedterm' => urlencode($saved_search['term']),
-                                       'delete'      => L10n::t('Remove term'),
+                                       'delete'      => DI::l10n()->t('Remove term'),
                                        'selected'    => $search == $saved_search['term'],
                                ];
                        }
@@ -34,7 +34,7 @@ class SavedSearches
                        $tpl = Renderer::getMarkupTemplate('widget/saved_searches.tpl');
 
                        $o = Renderer::replaceMacros($tpl, [
-                               '$title'      => L10n::t('Saved Searches'),
+                               '$title'      => DI::l10n()->t('Saved Searches'),
                                '$add'        => '',
                                '$searchbox'  => '',
                                '$saved'      => $saved,
index b29e62780e8559b8b2976eff26345e5e64418640..612ae792f5ea8f4a96ad050e5eb2e967f7f4c577 100644 (file)
@@ -50,7 +50,7 @@ class TagCloud
 
                        $tpl = Renderer::getMarkupTemplate('widget/tagcloud.tpl');
                        $o = Renderer::replaceMacros($tpl, [
-                               '$title' => L10n::t('Tags'),
+                               '$title' => DI::l10n()->t('Tags'),
                                '$tags' => $tags
                        ]);
                }
index 4ac8a1119e811f5d1742416201f71debdcce3d73..561dec00ca1199c26cd2e2320da9048220373e8e 100644 (file)
@@ -30,7 +30,7 @@ class TrendingTags
                $tpl = Renderer::getMarkupTemplate('widget/trending_tags.tpl');
                $o = Renderer::replaceMacros($tpl, [
                        '$title' => L10n::tt('Trending Tags (last %d hour)', 'Trending Tags (last %d hours)', $period),
-                       '$more' => L10n::t('More Trending Tags'),
+                       '$more' => DI::l10n()->t('More Trending Tags'),
                        '$tags' => $tags,
                ]);
 
index d4148d6ba50a5e3393e566fdf84fd7c7fac2ff22..1757c50d73ff1e7cb949b0ac813c7930b96905ff 100644 (file)
@@ -266,14 +266,14 @@ class ACL
                $acl_groups = [
                        [
                                'id' => Group::FOLLOWERS,
-                               'name' => L10n::t('Followers'),
+                               'name' => DI::l10n()->t('Followers'),
                                'addr' => '',
                                'micro' => 'images/twopeople.png',
                                'type' => 'group',
                        ],
                        [
                                'id' => Group::MUTUALS,
-                               'name' => L10n::t('Mutuals'),
+                               'name' => DI::l10n()->t('Mutuals'),
                                'addr' => '',
                                'micro' => 'images/twopeople.png',
                                'type' => 'group',
@@ -363,7 +363,7 @@ class ACL
                                                'type' => 'checkbox',
                                                'field' => [
                                                        'pubmail_enable',
-                                                       L10n::t('Post to Email'),
+                                                       DI::l10n()->t('Post to Email'),
                                                        $pubmail_enabled
                                                ]
                                        ];
@@ -381,16 +381,16 @@ class ACL
 
                $tpl = Renderer::getMarkupTemplate('acl_selector.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$public_title'   => L10n::t('Public'),
-                       '$public_desc'    => L10n::t('This content will be shown to all your followers and can be seen in the community pages and by anyone with its link.'),
-                       '$custom_title'   => L10n::t('Limited/Private'),
-                       '$custom_desc'    => L10n::t('This content will be shown only to the people in the first box, to the exception of the people mentioned in the second box. It won\'t appear anywhere public.'),
-                       '$allow_label'    => L10n::t('Show to:'),
-                       '$deny_label'     => L10n::t('Except to:'),
-                       '$emailcc'        => L10n::t('CC: email addresses'),
-                       '$emtitle'        => L10n::t('Example: bob@example.com, mary@example.com'),
-                       '$jotnets_summary' => L10n::t('Connectors'),
-                       '$jotnets_disabled_label' => L10n::t('Connectors disabled, since "%s" is enabled.', L10n::t('Hide your profile details from unknown viewers?')),
+                       '$public_title'   => DI::l10n()->t('Public'),
+                       '$public_desc'    => DI::l10n()->t('This content will be shown to all your followers and can be seen in the community pages and by anyone with its link.'),
+                       '$custom_title'   => DI::l10n()->t('Limited/Private'),
+                       '$custom_desc'    => DI::l10n()->t('This content will be shown only to the people in the first box, to the exception of the people mentioned in the second box. It won\'t appear anywhere public.'),
+                       '$allow_label'    => DI::l10n()->t('Show to:'),
+                       '$deny_label'     => DI::l10n()->t('Except to:'),
+                       '$emailcc'        => DI::l10n()->t('CC: email addresses'),
+                       '$emtitle'        => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
+                       '$jotnets_summary' => DI::l10n()->t('Connectors'),
+                       '$jotnets_disabled_label' => DI::l10n()->t('Connectors disabled, since "%s" is enabled.', DI::l10n()->t('Hide your profile details from unknown viewers?')),
                        '$visibility'     => $visibility,
                        '$acl_contacts'   => $acl_contacts,
                        '$acl_groups'     => $acl_groups,
index 8bdb00f0459131c222cc63804618a8f29285a9c2..3e790e2e3b172b51d1ccef10edcd5014a198c9ca 100644 (file)
@@ -159,7 +159,7 @@ class Installer
                $result = file_put_contents($basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.config.php', $txt);
 
                if (!$result) {
-                       $this->addCheck(L10n::t('The database configuration file "config/local.config.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'), false, false, htmlentities($txt, ENT_COMPAT, 'UTF-8'));
+                       $this->addCheck(DI::l10n()->t('The database configuration file "config/local.config.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.'), false, false, htmlentities($txt, ENT_COMPAT, 'UTF-8'));
                }
 
                return $result;
@@ -178,8 +178,8 @@ class Installer
                $result = DBStructure::update($basePath, false, true, true);
 
                if ($result) {
-                       $txt = L10n::t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
-                       $txt .= L10n::t('Please see the file "INSTALL.txt".');
+                       $txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
+                       $txt .= DI::l10n()->t('Please see the file "INSTALL.txt".');
 
                        $this->addCheck($txt, false, true, htmlentities($result, ENT_COMPAT, 'UTF-8'));
 
@@ -240,18 +240,18 @@ class Installer
 
                $help = "";
                if (!$passed) {
-                       $help .= L10n::t('Could not find a command line version of PHP in the web server PATH.') . EOL;
-                       $help .= L10n::t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
+                       $help .= DI::l10n()->t('Could not find a command line version of PHP in the web server PATH.') . EOL;
+                       $help .= DI::l10n()->t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
                        $help .= EOL . EOL;
                        $tpl = Renderer::getMarkupTemplate('field_input.tpl');
                        /// @todo Separate backend Installer class and presentation layer/view
                        $help .= Renderer::replaceMacros($tpl, [
-                               '$field' => ['config-php_path', L10n::t('PHP executable path'), $phppath, L10n::t('Enter full path to php executable. You can leave this blank to continue the installation.')],
+                               '$field' => ['config-php_path', DI::l10n()->t('PHP executable path'), $phppath, DI::l10n()->t('Enter full path to php executable. You can leave this blank to continue the installation.')],
                        ]);
                        $phppath = "";
                }
 
-               $this->addCheck(L10n::t('Command line PHP') . ($passed ? " (<tt>$phppath</tt>)" : ""), $passed, false, $help);
+               $this->addCheck(DI::l10n()->t('Command line PHP') . ($passed ? " (<tt>$phppath</tt>)" : ""), $passed, false, $help);
 
                if ($passed) {
                        $cmd = "$phppath -v";
@@ -260,10 +260,10 @@ class Installer
                        list($result) = explode("\n", $result);
                        $help = "";
                        if (!$passed2) {
-                               $help .= L10n::t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . EOL;
-                               $help .= L10n::t('Found PHP version: ') . "<tt>$result</tt>";
+                               $help .= DI::l10n()->t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . EOL;
+                               $help .= DI::l10n()->t('Found PHP version: ') . "<tt>$result</tt>";
                        }
-                       $this->addCheck(L10n::t('PHP cli binary'), $passed2, true, $help);
+                       $this->addCheck(DI::l10n()->t('PHP cli binary'), $passed2, true, $help);
                } else {
                        // return if it was required
                        return !$required;
@@ -276,13 +276,13 @@ class Installer
                        $passed3 = $result == $str;
                        $help = "";
                        if (!$passed3) {
-                               $help .= L10n::t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . EOL;
-                               $help .= L10n::t('This is required for message delivery to work.');
+                               $help .= DI::l10n()->t('The command line version of PHP on your system does not have "register_argc_argv" enabled.') . EOL;
+                               $help .= DI::l10n()->t('This is required for message delivery to work.');
                        } else {
                                $this->phppath = $phppath;
                        }
 
-                       $this->addCheck(L10n::t('PHP register_argc_argv'), $passed3, true, $help);
+                       $this->addCheck(DI::l10n()->t('PHP register_argc_argv'), $passed3, true, $help);
                }
 
                // passed2 & passed3 are required if first check passed
@@ -314,11 +314,11 @@ class Installer
 
                // Get private key
                if (!$res) {
-                       $help .= L10n::t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
-                       $help .= L10n::t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
+                       $help .= DI::l10n()->t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
+                       $help .= DI::l10n()->t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
                        $status = false;
                }
-               $this->addCheck(L10n::t('Generate encryption keys'), $res, true, $help);
+               $this->addCheck(DI::l10n()->t('Generate encryption keys'), $res, true, $help);
 
                return $status;
        }
@@ -370,27 +370,27 @@ class Installer
                $status = true;
                if (function_exists('apache_get_modules')) {
                        if (!in_array('mod_rewrite', apache_get_modules())) {
-                               $help = L10n::t('Error: Apache webserver mod-rewrite module is required but not installed.');
+                               $help = DI::l10n()->t('Error: Apache webserver mod-rewrite module is required but not installed.');
                                $status = false;
                                $returnVal = false;
                        }
                }
-               $this->addCheck(L10n::t('Apache mod_rewrite module'), $status, true, $help);
+               $this->addCheck(DI::l10n()->t('Apache mod_rewrite module'), $status, true, $help);
 
                $help = '';
                $status = true;
                if (!function_exists('mysqli_connect') && !class_exists('pdo')) {
                        $status = false;
-                       $help = L10n::t('Error: PDO or MySQLi PHP module required but not installed.');
+                       $help = DI::l10n()->t('Error: PDO or MySQLi PHP module required but not installed.');
                        $returnVal = false;
                } else {
                        if (!function_exists('mysqli_connect') && class_exists('pdo') && !in_array('mysql', \PDO::getAvailableDrivers())) {
                                $status = false;
-                               $help = L10n::t('Error: The MySQL driver for PDO is not installed.');
+                               $help = DI::l10n()->t('Error: The MySQL driver for PDO is not installed.');
                                $returnVal = false;
                        }
                }
-               $this->addCheck(L10n::t('PDO or MySQLi PHP module'), $status, true, $help);
+               $this->addCheck(DI::l10n()->t('PDO or MySQLi PHP module'), $status, true, $help);
 
                // check for XML DOM Documents being able to be generated
                $help = '';
@@ -398,64 +398,64 @@ class Installer
                try {
                        new DOMDocument();
                } catch (Exception $e) {
-                       $help = L10n::t('Error, XML PHP module required but not installed.');
+                       $help = DI::l10n()->t('Error, XML PHP module required but not installed.');
                        $status = false;
                        $returnVal = false;
                }
-               $this->addCheck(L10n::t('XML PHP module'), $status, true, $help);
+               $this->addCheck(DI::l10n()->t('XML PHP module'), $status, true, $help);
 
                $status = $this->checkFunction('curl_init',
-                       L10n::t('libCurl PHP module'),
-                       L10n::t('Error: libCURL PHP module required but not installed.'),
+                       DI::l10n()->t('libCurl PHP module'),
+                       DI::l10n()->t('Error: libCURL PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('imagecreatefromjpeg',
-                       L10n::t('GD graphics PHP module'),
-                       L10n::t('Error: GD graphics PHP module with JPEG support required but not installed.'),
+                       DI::l10n()->t('GD graphics PHP module'),
+                       DI::l10n()->t('Error: GD graphics PHP module with JPEG support required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('openssl_public_encrypt',
-                       L10n::t('OpenSSL PHP module'),
-                       L10n::t('Error: openssl PHP module required but not installed.'),
+                       DI::l10n()->t('OpenSSL PHP module'),
+                       DI::l10n()->t('Error: openssl PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('mb_strlen',
-                       L10n::t('mb_string PHP module'),
-                       L10n::t('Error: mb_string PHP module required but not installed.'),
+                       DI::l10n()->t('mb_string PHP module'),
+                       DI::l10n()->t('Error: mb_string PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('iconv_strlen',
-                       L10n::t('iconv PHP module'),
-                       L10n::t('Error: iconv PHP module required but not installed.'),
+                       DI::l10n()->t('iconv PHP module'),
+                       DI::l10n()->t('Error: iconv PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('posix_kill',
-                       L10n::t('POSIX PHP module'),
-                       L10n::t('Error: POSIX PHP module required but not installed.'),
+                       DI::l10n()->t('POSIX PHP module'),
+                       DI::l10n()->t('Error: POSIX PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('json_encode',
-                       L10n::t('JSON PHP module'),
-                       L10n::t('Error: JSON PHP module required but not installed.'),
+                       DI::l10n()->t('JSON PHP module'),
+                       DI::l10n()->t('Error: JSON PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
 
                $status = $this->checkFunction('finfo_open',
-                       L10n::t('File Information PHP module'),
-                       L10n::t('Error: File Information PHP module required but not installed.'),
+                       DI::l10n()->t('File Information PHP module'),
+                       DI::l10n()->t('Error: File Information PHP module required but not installed.'),
                        true
                );
                $returnVal = $returnVal ? $status : false;
@@ -478,13 +478,13 @@ class Installer
                        (!file_exists('config/local.config.php') && !is_writable('.'))) {
 
                        $status = false;
-                       $help = L10n::t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . EOL;
-                       $help .= L10n::t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . EOL;
-                       $help .= L10n::t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . EOL;
-                       $help .= L10n::t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.') . EOL;
+                       $help = DI::l10n()->t('The web installer needs to be able to create a file called "local.config.php" in the "config" folder of your web server and it is unable to do so.') . EOL;
+                       $help .= DI::l10n()->t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.') . EOL;
+                       $help .= DI::l10n()->t('At the end of this procedure, we will give you a text to save in a file named local.config.php in your Friendica "config" folder.') . EOL;
+                       $help .= DI::l10n()->t('You can alternatively skip this procedure and perform a manual installation. Please see the file "INSTALL.txt" for instructions.') . EOL;
                }
 
-               $this->addCheck(L10n::t('config/local.config.php is writable'), $status, false, $help);
+               $this->addCheck(DI::l10n()->t('config/local.config.php is writable'), $status, false, $help);
 
                // Local INI File is not required
                return true;
@@ -504,13 +504,13 @@ class Installer
                if (!is_writable('view/smarty3')) {
 
                        $status = false;
-                       $help = L10n::t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') . EOL;
-                       $help .= L10n::t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.') . EOL;
-                       $help .= L10n::t("Please ensure that the user that your web server runs as \x28e.g. www-data\x29 has write access to this folder.") . EOL;
-                       $help .= L10n::t("Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files \x28.tpl\x29 that it contains.") . EOL;
+                       $help = DI::l10n()->t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') . EOL;
+                       $help .= DI::l10n()->t('In order to store these compiled templates, the web server needs to have write access to the directory view/smarty3/ under the Friendica top level folder.') . EOL;
+                       $help .= DI::l10n()->t("Please ensure that the user that your web server runs as \x28e.g. www-data\x29 has write access to this folder.") . EOL;
+                       $help .= DI::l10n()->t("Note: as a security measure, you should give the web server write access to view/smarty3/ only--not the template files \x28.tpl\x29 that it contains.") . EOL;
                }
 
-               $this->addCheck(L10n::t('view/smarty3 is writable'), $status, true, $help);
+               $this->addCheck(DI::l10n()->t('view/smarty3 is writable'), $status, true, $help);
 
                return $status;
        }
@@ -539,14 +539,14 @@ class Installer
 
                        if ($fetchResult->getReturnCode() != 204) {
                                $status = false;
-                               $help = L10n::t('Url rewrite in .htaccess is not working. Make sure you copied .htaccess-dist to .htaccess.');
+                               $help = DI::l10n()->t('Url rewrite in .htaccess is not working. Make sure you copied .htaccess-dist to .htaccess.');
                                $error_msg = [];
-                               $error_msg['head'] = L10n::t('Error message from Curl when fetching');
+                               $error_msg['head'] = DI::l10n()->t('Error message from Curl when fetching');
                                $error_msg['url'] = $fetchResult->getRedirectUrl();
                                $error_msg['msg'] = $fetchResult->getError();
                        }
 
-                       $this->addCheck(L10n::t('Url rewrite is working'), $status, true, $help, $error_msg);
+                       $this->addCheck(DI::l10n()->t('Url rewrite is working'), $status, true, $help, $error_msg);
                } else {
                        // cannot check modrewrite if libcurl is not installed
                        /// @TODO Maybe issue warning here?
@@ -575,11 +575,11 @@ class Installer
                        }
                }
                if (!$imagick) {
-                       $this->addCheck(L10n::t('ImageMagick PHP extension is not installed'), $imagick, false, "");
+                       $this->addCheck(DI::l10n()->t('ImageMagick PHP extension is not installed'), $imagick, false, "");
                } else {
-                       $this->addCheck(L10n::t('ImageMagick PHP extension is installed'), $imagick, false, "");
+                       $this->addCheck(DI::l10n()->t('ImageMagick PHP extension is installed'), $imagick, false, "");
                        if ($imagick) {
-                               $this->addCheck(L10n::t('ImageMagick supports GIF'), $gif, false, "");
+                               $this->addCheck(DI::l10n()->t('ImageMagick supports GIF'), $gif, false, "");
                        }
                }
 
@@ -601,12 +601,12 @@ class Installer
 
                if ($dba->isConnected()) {
                        if (DBStructure::existsTable('user')) {
-                               $this->addCheck(L10n::t('Database already in use.'), false, true, '');
+                               $this->addCheck(DI::l10n()->t('Database already in use.'), false, true, '');
 
                                return false;
                        }
                } else {
-                       $this->addCheck(L10n::t('Could not connect to database.'), false, true, '');
+                       $this->addCheck(DI::l10n()->t('Could not connect to database.'), false, true, '');
 
                        return false;
                }
index 2c8a9eef9cd0ef4d14c5013509655ffbe20de8cd..67c0e4774427adb7b82ea94dddda091e34bf1d3b 100644 (file)
@@ -43,9 +43,9 @@ class L10n
         * string interpolation (sprintf) with additional optional arguments.
         *
         * Usages:
-        * - L10n::t('This is an example')
-        * - L10n::t('URL %s returned no result', $url)
-        * - L10n::t('Current version: %s, new version: %s', $current_version, $new_version)
+        * - DI::l10n()->t('This is an example')
+        * - DI::l10n()->t('URL %s returned no result', $url)
+        * - DI::l10n()->t('Current version: %s, new version: %s', $current_version, $new_version)
         *
         * @param string $s
         * @param array  $vars Variables to interpolate in the translation string
index ea19d16d0e712398362b50de8c7a6f17ebfb2ee7..6868b4503cc4776474946cc1f72eb797dcb2be43 100644 (file)
@@ -217,9 +217,9 @@ class L10n
         * string interpolation (sprintf) with additional optional arguments.
         *
         * Usages:
-        * - L10n::t('This is an example')
-        * - L10n::t('URL %s returned no result', $url)
-        * - L10n::t('Current version: %s, new version: %s', $current_version, $new_version)
+        * - DI::l10n()->t('This is an example')
+        * - DI::l10n()->t('URL %s returned no result', $url)
+        * - DI::l10n()->t('Current version: %s, new version: %s', $current_version, $new_version)
         *
         * @param string $s
         * @param array  $vars Variables to interpolate in the translation string
index 3fe19d0dddfc0b84d8924d192c91932980a141d8..24ca0a797a38010fa2c1a8ef54063e3afae193f0 100644 (file)
@@ -191,7 +191,7 @@ class Update
                                        //send the administrator an e-mail
                                        self::updateFailed(
                                                $x,
-                                               L10n::t('Update %s failed. See error logs.', $x)
+                                               DI::l10n()->t('Update %s failed. See error logs.', $x)
                                        );
                                        Logger::error('Update function ERROR.', ['function' => $funcname, 'retval' => $retval]);
                                        DI::lock()->release('dbupdate_function');
@@ -305,7 +305,7 @@ class Update
                                                'uid' => $admin['uid'],
                                                'type' => SYSTEM_EMAIL,
                                                'to_email' => $admin['email'],
-                                               'subject'  => l10n::t('[Friendica Notify] Database update'),
+                                               'subject'  => DI::l10n()->t('[Friendica Notify] Database update'),
                                                'preamble' => $preamble,
                                                'body' => $preamble,
                                                'language' => $lang]
index a62ce43580eb60faea46a592f3f78b7479929e0f..d48d179fa6540e89a0134e383c46a980f0c9be8c 100644 (file)
@@ -104,13 +104,13 @@ class UserImport
 
                $account = json_decode(file_get_contents($file['tmp_name']), true);
                if ($account === null) {
-                       notice(L10n::t("Error decoding account file"));
+                       notice(DI::l10n()->t("Error decoding account file"));
                        return;
                }
 
 
                if (empty($account['version'])) {
-                       notice(L10n::t("Error! No version data in file! This is not a Friendica account file?"));
+                       notice(DI::l10n()->t("Error! No version data in file! This is not a Friendica account file?"));
                        return;
                }
 
@@ -118,7 +118,7 @@ class UserImport
                // check if username matches deleted account
                if (DBA::exists('user', ['nickname' => $account['user']['nickname']])
                        || DBA::exists('userd', ['username' => $account['user']['nickname']])) {
-                       notice(L10n::t("User '%s' already exists on this server!", $account['user']['nickname']));
+                       notice(DI::l10n()->t("User '%s' already exists on this server!", $account['user']['nickname']));
                        return;
                }
 
@@ -154,7 +154,7 @@ class UserImport
                $r = self::dbImportAssoc('user', $account['user']);
                if ($r === false) {
                        Logger::log("uimport:insert user : ERROR : " . DBA::errorMessage(), Logger::INFO);
-                       notice(L10n::t("User creation error"));
+                       notice(DI::l10n()->t("User creation error"));
                        return;
                }
                $newuid = self::lastInsertId();
@@ -172,7 +172,7 @@ class UserImport
                        $r = self::dbImportAssoc('profile', $profile);
                        if ($r === false) {
                                Logger::log("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . DBA::errorMessage(), Logger::INFO);
-                               info(L10n::t("User profile creation error"));
+                               info(DI::l10n()->t("User profile creation error"));
                                DBA::delete('user', ['uid' => $newuid]);
                                return;
                        }
@@ -281,7 +281,7 @@ class UserImport
                // send relocate messages
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid);
 
-               info(L10n::t("Done. You can now login with your username and password"));
+               info(DI::l10n()->t("Done. You can now login with your username and password"));
                DI::baseUrl()->redirect('login');
        }
 }
index 410c6b57bed1f665f59692da6376ce81d47fe175..4c56263ab0805e62418b2d0c5aeebeebcf7e9c9a 100644 (file)
@@ -45,7 +45,7 @@ class DBStructure
                );
 
                if (!DBA::isResult($tables)) {
-                       echo L10n::t('There are no tables on MyISAM.') . "\n";
+                       echo DI::l10n()->t('There are no tables on MyISAM.') . "\n";
                        return;
                }
 
@@ -69,10 +69,10 @@ class DBStructure
         */
        private static function printUpdateError($message)
        {
-               echo L10n::t("\nError %d occurred during database update:\n%s\n",
+               echo DI::l10n()->t("\nError %d occurred during database update:\n%s\n",
                        DBA::errorNo(), DBA::errorMessage());
 
-               return L10n::t('Errors encountered performing database changes: ') . $message . EOL;
+               return DI::l10n()->t('Errors encountered performing database changes: ') . $message . EOL;
        }
 
        public static function printStructure($basePath)
@@ -261,7 +261,7 @@ class DBStructure
        {
                if ($action && !$install) {
                        Config::set('system', 'maintenance', 1);
-                       Config::set('system', 'maintenance_reason', L10n::t('%s: Database update', DateTimeFormat::utcNow() . ' ' . date('e')));
+                       Config::set('system', 'maintenance_reason', DI::l10n()->t('%s: Database update', DateTimeFormat::utcNow() . ' ' . date('e')));
                }
 
                $errors = '';
@@ -522,7 +522,7 @@ class DBStructure
 
                                if ($action) {
                                        if (!$install) {
-                                               Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DateTimeFormat::utcNow() . ' ' . date('e'), $name));
+                                               Config::set('system', 'maintenance_reason', DI::l10n()->t('%s: updating %s table.', DateTimeFormat::utcNow() . ' ' . date('e'), $name));
                                        }
 
                                        // Ensure index conversion to unique removes duplicates
index 9c22ec5d78a38ac1c53653c3ec23b3e6cc3973f3..6a627e98b62e4673245b51e6887693d4497c5bd1 100644 (file)
@@ -27,7 +27,7 @@ class LegacyModule extends BaseModule
        public static function setModuleFile($file_path)
        {
                if (!is_readable($file_path)) {
-                       throw new \Exception(Core\L10n::t('Legacy module file not found: %s', $file_path));
+                       throw new \Exception(Core\DI::l10n()->t('Legacy module file not found: %s', $file_path));
                }
 
                self::$moduleName = basename($file_path, '.php');
index 01dc0d0126f8ddd56dc8e3a0fa7c70e2dfa5dcc9..d93b2469d1fab44b6f75cb1f5b019f1aecc859b5 100644 (file)
@@ -1207,7 +1207,7 @@ class Contact
                if (empty($contact['uid']) || ($contact['uid'] != $uid)) {
                        if ($uid == 0) {
                                $profile_link = self::magicLink($contact['url']);
-                               $menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]];
+                               $menu = ['profile' => [DI::l10n()->t('View Profile'), $profile_link, true]];
 
                                return $menu;
                        }
@@ -1269,30 +1269,30 @@ class Contact
                 */
                if (empty($contact['uid'])) {
                        $menu = [
-                               'profile' => [L10n::t('View Profile')  , $profile_link , true],
-                               'network' => [L10n::t('Network Posts') , $posts_link   , false],
-                               'edit'    => [L10n::t('View Contact')  , $contact_url  , false],
-                               'follow'  => [L10n::t('Connect/Follow'), $follow_link  , true],
-                               'unfollow'=> [L10n::t('UnFollow')      , $unfollow_link, true],
+                               'profile' => [DI::l10n()->t('View Profile')  , $profile_link , true],
+                               'network' => [DI::l10n()->t('Network Posts') , $posts_link   , false],
+                               'edit'    => [DI::l10n()->t('View Contact')  , $contact_url  , false],
+                               'follow'  => [DI::l10n()->t('Connect/Follow'), $follow_link  , true],
+                               'unfollow'=> [DI::l10n()->t('UnFollow')      , $unfollow_link, true],
                        ];
                } else {
                        $menu = [
-                               '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],
-                               'follow'  => [L10n::t('Connect/Follow'), $follow_link      , true],
-                               'unfollow'=> [L10n::t('UnFollow')      , $unfollow_link    , true],
+                               'status'  => [DI::l10n()->t('View Status')   , $status_link      , true],
+                               'profile' => [DI::l10n()->t('View Profile')  , $profile_link     , true],
+                               'photos'  => [DI::l10n()->t('View Photos')   , $photos_link      , true],
+                               'network' => [DI::l10n()->t('Network Posts') , $posts_link       , false],
+                               'edit'    => [DI::l10n()->t('View Contact')  , $contact_url      , false],
+                               'drop'    => [DI::l10n()->t('Drop Contact')  , $contact_drop_link, false],
+                               'pm'      => [DI::l10n()->t('Send PM')       , $pm_url           , false],
+                               'poke'    => [DI::l10n()->t('Poke')          , $poke_link        , false],
+                               'follow'  => [DI::l10n()->t('Connect/Follow'), $follow_link      , true],
+                               'unfollow'=> [DI::l10n()->t('UnFollow')      , $unfollow_link    , true],
                        ];
 
                        if (!empty($contact['pending'])) {
                                $intro = DBA::selectFirst('intro', ['id'], ['contact-id' => $contact['id']]);
                                if (DBA::isResult($intro)) {
-                                       $menu['follow'] = [L10n::t('Approve'), 'notifications/intros/' . $intro['id'], true];
+                                       $menu['follow'] = [DI::l10n()->t('Approve'), 'notifications/intros/' . $intro['id'], true];
                                }
                        }
                }
@@ -1851,15 +1851,15 @@ class Contact
 
                switch ($type) {
                        case self::TYPE_ORGANISATION:
-                               $account_type = L10n::t("Organisation");
+                               $account_type = DI::l10n()->t("Organisation");
                                break;
 
                        case self::TYPE_NEWS:
-                               $account_type = L10n::t('News');
+                               $account_type = DI::l10n()->t('News');
                                break;
 
                        case self::TYPE_COMMUNITY:
-                               $account_type = L10n::t("Forum");
+                               $account_type = DI::l10n()->t("Forum");
                                break;
 
                        default:
@@ -2264,17 +2264,17 @@ class Contact
                $url = str_replace('/#!/', '/', $url);
 
                if (!Network::isUrlAllowed($url)) {
-                       $result['message'] = L10n::t('Disallowed profile URL.');
+                       $result['message'] = DI::l10n()->t('Disallowed profile URL.');
                        return $result;
                }
 
                if (Network::isUrlBlocked($url)) {
-                       $result['message'] = L10n::t('Blocked domain');
+                       $result['message'] = DI::l10n()->t('Blocked domain');
                        return $result;
                }
 
                if (!$url) {
-                       $result['message'] = L10n::t('Connect URL missing.');
+                       $result['message'] = DI::l10n()->t('Connect URL missing.');
                        return $result;
                }
 
@@ -2283,7 +2283,7 @@ class Contact
                Hook::callAll('follow', $arr);
 
                if (empty($arr)) {
-                       $result['message'] = L10n::t('The contact could not be added. Please check the relevant network credentials in your Settings -> Social Networks page.');
+                       $result['message'] = DI::l10n()->t('The contact could not be added. Please check the relevant network credentials in your Settings -> Social Networks page.');
                        return $result;
                }
 
@@ -2324,8 +2324,8 @@ class Contact
                                // NOTREACHED
                        }
                } elseif (Config::get('system', 'dfrn_only') && ($ret['network'] != Protocol::DFRN)) {
-                       $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;
+                       $result['message'] = DI::l10n()->t('This site is not configured to allow communications with other networks.') . EOL;
+                       $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL;
                        return $result;
                }
 
@@ -2336,30 +2336,30 @@ class Contact
 
                // do we have enough information?
                if (empty($ret['name']) || empty($ret['poll']) || (empty($ret['url']) && empty($ret['addr']))) {
-                       $result['message'] .= L10n::t('The profile address specified does not provide adequate information.') . EOL;
+                       $result['message'] .= DI::l10n()->t('The profile address specified does not provide adequate information.') . EOL;
                        if (empty($ret['poll'])) {
-                               $result['message'] .= L10n::t('No compatible communication protocols or feeds were discovered.') . EOL;
+                               $result['message'] .= DI::l10n()->t('No compatible communication protocols or feeds were discovered.') . EOL;
                        }
                        if (empty($ret['name'])) {
-                               $result['message'] .= L10n::t('An author or name was not found.') . EOL;
+                               $result['message'] .= DI::l10n()->t('An author or name was not found.') . EOL;
                        }
                        if (empty($ret['url'])) {
-                               $result['message'] .= L10n::t('No browser URL could be matched to this address.') . EOL;
+                               $result['message'] .= DI::l10n()->t('No browser URL could be matched to this address.') . EOL;
                        }
                        if (strpos($url, '@') !== false) {
-                               $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;
+                               $result['message'] .= DI::l10n()->t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL;
+                               $result['message'] .= DI::l10n()->t('Use mailto: in front of address to force email check.') . EOL;
                        }
                        return $result;
                }
 
                if ($protocol === Protocol::OSTATUS && Config::get('system', 'ostatus_disabled')) {
-                       $result['message'] .= L10n::t('The profile address specified belongs to a network which has been disabled on this site.') . EOL;
+                       $result['message'] .= DI::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'] .= L10n::t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
+                       $result['message'] .= DI::l10n()->t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL;
                }
 
                $writeable = ((($protocol === Protocol::OSTATUS) && ($ret['notify'])) ? 1 : 0);
@@ -2420,7 +2420,7 @@ class Contact
 
                $contact = DBA::selectFirst('contact', [], ['url' => $ret['url'], 'network' => $ret['network'], 'uid' => $uid]);
                if (!DBA::isResult($contact)) {
-                       $result['message'] .= L10n::t('Unable to retrieve contact information.') . EOL;
+                       $result['message'] .= DI::l10n()->t('Unable to retrieve contact information.') . EOL;
                        return $result;
                }
 
@@ -2641,7 +2641,7 @@ class Contact
                                                'to_email'     => $user['email'],
                                                'uid'          => $user['uid'],
                                                'link'         => DI::baseUrl() . '/notifications/intro',
-                                               'source_name'  => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : L10n::t('[Name Withheld]')),
+                                               'source_name'  => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : DI::l10n()->t('[Name Withheld]')),
                                                'source_link'  => $contact_record['url'],
                                                'source_photo' => $contact_record['photo'],
                                                'verb'         => ($sharing ? Activity::FRIEND : Activity::FOLLOW),
index 4055ca63b45f12190168072b47539b7201c10316..6f309a3397594479075c49d13f30ee4ea05c25d2 100644 (file)
@@ -31,7 +31,7 @@ class Event
                        return '';
                }
 
-               $bd_format = L10n::t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8 AM.
+               $bd_format = DI::l10n()->t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8 AM.
 
                $event_start = L10n::getDay(
                        !empty($event['adjust']) ?
@@ -58,14 +58,14 @@ class Event
                                $o .= "<div>" . BBCode::convert(Strings::escapeHtml($event['desc']), false, $simple) . "</div>";
                        }
 
-                       $o .= "<h4>" . L10n::t('Starts:') . "</h4><p>" . $event_start . "</p>";
+                       $o .= "<h4>" . DI::l10n()->t('Starts:') . "</h4><p>" . $event_start . "</p>";
 
                        if (!$event['nofinish']) {
-                               $o .= "<h4>" . L10n::t('Finishes:') . "</h4><p>" . $event_end . "</p>";
+                               $o .= "<h4>" . DI::l10n()->t('Finishes:') . "</h4><p>" . $event_end . "</p>";
                        }
 
                        if (!empty($event['location'])) {
-                               $o .= "<h4>" . L10n::t('Location:') . "</h4><p>" . BBCode::convert(Strings::escapeHtml($event['location']), false, $simple) . "</p>";
+                               $o .= "<h4>" . DI::l10n()->t('Location:') . "</h4><p>" . BBCode::convert(Strings::escapeHtml($event['location']), false, $simple) . "</p>";
                        }
 
                        return $o;
@@ -75,13 +75,13 @@ class Event
 
                $o .= '<div class="summary event-summary">' . BBCode::convert(Strings::escapeHtml($event['summary']), false, $simple) . '</div>' . "\r\n";
 
-               $o .= '<div class="event-start"><span class="event-label">' . L10n::t('Starts:') . '</span>&nbsp;<span class="dtstart" title="'
+               $o .= '<div class="event-start"><span class="event-label">' . DI::l10n()->t('Starts:') . '</span>&nbsp;<span class="dtstart" title="'
                        . DateTimeFormat::utc($event['start'], (!empty($event['adjust']) ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s'))
                        . '" >' . $event_start
                        . '</span></div>' . "\r\n";
 
                if (!$event['nofinish']) {
-                       $o .= '<div class="event-end" ><span class="event-label">' . L10n::t('Finishes:') . '</span>&nbsp;<span class="dtend" title="'
+                       $o .= '<div class="event-end" ><span class="event-label">' . DI::l10n()->t('Finishes:') . '</span>&nbsp;<span class="dtend" title="'
                                . DateTimeFormat::utc($event['finish'], (!empty($event['adjust']) ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s'))
                                . '" >' . $event_end
                                . '</span></div>' . "\r\n";
@@ -92,7 +92,7 @@ class Event
                }
 
                if (!empty($event['location'])) {
-                       $o .= '<div class="event-location"><span class="event-label">' . L10n::t('Location:') . '</span>&nbsp;<span class="location">'
+                       $o .= '<div class="event-location"><span class="event-label">' . DI::l10n()->t('Location:') . '</span>&nbsp;<span class="location">'
                                . BBCode::convert(Strings::escapeHtml($event['location']), false, $simple)
                                . '</span></div>' . "\r\n";
 
@@ -382,59 +382,59 @@ class Event
 
                $i18n = [
                        "firstDay" => $firstDay,
-                       "allday"   => L10n::t("all-day"),
-
-                       "Sun" => L10n::t("Sun"),
-                       "Mon" => L10n::t("Mon"),
-                       "Tue" => L10n::t("Tue"),
-                       "Wed" => L10n::t("Wed"),
-                       "Thu" => L10n::t("Thu"),
-                       "Fri" => L10n::t("Fri"),
-                       "Sat" => L10n::t("Sat"),
-
-                       "Sunday"    => L10n::t("Sunday"),
-                       "Monday"    => L10n::t("Monday"),
-                       "Tuesday"   => L10n::t("Tuesday"),
-                       "Wednesday" => L10n::t("Wednesday"),
-                       "Thursday"  => L10n::t("Thursday"),
-                       "Friday"    => L10n::t("Friday"),
-                       "Saturday"  => L10n::t("Saturday"),
-
-                       "Jan" => L10n::t("Jan"),
-                       "Feb" => L10n::t("Feb"),
-                       "Mar" => L10n::t("Mar"),
-                       "Apr" => L10n::t("Apr"),
-                       "May" => L10n::t("May"),
-                       "Jun" => L10n::t("Jun"),
-                       "Jul" => L10n::t("Jul"),
-                       "Aug" => L10n::t("Aug"),
-                       "Sep" => L10n::t("Sept"),
-                       "Oct" => L10n::t("Oct"),
-                       "Nov" => L10n::t("Nov"),
-                       "Dec" => L10n::t("Dec"),
-
-                       "January"   => L10n::t("January"),
-                       "February"  => L10n::t("February"),
-                       "March"     => L10n::t("March"),
-                       "April"     => L10n::t("April"),
-                       "June"      => L10n::t("June"),
-                       "July"      => L10n::t("July"),
-                       "August"    => L10n::t("August"),
-                       "September" => L10n::t("September"),
-                       "October"   => L10n::t("October"),
-                       "November"  => L10n::t("November"),
-                       "December"  => L10n::t("December"),
-
-                       "today" => L10n::t("today"),
-                       "month" => L10n::t("month"),
-                       "week"  => L10n::t("week"),
-                       "day"   => L10n::t("day"),
-
-                       "noevent" => L10n::t("No events to display"),
-
-                       "dtstart_label"  => L10n::t("Starts:"),
-                       "dtend_label"    => L10n::t("Finishes:"),
-                       "location_label" => L10n::t("Location:")
+                       "allday"   => DI::l10n()->t("all-day"),
+
+                       "Sun" => DI::l10n()->t("Sun"),
+                       "Mon" => DI::l10n()->t("Mon"),
+                       "Tue" => DI::l10n()->t("Tue"),
+                       "Wed" => DI::l10n()->t("Wed"),
+                       "Thu" => DI::l10n()->t("Thu"),
+                       "Fri" => DI::l10n()->t("Fri"),
+                       "Sat" => DI::l10n()->t("Sat"),
+
+                       "Sunday"    => DI::l10n()->t("Sunday"),
+                       "Monday"    => DI::l10n()->t("Monday"),
+                       "Tuesday"   => DI::l10n()->t("Tuesday"),
+                       "Wednesday" => DI::l10n()->t("Wednesday"),
+                       "Thursday"  => DI::l10n()->t("Thursday"),
+                       "Friday"    => DI::l10n()->t("Friday"),
+                       "Saturday"  => DI::l10n()->t("Saturday"),
+
+                       "Jan" => DI::l10n()->t("Jan"),
+                       "Feb" => DI::l10n()->t("Feb"),
+                       "Mar" => DI::l10n()->t("Mar"),
+                       "Apr" => DI::l10n()->t("Apr"),
+                       "May" => DI::l10n()->t("May"),
+                       "Jun" => DI::l10n()->t("Jun"),
+                       "Jul" => DI::l10n()->t("Jul"),
+                       "Aug" => DI::l10n()->t("Aug"),
+                       "Sep" => DI::l10n()->t("Sept"),
+                       "Oct" => DI::l10n()->t("Oct"),
+                       "Nov" => DI::l10n()->t("Nov"),
+                       "Dec" => DI::l10n()->t("Dec"),
+
+                       "January"   => DI::l10n()->t("January"),
+                       "February"  => DI::l10n()->t("February"),
+                       "March"     => DI::l10n()->t("March"),
+                       "April"     => DI::l10n()->t("April"),
+                       "June"      => DI::l10n()->t("June"),
+                       "July"      => DI::l10n()->t("July"),
+                       "August"    => DI::l10n()->t("August"),
+                       "September" => DI::l10n()->t("September"),
+                       "October"   => DI::l10n()->t("October"),
+                       "November"  => DI::l10n()->t("November"),
+                       "December"  => DI::l10n()->t("December"),
+
+                       "today" => DI::l10n()->t("today"),
+                       "month" => DI::l10n()->t("month"),
+                       "week"  => DI::l10n()->t("week"),
+                       "day"   => DI::l10n()->t("day"),
+
+                       "noevent" => DI::l10n()->t("No events to display"),
+
+                       "dtstart_label"  => DI::l10n()->t("Starts:"),
+                       "dtend_label"    => DI::l10n()->t("Finishes:"),
+                       "location_label" => DI::l10n()->t("Location:")
                ];
 
                return $i18n;
@@ -558,7 +558,7 @@ class Event
                $event_list = [];
 
                $last_date = '';
-               $fmt = L10n::t('l, F j');
+               $fmt = DI::l10n()->t('l, F j');
                foreach ($event_result as $event) {
                        $item = Item::selectFirst(['plink', 'author-name', 'author-avatar', 'author-link'], ['id' => $event['itemid']]);
                        if (!DBA::isResult($item)) {
@@ -589,9 +589,9 @@ class Event
                        $copy = null;
                        $drop = null;
                        if (local_user() && local_user() == $event['uid'] && $event['type'] == 'event') {
-                               $edit = !$event['cid'] ? [DI::baseUrl() . '/events/event/' . $event['id'], L10n::t('Edit event')     , '', ''] : null;
-                               $copy = !$event['cid'] ? [DI::baseUrl() . '/events/copy/' . $event['id'] , L10n::t('Duplicate event'), '', ''] : null;
-                               $drop =                  [DI::baseUrl() . '/events/drop/' . $event['id'] , L10n::t('Delete event')   , '', ''];
+                               $edit = !$event['cid'] ? [DI::baseUrl() . '/events/event/' . $event['id'], DI::l10n()->t('Edit event')     , '', ''] : null;
+                               $copy = !$event['cid'] ? [DI::baseUrl() . '/events/copy/' . $event['id'] , DI::l10n()->t('Duplicate event'), '', ''] : null;
+                               $drop =                  [DI::baseUrl() . '/events/drop/' . $event['id'] , DI::l10n()->t('Delete event')   , '', ''];
                        }
 
                        $title = BBCode::convert(Strings::escapeHtml($event['summary']));
@@ -623,7 +623,7 @@ class Event
                                'is_first' => $is_first,
                                'item'     => $event,
                                'html'     => $html,
-                               'plink'    => [$event['plink'], L10n::t('link to source'), '', ''],
+                               'plink'    => [$event['plink'], DI::l10n()->t('link to source'), '', ''],
                        ];
                }
 
@@ -844,9 +844,9 @@ class Event
                $finish    = false;
 
                // Set the different time formats.
-               $dformat       = L10n::t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8:01 AM.
-               $dformat_short = L10n::t('D g:i A'); // Fri 8:01 AM.
-               $tformat       = L10n::t('g:i A'); // 8:01 AM.
+               $dformat       = DI::l10n()->t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8:01 AM.
+               $dformat_short = DI::l10n()->t('D g:i A'); // Fri 8:01 AM.
+               $tformat       = DI::l10n()->t('g:i A'); // 8:01 AM.
 
                // Convert the time to different formats.
                $dtstart_dt = L10n::getDay(
@@ -912,11 +912,11 @@ class Event
                $return = Renderer::replaceMacros($tpl, [
                        '$id'             => $item['event-id'],
                        '$title'          => BBCode::convert($item['event-summary']),
-                       '$dtstart_label'  => L10n::t('Starts:'),
+                       '$dtstart_label'  => DI::l10n()->t('Starts:'),
                        '$dtstart_title'  => $dtstart_title,
                        '$dtstart_dt'     => $dtstart_dt,
                        '$finish'         => $finish,
-                       '$dtend_label'    => L10n::t('Finishes:'),
+                       '$dtend_label'    => DI::l10n()->t('Finishes:'),
                        '$dtend_title'    => $dtend_title,
                        '$dtend_dt'       => $dtend_dt,
                        '$month_short'    => $month_short,
@@ -930,10 +930,10 @@ class Event
                        '$author_link'    => $profile_link,
                        '$author_avatar'  => $item['author-avatar'],
                        '$description'    => BBCode::convert($item['event-desc']),
-                       '$location_label' => L10n::t('Location:'),
-                       '$show_map_label' => L10n::t('Show map'),
-                       '$hide_map_label' => L10n::t('Hide map'),
-                       '$map_btn_label'  => L10n::t('Show map'),
+                       '$location_label' => DI::l10n()->t('Location:'),
+                       '$show_map_label' => DI::l10n()->t('Show map'),
+                       '$hide_map_label' => DI::l10n()->t('Hide map'),
+                       '$map_btn_label'  => DI::l10n()->t('Show map'),
                        '$location'       => $location
                ]);
 
@@ -1024,8 +1024,8 @@ class Event
                        'cid'     => $contact['id'],
                        'start'   => DateTimeFormat::utc($birthday),
                        'finish'  => DateTimeFormat::utc($birthday . ' + 1 day '),
-                       'summary' => L10n::t('%s\'s birthday', $contact['name']),
-                       'desc'    => L10n::t('Happy Birthday %s', ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'),
+                       'summary' => DI::l10n()->t('%s\'s birthday', $contact['name']),
+                       'desc'    => DI::l10n()->t('Happy Birthday %s', ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'),
                        'type'    => 'birthday',
                        'adjust'  => 0
                ];
index c7941db056412cafe05485257ef02aa98ba7baa3..662fdbdffb584708ddb25790043791f8e5cbb633 100644 (file)
@@ -262,7 +262,7 @@ class FileTag
                                DI::pConfig()->set($uid, 'system', 'filetags', $saved . '[' . self::encode($file) . ']');
                        }
 
-                       info(L10n::t('Item filed'));
+                       info(DI::l10n()->t('Item filed'));
                }
 
                return true;
index 3d075f12e92a59d4e8669500bd0186a3c2e428af..a810fff6707708ecbcc43f31cf6d3b54376258b4 100644 (file)
@@ -73,7 +73,7 @@ class Group
                                $group = DBA::selectFirst('group', ['deleted'], ['id' => $gid]);
                                if (DBA::isResult($group) && $group['deleted']) {
                                        DBA::update('group', ['deleted' => 0], ['id' => $gid]);
-                                       notice(L10n::t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
+                                       notice(DI::l10n()->t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
                                }
                                return true;
                        }
@@ -422,7 +422,7 @@ class Group
                Logger::info('Got groups', $display_groups);
 
                if ($label == '') {
-                       $label = L10n::t('Default privacy group for new contacts');
+                       $label = DI::l10n()->t('Default privacy group for new contacts');
                }
 
                $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('group_selection.tpl'), [
@@ -454,7 +454,7 @@ class Group
 
                $display_groups = [
                        [
-                               'text' => L10n::t('Everybody'),
+                               'text' => DI::l10n()->t('Everybody'),
                                'id' => 0,
                                'selected' => (($group_id === 'everyone') ? 'group-selected' : ''),
                                'href' => $every,
@@ -473,7 +473,7 @@ class Group
                        if ($editmode == 'full') {
                                $groupedit = [
                                        'href' => 'group/' . $group['id'],
-                                       'title' => L10n::t('edit'),
+                                       'title' => DI::l10n()->t('edit'),
                                ];
                        } else {
                                $groupedit = null;
@@ -498,17 +498,17 @@ class Group
 
                $tpl = Renderer::getMarkupTemplate('group_side.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$add' => L10n::t('add'),
-                       '$title' => L10n::t('Groups'),
+                       '$add' => DI::l10n()->t('add'),
+                       '$title' => DI::l10n()->t('Groups'),
                        '$groups' => $display_groups,
                        'newgroup' => $editmode == 'extended' || $editmode == 'full' ? 1 : '',
                        'grouppage' => 'group/',
-                       '$edittext' => L10n::t('Edit group'),
-                       '$ungrouped' => $every === 'contact' ? L10n::t('Contacts not in any group') : '',
+                       '$edittext' => DI::l10n()->t('Edit group'),
+                       '$ungrouped' => $every === 'contact' ? DI::l10n()->t('Contacts not in any group') : '',
                        '$ungrouped_selected' => (($group_id === 'none') ? 'group-selected' : ''),
-                       '$createtext' => L10n::t('Create a new group'),
-                       '$creategroup' => L10n::t('Group Name: '),
-                       '$editgroupstext' => L10n::t('Edit groups'),
+                       '$createtext' => DI::l10n()->t('Create a new group'),
+                       '$creategroup' => DI::l10n()->t('Group Name: '),
+                       '$editgroupstext' => DI::l10n()->t('Edit groups'),
                        '$form_security_token' => BaseModule::getFormSecurityToken('group_edit'),
                ]);
 
index 62d6620bc1be7fc7effe8b6ed9dfa3d86c4fd333..050e79de50eed567a5e496f508710dbe851fa4c2 100644 (file)
@@ -3388,16 +3388,16 @@ class Item
        public static function postType($item)
        {
                if (!empty($item['event-id'])) {
-                       return L10n::t('event');
+                       return DI::l10n()->t('event');
                } elseif (!empty($item['resource-id'])) {
-                       return L10n::t('photo');
+                       return DI::l10n()->t('photo');
                } elseif (!empty($item['verb']) && $item['verb'] !== Activity::POST) {
-                       return L10n::t('activity');
+                       return DI::l10n()->t('activity');
                } elseif ($item['id'] != $item['parent']) {
-                       return L10n::t('comment');
+                       return DI::l10n()->t('comment');
                }
 
-               return L10n::t('post');
+               return DI::l10n()->t('post');
        }
 
        /**
@@ -3520,7 +3520,7 @@ class Item
                $filter_reasons = [];
                if (!$is_preview && public_contact() != $item['author-id']) {
                        if (!empty($item['content-warning']) && (!local_user() || !DI::pConfig()->get(local_user(), 'system', 'disable_cw', false))) {
-                               $filter_reasons[] = L10n::t('Content warning: %s', $item['content-warning']);
+                               $filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']);
                        }
 
                        $hook_data = [
@@ -3580,7 +3580,7 @@ class Item
                                $as .= Renderer::replaceMacros(Renderer::getMarkupTemplate('video_top.tpl'), [
                                        '$video' => [
                                                'id'     => $id,
-                                               'title'  => L10n::t('View Video'),
+                                               'title'  => DI::l10n()->t('View Video'),
                                                'src'    => $the_url,
                                                'mime'   => $mime,
                                        ],
@@ -3597,7 +3597,7 @@ class Item
                        }
 
                        $title = Strings::escapeHtml(trim(($mtch[4] ?? '') ?: $mtch[1]));
-                       $title .= ' ' . $mtch[2] . ' ' . L10n::t('bytes');
+                       $title .= ' ' . $mtch[2] . ' ' . DI::l10n()->t('bytes');
 
                        $icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
                        $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
@@ -3644,20 +3644,20 @@ class Item
                        $ret = [
                                'href' => "display/" . $item['guid'],
                                'orig' => "display/" . $item['guid'],
-                               'title' => L10n::t('View on separate page'),
-                               'orig_title' => L10n::t('view on separate page'),
+                               'title' => DI::l10n()->t('View on separate page'),
+                               'orig_title' => DI::l10n()->t('view on separate page'),
                        ];
 
                        if (!empty($item['plink'])) {
                                $ret["href"] = DI::baseUrl()->remove($item['plink']);
-                               $ret["title"] = L10n::t('link to source');
+                               $ret["title"] = DI::l10n()->t('link to source');
                        }
 
                } elseif (!empty($item['plink']) && ($item['private'] != 1)) {
                        $ret = [
                                'href' => $item['plink'],
                                'orig' => $item['plink'],
-                               'title' => L10n::t('link to source'),
+                               'title' => DI::l10n()->t('link to source'),
                        ];
                } else {
                        $ret = [];
index 292d797b85415018b63535a8826da8f6595683ce..77bf39878a6d4e0f43c8e74df9e707f2f8294ab4 100644 (file)
@@ -112,7 +112,7 @@ class Mail
                }
 
                if (!strlen($subject)) {
-                       $subject = L10n::t('[no subject]');
+                       $subject = DI::l10n()->t('[no subject]');
                }
 
                $me = DBA::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
@@ -247,7 +247,7 @@ class Mail
                }
 
                if (!strlen($subject)) {
-                       $subject = L10n::t('[no subject]');
+                       $subject = DI::l10n()->t('[no subject]');
                }
 
                $guid = System::createUUID();
index b29ac65645739aa54e4c87be2c2460629fe0c8d0..461cddf2937f0016aff0d89ad7cbe6268de0b346 100644 (file)
@@ -551,7 +551,7 @@ class Photo
                                        GROUP BY `album` ORDER BY `created` DESC",
                                        intval($uid),
                                        DBA::escape("Contact Photos"),
-                                       DBA::escape(L10n::t("Contact Photos"))
+                                       DBA::escape(DI::l10n()->t("Contact Photos"))
                                );
                        } else {
                                // This query doesn't do the count and is much faster
@@ -560,7 +560,7 @@ class Photo
                                        WHERE `uid` = %d  AND `album` != '%s' AND `album` != '%s' $sql_extra",
                                        intval($uid),
                                        DBA::escape("Contact Photos"),
-                                       DBA::escape(L10n::t("Contact Photos"))
+                                       DBA::escape(DI::l10n()->t("Contact Photos"))
                                );
                        }
                        DI::cache()->set($key, $albums, Duration::DAY);
index b616337888590dfb101ad025ea01ca15e20149df..6699c828722bb487b50954732c6e6b22eee3abdc 100644 (file)
@@ -206,7 +206,7 @@ class Profile
                        DI::page()['aside'] .= Renderer::replaceMacros(
                                Renderer::getMarkupTemplate('profile_edlink.tpl'),
                                [
-                                       '$editprofile' => L10n::t('Edit profile'),
+                                       '$editprofile' => DI::l10n()->t('Edit profile'),
                                        '$profid' => $a->profile['id']
                                ]
                        );
@@ -391,15 +391,15 @@ class Profile
                // show edit profile to yourself
                if (!$is_contact && $local_user_is_self) {
                        if (Feature::isEnabled(local_user(), 'multi_profiles')) {
-                               $profile['edit'] = [DI::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
+                               $profile['edit'] = [DI::baseUrl() . '/profiles', DI::l10n()->t('Profiles'), '', DI::l10n()->t('Manage/edit profiles')];
                                $r = q(
                                        "SELECT * FROM `profile` WHERE `uid` = %d",
                                        local_user()
                                );
 
                                $profile['menu'] = [
-                                       'chg_photo' => L10n::t('Change profile photo'),
-                                       'cr_new' => L10n::t('Create New Profile'),
+                                       'chg_photo' => DI::l10n()->t('Change profile photo'),
+                                       'cr_new' => DI::l10n()->t('Create New Profile'),
                                        'entries' => [],
                                ];
 
@@ -408,18 +408,18 @@ class Profile
                                                $profile['menu']['entries'][] = [
                                                        'photo' => $rr['thumb'],
                                                        'id' => $rr['id'],
-                                                       'alt' => L10n::t('Profile Image'),
+                                                       'alt' => DI::l10n()->t('Profile Image'),
                                                        'profile_name' => $rr['profile-name'],
                                                        'isdefault' => $rr['is-default'],
-                                                       'visibile_to_everybody' => L10n::t('visible to everybody'),
-                                                       'edit_visibility' => L10n::t('Edit visibility'),
+                                                       'visibile_to_everybody' => DI::l10n()->t('visible to everybody'),
+                                                       'edit_visibility' => DI::l10n()->t('Edit visibility'),
                                                ];
                                        }
                                }
                        } else {
-                               $profile['edit'] = [DI::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
+                               $profile['edit'] = [DI::baseUrl() . '/profiles/' . $profile['id'], DI::l10n()->t('Edit profile'), '', DI::l10n()->t('Edit profile')];
                                $profile['menu'] = [
-                                       'chg_photo' => L10n::t('Change profile photo'),
+                                       'chg_photo' => DI::l10n()->t('Change profile photo'),
                                        'cr_new' => null,
                                        'entries' => [],
                                ];
@@ -436,14 +436,14 @@ class Profile
                        || !empty($profile['postal-code'])
                        || !empty($profile['country-name'])
                ) {
-                       $location = L10n::t('Location:');
+                       $location = DI::l10n()->t('Location:');
                }
 
-               $gender   = !empty($profile['gender'])   ? L10n::t('Gender:')   : false;
-               $marital  = !empty($profile['marital'])  ? L10n::t('Status:')   : false;
-               $homepage = !empty($profile['homepage']) ? L10n::t('Homepage:') : false;
-               $about    = !empty($profile['about'])    ? L10n::t('About:')    : false;
-               $xmpp     = !empty($profile['xmpp'])     ? L10n::t('XMPP:')     : false;
+               $gender   = !empty($profile['gender'])   ? DI::l10n()->t('Gender:')   : false;
+               $marital  = !empty($profile['marital'])  ? DI::l10n()->t('Status:')   : false;
+               $homepage = !empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false;
+               $about    = !empty($profile['about'])    ? DI::l10n()->t('About:')    : false;
+               $xmpp     = !empty($profile['xmpp'])     ? DI::l10n()->t('XMPP:')     : false;
 
                if ((!empty($profile['hidewall']) || $block) && !Session::isAuthenticated()) {
                        $location = $gender = $marital = $homepage = $about = false;
@@ -516,11 +516,11 @@ class Profile
                }
 
                if (isset($p['gender'])) {
-                       $p['gender'] = L10n::t($p['gender']);
+                       $p['gender'] = DI::l10n()->t($p['gender']);
                }
 
                if (isset($p['marital'])) {
-                       $p['marital'] = L10n::t($p['marital']);
+                       $p['marital'] = DI::l10n()->t($p['marital']);
                }
 
                if (isset($p['photo'])) {
@@ -533,13 +533,13 @@ class Profile
                $o .= Renderer::replaceMacros($tpl, [
                        '$profile' => $p,
                        '$xmpp' => $xmpp,
-                       '$follow' => L10n::t('Follow'),
+                       '$follow' => DI::l10n()->t('Follow'),
                        '$follow_link' => $follow_link,
-                       '$unfollow' => L10n::t('Unfollow'),
+                       '$unfollow' => DI::l10n()->t('Unfollow'),
                        '$unfollow_link' => $unfollow_link,
-                       '$subscribe_feed' => L10n::t('Atom feed'),
+                       '$subscribe_feed' => DI::l10n()->t('Atom feed'),
                        '$subscribe_feed_link' => $subscribe_feed_link,
-                       '$wallmessage' => L10n::t('Message'),
+                       '$wallmessage' => DI::l10n()->t('Message'),
                        '$wallmessage_link' => $wallmessage_link,
                        '$account_type' => $account_type,
                        '$location' => $location,
@@ -547,7 +547,7 @@ class Profile
                        '$marital' => $marital,
                        '$homepage' => $homepage,
                        '$about' => $about,
-                       '$network' => L10n::t('Network:'),
+                       '$network' => DI::l10n()->t('Network:'),
                        '$contacts' => $contact_count,
                        '$updated' => $updated,
                        '$diaspora' => $diaspora,
@@ -577,8 +577,8 @@ class Profile
                *                       return $o;
                */
 
-               $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
-               $bd_short = L10n::t('F d');
+               $bd_format = DI::l10n()->t('g A l F d'); // 8 AM Friday January 18
+               $bd_short = DI::l10n()->t('F d');
 
                $cachekey = 'get_birthdays:' . local_user();
                $r = DI::cache()->get($cachekey);
@@ -640,7 +640,7 @@ class Profile
 
                                        $rr['link'] = Contact::magicLink($rr['url']);
                                        $rr['title'] = $rr['name'];
-                                       $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
+                                       $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
                                        $rr['startime'] = null;
                                        $rr['today'] = $today;
                                }
@@ -650,8 +650,8 @@ class Profile
                return Renderer::replaceMacros($tpl, [
                        '$classtoday' => $classtoday,
                        '$count' => $total,
-                       '$event_reminders' => L10n::t('Birthday Reminders'),
-                       '$event_title' => L10n::t('Birthdays this week:'),
+                       '$event_reminders' => DI::l10n()->t('Birthday Reminders'),
+                       '$event_title' => DI::l10n()->t('Birthdays this week:'),
                        '$events' => $r,
                        '$lbr' => '{', // raw brackets mess up if/endif macro processing
                        '$rbr' => '}'
@@ -674,7 +674,7 @@ class Profile
                *                       return $o;
                */
 
-               $bd_format = L10n::t('g A l F d'); // 8 AM Friday January 18
+               $bd_format = DI::l10n()->t('g A l F d'); // 8 AM Friday January 18
                $classtoday = '';
 
                $condition = ["`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ?",
@@ -712,7 +712,7 @@ class Profile
 
                                $description = substr(strip_tags(BBCode::convert($rr['desc'])), 0, 32) . '... ';
                                if (!$description) {
-                                       $description = L10n::t('[No description]');
+                                       $description = DI::l10n()->t('[No description]');
                                }
 
                                $strt = DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC');
@@ -725,7 +725,7 @@ class Profile
 
                                $rr['title'] = $title;
                                $rr['description'] = $description;
-                               $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . L10n::t('[today]') : '');
+                               $rr['date'] = L10n::getDay(DateTimeFormat::convert($rr['start'], $rr['adjust'] ? $a->timezone : 'UTC', 'UTC', $bd_format)) . (($today) ? ' ' . DI::l10n()->t('[today]') : '');
                                $rr['startime'] = $strt;
                                $rr['today'] = $today;
 
@@ -738,8 +738,8 @@ class Profile
                return Renderer::replaceMacros($tpl, [
                        '$classtoday' => $classtoday,
                        '$count' => count($r),
-                       '$event_reminders' => L10n::t('Event Reminders'),
-                       '$event_title' => L10n::t('Upcoming events the next 7 days:'),
+                       '$event_reminders' => DI::l10n()->t('Event Reminders'),
+                       '$event_title' => DI::l10n()->t('Upcoming events the next 7 days:'),
                        '$events' => $r,
                ]);
        }
@@ -753,19 +753,19 @@ class Profile
 
                        $profile = [];
 
-                       $profile['fullname'] = [L10n::t('Full Name:'), $a->profile['name']];
+                       $profile['fullname'] = [DI::l10n()->t('Full Name:'), $a->profile['name']];
 
                        if (Feature::isEnabled($uid, 'profile_membersince')) {
-                               $profile['membersince'] = [L10n::t('Member since:'), DateTimeFormat::local($a->profile['register_date'])];
+                               $profile['membersince'] = [DI::l10n()->t('Member since:'), DateTimeFormat::local($a->profile['register_date'])];
                        }
 
                        if ($a->profile['gender']) {
-                               $profile['gender'] = [L10n::t('Gender:'), L10n::t($a->profile['gender'])];
+                               $profile['gender'] = [DI::l10n()->t('Gender:'), DI::l10n()->t($a->profile['gender'])];
                        }
 
                        if (!empty($a->profile['dob']) && $a->profile['dob'] > DBA::NULL_DATE) {
-                               $year_bd_format = L10n::t('j F, Y');
-                               $short_bd_format = L10n::t('j F');
+                               $year_bd_format = DI::l10n()->t('j F, Y');
+                               $short_bd_format = DI::l10n()->t('j F');
 
                                $val = L10n::getDay(
                                        intval($a->profile['dob']) ?
@@ -773,18 +773,18 @@ class Profile
                                                : DateTimeFormat::utc('2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format)
                                );
 
-                               $profile['birthday'] = [L10n::t('Birthday:'), $val];
+                               $profile['birthday'] = [DI::l10n()->t('Birthday:'), $val];
                        }
 
                        if (!empty($a->profile['dob'])
                                && $a->profile['dob'] > DBA::NULL_DATE
                                && $age = Temporal::getAgeByTimezone($a->profile['dob'], $a->profile['timezone'], '')
                        ) {
-                               $profile['age'] = [L10n::t('Age:'), $age];
+                               $profile['age'] = [DI::l10n()->t('Age:'), $age];
                        }
 
                        if ($a->profile['marital']) {
-                               $profile['marital'] = [L10n::t('Status:'), L10n::t($a->profile['marital'])];
+                               $profile['marital'] = [DI::l10n()->t('Status:'), DI::l10n()->t($a->profile['marital'])];
                        }
 
                        /// @TODO Maybe use x() here, plus below?
@@ -793,94 +793,94 @@ class Profile
                        }
 
                        if (strlen($a->profile['howlong']) && $a->profile['howlong'] > DBA::NULL_DATETIME) {
-                               $profile['howlong'] = Temporal::getRelativeDate($a->profile['howlong'], L10n::t('for %1$d %2$s'));
+                               $profile['howlong'] = Temporal::getRelativeDate($a->profile['howlong'], DI::l10n()->t('for %1$d %2$s'));
                        }
 
                        if ($a->profile['sexual']) {
-                               $profile['sexual'] = [L10n::t('Sexual Preference:'), L10n::t($a->profile['sexual'])];
+                               $profile['sexual'] = [DI::l10n()->t('Sexual Preference:'), DI::l10n()->t($a->profile['sexual'])];
                        }
 
                        if ($a->profile['homepage']) {
-                               $profile['homepage'] = [L10n::t('Homepage:'), HTML::toLink($a->profile['homepage'])];
+                               $profile['homepage'] = [DI::l10n()->t('Homepage:'), HTML::toLink($a->profile['homepage'])];
                        }
 
                        if ($a->profile['hometown']) {
-                               $profile['hometown'] = [L10n::t('Hometown:'), HTML::toLink($a->profile['hometown'])];
+                               $profile['hometown'] = [DI::l10n()->t('Hometown:'), HTML::toLink($a->profile['hometown'])];
                        }
 
                        if ($a->profile['pub_keywords']) {
-                               $profile['pub_keywords'] = [L10n::t('Tags:'), $a->profile['pub_keywords']];
+                               $profile['pub_keywords'] = [DI::l10n()->t('Tags:'), $a->profile['pub_keywords']];
                        }
 
                        if ($a->profile['politic']) {
-                               $profile['politic'] = [L10n::t('Political Views:'), $a->profile['politic']];
+                               $profile['politic'] = [DI::l10n()->t('Political Views:'), $a->profile['politic']];
                        }
 
                        if ($a->profile['religion']) {
-                               $profile['religion'] = [L10n::t('Religion:'), $a->profile['religion']];
+                               $profile['religion'] = [DI::l10n()->t('Religion:'), $a->profile['religion']];
                        }
 
                        if ($txt = BBCode::convert($a->profile['about'])) {
-                               $profile['about'] = [L10n::t('About:'), $txt];
+                               $profile['about'] = [DI::l10n()->t('About:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['interest'])) {
-                               $profile['interest'] = [L10n::t('Hobbies/Interests:'), $txt];
+                               $profile['interest'] = [DI::l10n()->t('Hobbies/Interests:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['likes'])) {
-                               $profile['likes'] = [L10n::t('Likes:'), $txt];
+                               $profile['likes'] = [DI::l10n()->t('Likes:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['dislikes'])) {
-                               $profile['dislikes'] = [L10n::t('Dislikes:'), $txt];
+                               $profile['dislikes'] = [DI::l10n()->t('Dislikes:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['contact'])) {
-                               $profile['contact'] = [L10n::t('Contact information and Social Networks:'), $txt];
+                               $profile['contact'] = [DI::l10n()->t('Contact information and Social Networks:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['music'])) {
-                               $profile['music'] = [L10n::t('Musical interests:'), $txt];
+                               $profile['music'] = [DI::l10n()->t('Musical interests:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['book'])) {
-                               $profile['book'] = [L10n::t('Books, literature:'), $txt];
+                               $profile['book'] = [DI::l10n()->t('Books, literature:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['tv'])) {
-                               $profile['tv'] = [L10n::t('Television:'), $txt];
+                               $profile['tv'] = [DI::l10n()->t('Television:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['film'])) {
-                               $profile['film'] = [L10n::t('Film/dance/culture/entertainment:'), $txt];
+                               $profile['film'] = [DI::l10n()->t('Film/dance/culture/entertainment:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['romance'])) {
-                               $profile['romance'] = [L10n::t('Love/Romance:'), $txt];
+                               $profile['romance'] = [DI::l10n()->t('Love/Romance:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['work'])) {
-                               $profile['work'] = [L10n::t('Work/employment:'), $txt];
+                               $profile['work'] = [DI::l10n()->t('Work/employment:'), $txt];
                        }
 
                        if ($txt = BBCode::convert($a->profile['education'])) {
-                               $profile['education'] = [L10n::t('School/education:'), $txt];
+                               $profile['education'] = [DI::l10n()->t('School/education:'), $txt];
                        }
 
                        //show subcribed forum if it is enabled in the usersettings
                        if (Feature::isEnabled($uid, 'forumlist_profile')) {
-                               $profile['forumlist'] = [L10n::t('Forums:'), ForumManager::profileAdvanced($uid)];
+                               $profile['forumlist'] = [DI::l10n()->t('Forums:'), ForumManager::profileAdvanced($uid)];
                        }
 
                        if ($a->profile['uid'] == local_user()) {
-                               $profile['edit'] = [DI::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
+                               $profile['edit'] = [DI::baseUrl() . '/profiles/' . $a->profile['id'], DI::l10n()->t('Edit profile'), '', DI::l10n()->t('Edit profile')];
                        }
 
                        return Renderer::replaceMacros($tpl, [
-                               '$title' => L10n::t('Profile'),
-                               '$basic' => L10n::t('Basic'),
-                               '$advanced' => L10n::t('Advanced'),
+                               '$title' => DI::l10n()->t('Profile'),
+                               '$basic' => DI::l10n()->t('Basic'),
+                               '$advanced' => DI::l10n()->t('Advanced'),
                                '$profile' => $profile
                        ]);
                }
@@ -906,34 +906,34 @@ class Profile
 
                $tabs = [
                        [
-                               'label' => L10n::t('Status'),
+                               'label' => DI::l10n()->t('Status'),
                                'url'   => $baseProfileUrl,
                                'sel'   => !$current ? 'active' : '',
-                               'title' => L10n::t('Status Messages and Posts'),
+                               'title' => DI::l10n()->t('Status Messages and Posts'),
                                'id'    => 'status-tab',
                                'accesskey' => 'm',
                        ],
                        [
-                               'label' => L10n::t('Profile'),
+                               'label' => DI::l10n()->t('Profile'),
                                'url'   => $baseProfileUrl . '/?tab=profile',
                                'sel'   => $current == 'profile' ? 'active' : '',
-                               'title' => L10n::t('Profile Details'),
+                               'title' => DI::l10n()->t('Profile Details'),
                                'id'    => 'profile-tab',
                                'accesskey' => 'r',
                        ],
                        [
-                               'label' => L10n::t('Photos'),
+                               'label' => DI::l10n()->t('Photos'),
                                'url'   => DI::baseUrl() . '/photos/' . $nickname,
                                'sel'   => $current == 'photos' ? 'active' : '',
-                               'title' => L10n::t('Photo Albums'),
+                               'title' => DI::l10n()->t('Photo Albums'),
                                'id'    => 'photo-tab',
                                'accesskey' => 'h',
                        ],
                        [
-                               'label' => L10n::t('Videos'),
+                               'label' => DI::l10n()->t('Videos'),
                                'url'   => DI::baseUrl() . '/videos/' . $nickname,
                                'sel'   => $current == 'videos' ? 'active' : '',
-                               'title' => L10n::t('Videos'),
+                               'title' => DI::l10n()->t('Videos'),
                                'id'    => 'video-tab',
                                'accesskey' => 'v',
                        ],
@@ -942,10 +942,10 @@ class Profile
                // the calendar link for the full featured events calendar
                if ($is_owner && $a->theme_events_in_profile) {
                        $tabs[] = [
-                               'label' => L10n::t('Events'),
+                               'label' => DI::l10n()->t('Events'),
                                'url'   => DI::baseUrl() . '/events',
                                'sel'   => $current == 'events' ? 'active' : '',
-                               'title' => L10n::t('Events and Calendar'),
+                               'title' => DI::l10n()->t('Events and Calendar'),
                                'id'    => 'events-tab',
                                'accesskey' => 'e',
                        ];
@@ -953,10 +953,10 @@ class Profile
                        // with the public events of the calendar owner
                } elseif (!$is_owner) {
                        $tabs[] = [
-                               'label' => L10n::t('Events'),
+                               'label' => DI::l10n()->t('Events'),
                                'url'   => DI::baseUrl() . '/cal/' . $nickname,
                                'sel'   => $current == 'cal' ? 'active' : '',
-                               'title' => L10n::t('Events and Calendar'),
+                               'title' => DI::l10n()->t('Events and Calendar'),
                                'id'    => 'events-tab',
                                'accesskey' => 'e',
                        ];
@@ -964,10 +964,10 @@ class Profile
 
                if ($is_owner) {
                        $tabs[] = [
-                               'label' => L10n::t('Personal Notes'),
+                               'label' => DI::l10n()->t('Personal Notes'),
                                'url'   => DI::baseUrl() . '/notes',
                                'sel'   => $current == 'notes' ? 'active' : '',
-                               'title' => L10n::t('Only You Can See This'),
+                               'title' => DI::l10n()->t('Only You Can See This'),
                                'id'    => 'notes-tab',
                                'accesskey' => 't',
                        ];
@@ -975,20 +975,20 @@ class Profile
 
                if (!empty($_SESSION['new_member']) && $is_owner) {
                        $tabs[] = [
-                               'label' => L10n::t('Tips for New Members'),
+                               'label' => DI::l10n()->t('Tips for New Members'),
                                'url'   => DI::baseUrl() . '/newmember',
                                'sel'   => false,
-                               'title' => L10n::t('Tips for New Members'),
+                               'title' => DI::l10n()->t('Tips for New Members'),
                                'id'    => 'newmember-tab',
                        ];
                }
 
                if ($is_owner || empty($a->profile['hide-friends'])) {
                        $tabs[] = [
-                               'label' => L10n::t('Contacts'),
+                               'label' => DI::l10n()->t('Contacts'),
                                'url'   => $baseProfileUrl . '/contacts',
                                'sel'   => $current == 'contacts' ? 'active' : '',
-                               'title' => L10n::t('Contacts'),
+                               'title' => DI::l10n()->t('Contacts'),
                                'id'    => 'viewcontacts-tab',
                                'accesskey' => 'k',
                        ];
@@ -1171,7 +1171,7 @@ class Profile
 
                $a->contact = $arr['visitor'];
 
-               info(L10n::t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
+               info(DI::l10n()->t('OpenWebAuth: %1$s welcomes %2$s', DI::baseUrl()->getHostname(), $visitor['name']));
 
                Logger::log('OpenWebAuth: auth success from ' . $visitor['addr'], Logger::DEBUG);
        }
index 53db364988eb50b5ee98c51d3e3db3d77468363c..ffee6ede2a1503b04398392f5001e5cb09b92f32 100644 (file)
@@ -354,7 +354,7 @@ class User
                        return $user['uid'];
                }
 
-               throw new Exception(L10n::t('Login failed'));
+               throw new Exception(DI::l10n()->t('Login failed'));
        }
 
        /**
@@ -386,7 +386,7 @@ class User
                                || !isset($user['password'])
                                || !isset($user['legacy_password'])
                        ) {
-                               throw new Exception(L10n::t('Not enough information to authenticate'));
+                               throw new Exception(DI::l10n()->t('Not enough information to authenticate'));
                        }
                } elseif (is_int($user_info) || is_string($user_info)) {
                        if (is_int($user_info)) {
@@ -412,7 +412,7 @@ class User
                        }
 
                        if (!DBA::isResult($user)) {
-                               throw new Exception(L10n::t('User not found'));
+                               throw new Exception(DI::l10n()->t('User not found'));
                        }
                }
 
@@ -480,7 +480,7 @@ class User
        public static function hashPassword($password)
        {
                if (!trim($password)) {
-                       throw new Exception(L10n::t('Password can\'t be empty'));
+                       throw new Exception(DI::l10n()->t('Password can\'t be empty'));
                }
 
                return password_hash($password, PASSWORD_DEFAULT);
@@ -499,17 +499,17 @@ class User
                $password = trim($password);
 
                if (empty($password)) {
-                       throw new Exception(L10n::t('Empty passwords are not allowed.'));
+                       throw new Exception(DI::l10n()->t('Empty passwords are not allowed.'));
                }
 
                if (!Config::get('system', 'disable_password_exposed', false) && self::isPasswordExposed($password)) {
-                       throw new Exception(L10n::t('The new password has been exposed in a public data dump, please choose another.'));
+                       throw new Exception(DI::l10n()->t('The new password has been exposed in a public data dump, please choose another.'));
                }
 
                $allowed_characters = '!"#$%&\'()*+,-./;<=>?@[\]^_`{|}~';
 
                if (!preg_match('/^[a-z0-9' . preg_quote($allowed_characters, '/') . ']+$/i', $password)) {
-                       throw new Exception(L10n::t('The password can\'t contain accentuated letters, white spaces or colons (:)'));
+                       throw new Exception(DI::l10n()->t('The password can\'t contain accentuated letters, white spaces or colons (:)'));
                }
 
                return self::updatePasswordHashed($uid, self::hashPassword($password));
@@ -608,18 +608,18 @@ class User
                $netpublish = $publish && Config::get('system', 'directory');
 
                if ($password1 != $confirm) {
-                       throw new Exception(L10n::t('Passwords do not match. Password unchanged.'));
+                       throw new Exception(DI::l10n()->t('Passwords do not match. Password unchanged.'));
                } elseif ($password1 != '') {
                        $password = $password1;
                }
 
                if ($using_invites) {
                        if (!$invite_id) {
-                               throw new Exception(L10n::t('An invitation is required.'));
+                               throw new Exception(DI::l10n()->t('An invitation is required.'));
                        }
 
                        if (!Register::existsByHash($invite_id)) {
-                               throw new Exception(L10n::t('Invitation could not be verified.'));
+                               throw new Exception(DI::l10n()->t('Invitation could not be verified.'));
                        }
                }
 
@@ -627,7 +627,7 @@ class User
                if (empty($username) || empty($email) || empty($nickname)) {
                        if ($openid_url) {
                                if (!Network::isUrlValid($openid_url)) {
-                                       throw new Exception(L10n::t('Invalid OpenID url'));
+                                       throw new Exception(DI::l10n()->t('Invalid OpenID url'));
                                }
                                $_SESSION['register'] = 1;
                                $_SESSION['openid'] = $openid_url;
@@ -640,13 +640,13 @@ class User
                                try {
                                        $authurl = $openid->authUrl();
                                } catch (Exception $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);
+                                       throw new Exception(DI::l10n()->t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . DI::l10n()->t('The error message was:') . $e->getMessage(), 0, $e);
                                }
                                System::externalRedirect($authurl);
                                // NOTREACHED
                        }
 
-                       throw new Exception(L10n::t('Please enter the required information.'));
+                       throw new Exception(DI::l10n()->t('Please enter the required information.'));
                }
 
                if (!Network::isUrlValid($openid_url)) {
@@ -660,7 +660,7 @@ class User
                $username_max_length = max(1, min(64, intval(Config::get('system', 'username_max_length', 48))));
 
                if ($username_min_length > $username_max_length) {
-                       Logger::log(L10n::t('system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values.', $username_min_length, $username_max_length), Logger::WARNING);
+                       Logger::log(DI::l10n()->t('system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values.', $username_min_length, $username_max_length), Logger::WARNING);
                        $tmp = $username_min_length;
                        $username_min_length = $username_max_length;
                        $username_max_length = $tmp;
@@ -679,23 +679,23 @@ class User
                if (!$loose_reg) {
                        $username = mb_convert_case($username, MB_CASE_TITLE, 'UTF-8');
                        if (strpos($username, ' ') === false) {
-                               throw new Exception(L10n::t("That doesn't appear to be your full (First Last) name."));
+                               throw new Exception(DI::l10n()->t("That doesn't appear to be your full (First Last) name."));
                        }
                }
 
                if (!Network::isEmailDomainAllowed($email)) {
-                       throw new Exception(L10n::t('Your email domain is not among those allowed on this site.'));
+                       throw new Exception(DI::l10n()->t('Your email domain is not among those allowed on this site.'));
                }
 
                if (!filter_var($email, FILTER_VALIDATE_EMAIL) || !Network::isEmailDomainValid($email)) {
-                       throw new Exception(L10n::t('Not a valid email address.'));
+                       throw new Exception(DI::l10n()->t('Not a valid email address.'));
                }
                if (self::isNicknameBlocked($nickname)) {
-                       throw new Exception(L10n::t('The nickname was blocked from registration by the nodes admin.'));
+                       throw new Exception(DI::l10n()->t('The nickname was blocked from registration by the nodes admin.'));
                }
 
                if (Config::get('system', 'block_extended_register', false) && DBA::exists('user', ['email' => $email])) {
-                       throw new Exception(L10n::t('Cannot use that email.'));
+                       throw new Exception(DI::l10n()->t('Cannot use that email.'));
                }
 
                // Disallow somebody creating an account using openid that uses the admin email address,
@@ -703,14 +703,14 @@ class User
                if (Config::get('config', 'admin_email') && strlen($openid_url)) {
                        $adminlist = explode(',', str_replace(' ', '', strtolower(Config::get('config', 'admin_email'))));
                        if (in_array(strtolower($email), $adminlist)) {
-                               throw new Exception(L10n::t('Cannot use that email.'));
+                               throw new Exception(DI::l10n()->t('Cannot use that email.'));
                        }
                }
 
                $nickname = $data['nickname'] = strtolower($nickname);
 
                if (!preg_match('/^[a-z0-9][a-z0-9\_]*$/', $nickname)) {
-                       throw new Exception(L10n::t('Your nickname can only contain a-z, 0-9 and _.'));
+                       throw new Exception(DI::l10n()->t('Your nickname can only contain a-z, 0-9 and _.'));
                }
 
                // Check existing and deleted accounts for this nickname.
@@ -718,7 +718,7 @@ class User
                        DBA::exists('user', ['nickname' => $nickname])
                        || DBA::exists('userd', ['username' => $nickname])
                ) {
-                       throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
+                       throw new Exception(DI::l10n()->t('Nickname is already registered. Please choose another.'));
                }
 
                $new_password = strlen($password) ? $password : User::generateNewPassword();
@@ -728,7 +728,7 @@ class User
 
                $keys = Crypto::newKeypair(4096);
                if ($keys === false) {
-                       throw new Exception(L10n::t('SERIOUS ERROR: Generation of security keys failed.'));
+                       throw new Exception(DI::l10n()->t('SERIOUS ERROR: Generation of security keys failed.'));
                }
 
                $prvkey = $keys['prvkey'];
@@ -762,11 +762,11 @@ class User
                        $uid = DBA::lastInsertId();
                        $user = DBA::selectFirst('user', [], ['uid' => $uid]);
                } else {
-                       throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
+                       throw new Exception(DI::l10n()->t('An error occurred during registration. Please try again.'));
                }
 
                if (!$uid) {
-                       throw new Exception(L10n::t('An error occurred during registration. Please try again.'));
+                       throw new Exception(DI::l10n()->t('An error occurred during registration. Please try again.'));
                }
 
                // if somebody clicked submit twice very quickly, they could end up with two accounts
@@ -775,7 +775,7 @@ class User
                if ($user_count > 1) {
                        DBA::delete('user', ['uid' => $uid]);
 
-                       throw new Exception(L10n::t('Nickname is already registered. Please choose another.'));
+                       throw new Exception(DI::l10n()->t('Nickname is already registered. Please choose another.'));
                }
 
                $insert_result = DBA::insert('profile', [
@@ -786,28 +786,28 @@ class User
                        'publish' => $publish,
                        'is-default' => 1,
                        'net-publish' => $netpublish,
-                       'profile-name' => L10n::t('default')
+                       'profile-name' => DI::l10n()->t('default')
                ]);
                if (!$insert_result) {
                        DBA::delete('user', ['uid' => $uid]);
 
-                       throw new Exception(L10n::t('An error occurred creating your default profile. Please try again.'));
+                       throw new Exception(DI::l10n()->t('An error occurred creating your default profile. Please try again.'));
                }
 
                // Create the self contact
                if (!Contact::createSelfFromUserId($uid)) {
                        DBA::delete('user', ['uid' => $uid]);
 
-                       throw new Exception(L10n::t('An error occurred creating your self contact. Please try again.'));
+                       throw new Exception(DI::l10n()->t('An error occurred creating your self contact. Please try again.'));
                }
 
                // Create a group with no members. This allows somebody to use it
                // right away as a default group for new contacts.
-               $def_gid = Group::create($uid, L10n::t('Friends'));
+               $def_gid = Group::create($uid, DI::l10n()->t('Friends'));
                if (!$def_gid) {
                        DBA::delete('user', ['uid' => $uid]);
 
-                       throw new Exception(L10n::t('An error occurred creating your default contact group. Please try again.'));
+                       throw new Exception(DI::l10n()->t('An error occurred creating your default contact group. Please try again.'));
                }
 
                $fields = ['def_gid' => $def_gid];
@@ -837,7 +837,7 @@ class User
 
                                $resource_id = Photo::newResource();
 
-                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, L10n::t('Profile Photos'), 4);
+                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 4);
 
                                if ($r === false) {
                                        $photo_failure = true;
@@ -845,7 +845,7 @@ class User
 
                                $Image->scaleDown(80);
 
-                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, L10n::t('Profile Photos'), 5);
+                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 5);
 
                                if ($r === false) {
                                        $photo_failure = true;
@@ -853,7 +853,7 @@ class User
 
                                $Image->scaleDown(48);
 
-                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, L10n::t('Profile Photos'), 6);
+                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 6);
 
                                if ($r === false) {
                                        $photo_failure = true;
@@ -883,7 +883,7 @@ class User
         */
        public static function sendRegisterPendingEmail($user, $sitename, $siteurl, $password)
        {
-               $body = Strings::deindent(L10n::t(
+               $body = Strings::deindent(DI::l10n()->t(
                        '
                        Dear %1$s,
                                Thank you for registering at %2$s. Your account is pending for approval by the administrator.
@@ -905,7 +905,7 @@ class User
                        'type'     => SYSTEM_EMAIL,
                        'uid'      => $user['uid'],
                        'to_email' => $user['email'],
-                       'subject'  => L10n::t('Registration at %s', $sitename),
+                       'subject'  => DI::l10n()->t('Registration at %s', $sitename),
                        'body'     => $body
                ]);
        }
@@ -973,7 +973,7 @@ class User
                        'language' => $user['language'],
                        'type'     => SYSTEM_EMAIL,
                        'to_email' => $user['email'],
-                       'subject'  => L10n::t('Registration details for %s', $sitename),
+                       'subject'  => DI::l10n()->t('Registration details for %s', $sitename),
                        'preamble' => $preamble,
                        'body'     => $body
                ]);
index bc1925717e0ebea858295d2efcb80f262bc6f203..878b7c3e5802abaaf42455234be8b641de2f18d2 100644 (file)
@@ -49,7 +49,7 @@ class Details extends BaseAdminModule
                        $addon = $a->argv[2];
                        $addon = Strings::sanitizeFilePathItem($addon);
                        if (!is_file("addon/$addon/$addon.php")) {
-                               notice(L10n::t('Addon not found.'));
+                               notice(DI::l10n()->t('Addon not found.'));
                                Addon::uninstall($addon);
                                DI::baseUrl()->redirect('admin/addons');
                        }
@@ -60,10 +60,10 @@ class Details extends BaseAdminModule
                                // Toggle addon status
                                if (Addon::isEnabled($addon)) {
                                        Addon::uninstall($addon);
-                                       info(L10n::t('Addon %s disabled.', $addon));
+                                       info(DI::l10n()->t('Addon %s disabled.', $addon));
                                } else {
                                        Addon::install($addon);
-                                       info(L10n::t('Addon %s enabled.', $addon));
+                                       info(DI::l10n()->t('Addon %s enabled.', $addon));
                                }
 
                                Addon::saveEnabledList();
@@ -74,10 +74,10 @@ class Details extends BaseAdminModule
                        // display addon details
                        if (Addon::isEnabled($addon)) {
                                $status = 'on';
-                               $action = L10n::t('Disable');
+                               $action = DI::l10n()->t('Disable');
                        } else {
                                $status = 'off';
-                               $action = L10n::t('Enable');
+                               $action = DI::l10n()->t('Enable');
                        }
 
                        $readme = null;
@@ -97,18 +97,18 @@ class Details extends BaseAdminModule
                        $t = Renderer::getMarkupTemplate('admin/addons/details.tpl');
 
                        return Renderer::replaceMacros($t, [
-                               '$title' => L10n::t('Administration'),
-                               '$page' => L10n::t('Addons'),
-                               '$toggle' => L10n::t('Toggle'),
-                               '$settings' => L10n::t('Settings'),
+                               '$title' => DI::l10n()->t('Administration'),
+                               '$page' => DI::l10n()->t('Addons'),
+                               '$toggle' => DI::l10n()->t('Toggle'),
+                               '$settings' => DI::l10n()->t('Settings'),
                                '$baseurl' => DI::baseUrl()->get(true),
 
                                '$addon' => $addon,
                                '$status' => $status,
                                '$action' => $action,
                                '$info' => Addon::getInfo($addon),
-                               '$str_author' => L10n::t('Author: '),
-                               '$str_maintainer' => L10n::t('Maintainer: '),
+                               '$str_author' => DI::l10n()->t('Author: '),
+                               '$str_maintainer' => DI::l10n()->t('Maintainer: '),
 
                                '$admin_form' => $admin_form,
                                '$function' => 'addons',
index 511cb44755ec0e607f365f299c23372068b5ff8a..48276aa5dd8c0e71d89446b30516a8bb72e76365 100644 (file)
@@ -28,11 +28,11 @@ class Index extends BaseAdminModule
                                        $addon = $_GET['addon'] ?? '';
                                        if (Addon::isEnabled($addon)) {
                                                Addon::uninstall($addon);
-                                               info(L10n::t('Addon %s disabled.', $addon));
+                                               info(DI::l10n()->t('Addon %s disabled.', $addon));
                                        } elseif (Addon::install($addon)) {
-                                               info(L10n::t('Addon %s enabled.', $addon));
+                                               info(DI::l10n()->t('Addon %s enabled.', $addon));
                                        } else {
-                                               info(L10n::t('Addon %s failed to install.', $addon));
+                                               info(DI::l10n()->t('Addon %s failed to install.', $addon));
                                        }
 
                                        break;
@@ -46,15 +46,15 @@ class Index extends BaseAdminModule
 
                $t = Renderer::getMarkupTemplate('admin/addons/index.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Addons'),
-                       '$submit' => L10n::t('Save Settings'),
-                       '$reload' => L10n::t('Reload active addons'),
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Addons'),
+                       '$submit' => DI::l10n()->t('Save Settings'),
+                       '$reload' => DI::l10n()->t('Reload active addons'),
                        '$baseurl' => DI::baseUrl()->get(true),
                        '$function' => 'addons',
                        '$addons' => $addons,
                        '$pcount' => count($addons),
-                       '$noplugshint' => L10n::t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
+                       '$noplugshint' => DI::l10n()->t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
                        '$form_security_token' => parent::getFormSecurityToken('admin_addons'),
                ]);
        }
index 7bcdef46879592c7727558602854588f1e6b7605..bb7868f956c97a65a11c8381fe5877898410984e 100644 (file)
@@ -26,9 +26,9 @@ class Contact extends BaseAdminModule
                        $contact_id = Model\Contact::getIdForURL($contact_url);
                        if ($contact_id) {
                                Model\Contact::block($contact_id, $block_reason);
-                               notice(L10n::t('The contact has been blocked from the node'));
+                               notice(DI::l10n()->t('The contact has been blocked from the node'));
                        } else {
-                               notice(L10n::t('Could not find any contact entry for this URL (%s)', $contact_url));
+                               notice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url));
                        }
                }
 
@@ -57,19 +57,19 @@ class Contact extends BaseAdminModule
                $t = Renderer::getMarkupTemplate('admin/blocklist/contact.tpl');
                $o = Renderer::replaceMacros($t, [
                        // strings //
-                       '$title'       => L10n::t('Administration'),
-                       '$page'        => L10n::t('Remote Contact Blocklist'),
-                       '$description' => L10n::t('This page allows you to prevent any message from a remote contact to reach your node.'),
-                       '$submit'      => L10n::t('Block Remote Contact'),
-                       '$select_all'  => L10n::t('select all'),
-                       '$select_none' => L10n::t('select none'),
-                       '$block'       => L10n::t('Block'),
-                       '$unblock'     => L10n::t('Unblock'),
-                       '$no_data'     => L10n::t('No remote contact is blocked from this node.'),
-
-                       '$h_contacts'  => L10n::t('Blocked Remote Contacts'),
-                       '$h_newblock'  => L10n::t('Block New Remote Contact'),
-                       '$th_contacts' => [L10n::t('Photo'), L10n::t('Name'), L10n::t('Reason')],
+                       '$title'       => DI::l10n()->t('Administration'),
+                       '$page'        => DI::l10n()->t('Remote Contact Blocklist'),
+                       '$description' => DI::l10n()->t('This page allows you to prevent any message from a remote contact to reach your node.'),
+                       '$submit'      => DI::l10n()->t('Block Remote Contact'),
+                       '$select_all'  => DI::l10n()->t('select all'),
+                       '$select_none' => DI::l10n()->t('select none'),
+                       '$block'       => DI::l10n()->t('Block'),
+                       '$unblock'     => DI::l10n()->t('Unblock'),
+                       '$no_data'     => DI::l10n()->t('No remote contact is blocked from this node.'),
+
+                       '$h_contacts'  => DI::l10n()->t('Blocked Remote Contacts'),
+                       '$h_newblock'  => DI::l10n()->t('Block New Remote Contact'),
+                       '$th_contacts' => [DI::l10n()->t('Photo'), DI::l10n()->t('Name'), DI::l10n()->t('Reason')],
 
                        '$form_security_token' => parent::getFormSecurityToken('admin_contactblock'),
 
@@ -79,8 +79,8 @@ class Contact extends BaseAdminModule
                        '$contacts'   => $contacts,
                        '$total_contacts' => L10n::tt('%s total blocked contact', '%s total blocked contacts', $total),
                        '$paginate'   => $pager->renderFull($total),
-                       '$contacturl' => ['contact_url', L10n::t('Profile URL'), '', L10n::t('URL of the remote contact to block.')],
-                       '$contact_block_reason' => ['contact_block_reason', L10n::t('Block Reason')],
+                       '$contacturl' => ['contact_url', DI::l10n()->t('Profile URL'), '', DI::l10n()->t('URL of the remote contact to block.')],
+                       '$contact_block_reason' => ['contact_block_reason', DI::l10n()->t('Block Reason')],
                ]);
                return $o;
        }
index 43c6543e46af1718090a5dac84dcfd73f2ea20fd..4ae395fc002cdbeb51e62ea22844a1878cc56e7a 100644 (file)
@@ -29,7 +29,7 @@ class Server extends BaseAdminModule
                                'reason' => Strings::escapeTags(trim($_POST['newentry_reason']))
                        ];
                        Config::set('system', 'blocklist', $blocklist);
-                       info(L10n::t('Server domain pattern added to blocklist.') . EOL);
+                       info(DI::l10n()->t('Server domain pattern added to blocklist.') . EOL);
                } else {
                        // Edit the entries from blocklist
                        $blocklist = [];
@@ -45,7 +45,7 @@ class Server extends BaseAdminModule
                                }
                        }
                        Config::set('system', 'blocklist', $blocklist);
-                       info(L10n::t('Site blocklist updated.') . EOL);
+                       info(DI::l10n()->t('Site blocklist updated.') . EOL);
                }
 
                DI::baseUrl()->redirect('admin/blocklist/server');
@@ -60,37 +60,37 @@ class Server extends BaseAdminModule
                if (is_array($blocklist)) {
                        foreach ($blocklist as $id => $b) {
                                $blocklistform[] = [
-                                       'domain' => ["domain[$id]", L10n::t('Blocked server domain pattern'), $b['domain'], '', 'required', '', ''],
-                                       'reason' => ["reason[$id]", L10n::t("Reason for the block"), $b['reason'], '', 'required', '', ''],
-                                       'delete' => ["delete[$id]", L10n::t("Delete server domain pattern") . ' (' . $b['domain'] . ')', false, L10n::t("Check to delete this entry from the blocklist")]
+                                       'domain' => ["domain[$id]", DI::l10n()->t('Blocked server domain pattern'), $b['domain'], '', 'required', '', ''],
+                                       'reason' => ["reason[$id]", DI::l10n()->t("Reason for the block"), $b['reason'], '', 'required', '', ''],
+                                       'delete' => ["delete[$id]", DI::l10n()->t("Delete server domain pattern") . ' (' . $b['domain'] . ')', false, DI::l10n()->t("Check to delete this entry from the blocklist")]
                                ];
                        }
                }
 
                $t = Renderer::getMarkupTemplate('admin/blocklist/server.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Server Domain Pattern Blocklist'),
-                       '$intro' => L10n::t('This page can be used to define a blacklist of server domain patterns from the federated network that are not allowed to interact with your node. For each domain pattern you should also provide the reason why you block it.'),
-                       '$public' => L10n::t('The list of blocked server domain patterns will be made publically available on the <a href="/friendica">/friendica</a> page so that your users and people investigating communication problems can find the reason easily.'),
-                       '$syntax' => L10n::t('<p>The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:</p>
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Server Domain Pattern Blocklist'),
+                       '$intro' => DI::l10n()->t('This page can be used to define a blacklist of server domain patterns from the federated network that are not allowed to interact with your node. For each domain pattern you should also provide the reason why you block it.'),
+                       '$public' => DI::l10n()->t('The list of blocked server domain patterns will be made publically available on the <a href="/friendica">/friendica</a> page so that your users and people investigating communication problems can find the reason easily.'),
+                       '$syntax' => DI::l10n()->t('<p>The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:</p>
 <ul>
        <li><code>*</code>: Any number of characters</li>
        <li><code>?</code>: Any single character</li>
        <li><code>[&lt;char1&gt;&lt;char2&gt;...]</code>: char1 or char2</li>
 </ul>'),
-                       '$addtitle' => L10n::t('Add new entry to block list'),
-                       '$newdomain' => ['newentry_domain', L10n::t('Server Domain Pattern'), '', L10n::t('The domain pattern of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''],
-                       '$newreason' => ['newentry_reason', L10n::t('Block reason'), '', L10n::t('The reason why you blocked this server domain pattern.'), 'required', '', ''],
-                       '$submit' => L10n::t('Add Entry'),
-                       '$savechanges' => L10n::t('Save changes to the blocklist'),
-                       '$currenttitle' => L10n::t('Current Entries in the Blocklist'),
-                       '$thurl' => L10n::t('Blocked server domain pattern'),
-                       '$threason' => L10n::t('Reason for the block'),
-                       '$delentry' => L10n::t('Delete entry from blocklist'),
+                       '$addtitle' => DI::l10n()->t('Add new entry to block list'),
+                       '$newdomain' => ['newentry_domain', DI::l10n()->t('Server Domain Pattern'), '', DI::l10n()->t('The domain pattern of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''],
+                       '$newreason' => ['newentry_reason', DI::l10n()->t('Block reason'), '', DI::l10n()->t('The reason why you blocked this server domain pattern.'), 'required', '', ''],
+                       '$submit' => DI::l10n()->t('Add Entry'),
+                       '$savechanges' => DI::l10n()->t('Save changes to the blocklist'),
+                       '$currenttitle' => DI::l10n()->t('Current Entries in the Blocklist'),
+                       '$thurl' => DI::l10n()->t('Blocked server domain pattern'),
+                       '$threason' => DI::l10n()->t('Reason for the block'),
+                       '$delentry' => DI::l10n()->t('Delete entry from blocklist'),
                        '$entries' => $blocklistform,
                        '$baseurl' => DI::baseUrl()->get(true),
-                       '$confirm_delete' => L10n::t('Delete entry from blocklist?'),
+                       '$confirm_delete' => DI::l10n()->t('Delete entry from blocklist?'),
                        '$form_security_token' => parent::getFormSecurityToken("admin_blocklist")
                ]);
        }
index a0e70737e5981bfbf24203ab48eee52d973175f4..4368e6eed564e85c1534311806bc88f2c0e0e6a1 100644 (file)
@@ -30,7 +30,7 @@ class DBSync extends BaseAdminModule
                                if (intval($curr) == $update) {
                                        Config::set('system', 'build', intval($curr) + 1);
                                }
-                               info(L10n::t('Update has been marked successful') . EOL);
+                               info(DI::l10n()->t('Update has been marked successful') . EOL);
                        }
                        DI::baseUrl()->redirect('admin/dbsync');
                }
@@ -40,11 +40,11 @@ class DBSync extends BaseAdminModule
                                // @TODO Seems like a similar logic like Update::check()
                                $retval = DBStructure::update($a->getBasePath(), false, true);
                                if ($retval === '') {
-                                       $o .= L10n::t("Database structure update %s was successfully applied.", DB_UPDATE_VERSION) . "<br />";
+                                       $o .= DI::l10n()->t("Database structure update %s was successfully applied.", DB_UPDATE_VERSION) . "<br />";
                                        Config::set('database', 'last_successful_update', DB_UPDATE_VERSION);
                                        Config::set('database', 'last_successful_update_time', time());
                                } else {
-                                       $o .= L10n::t("Executing of database structure update %s failed with error: %s", DB_UPDATE_VERSION, $retval) . "<br />";
+                                       $o .= DI::l10n()->t("Executing of database structure update %s failed with error: %s", DB_UPDATE_VERSION, $retval) . "<br />";
                                }
                                if ($a->argv[2] === 'check') {
                                        return $o;
@@ -61,15 +61,15 @@ class DBSync extends BaseAdminModule
                                        $retval = $func();
 
                                        if ($retval === Update::FAILED) {
-                                               $o .= L10n::t("Executing %s failed with error: %s", $func, $retval);
+                                               $o .= DI::l10n()->t("Executing %s failed with error: %s", $func, $retval);
                                        } elseif ($retval === Update::SUCCESS) {
-                                               $o .= L10n::t('Update %s was successfully applied.', $func);
+                                               $o .= DI::l10n()->t('Update %s was successfully applied.', $func);
                                                Config::set('database', $func, 'success');
                                        } else {
-                                               $o .= L10n::t('Update %s did not return a status. Unknown if it succeeded.', $func);
+                                               $o .= DI::l10n()->t('Update %s did not return a status. Unknown if it succeeded.', $func);
                                        }
                                } else {
-                                       $o .= L10n::t('There was no additional update function %s that needed to be called.', $func) . "<br />";
+                                       $o .= DI::l10n()->t('There was no additional update function %s that needed to be called.', $func) . "<br />";
                                        Config::set('database', $func, 'success');
                                }
 
@@ -89,16 +89,16 @@ class DBSync extends BaseAdminModule
                if (!count($failed)) {
                        $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/structure_check.tpl'), [
                                '$base' => DI::baseUrl()->get(true),
-                               '$banner' => L10n::t('No failed updates.'),
-                               '$check' => L10n::t('Check database structure'),
+                               '$banner' => DI::l10n()->t('No failed updates.'),
+                               '$check' => DI::l10n()->t('Check database structure'),
                        ]);
                } else {
                        $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/failed_updates.tpl'), [
                                '$base' => DI::baseUrl()->get(true),
-                               '$banner' => L10n::t('Failed Updates'),
-                               '$desc' => L10n::t('This does not include updates prior to 1139, which did not return a status.'),
-                               '$mark' => L10n::t("Mark success \x28if update was manually applied\x29"),
-                               '$apply' => L10n::t('Attempt to execute this update step automatically'),
+                               '$banner' => DI::l10n()->t('Failed Updates'),
+                               '$desc' => DI::l10n()->t('This does not include updates prior to 1139, which did not return a status.'),
+                               '$mark' => DI::l10n()->t("Mark success \x28if update was manually applied\x29"),
+                               '$apply' => DI::l10n()->t('Attempt to execute this update step automatically'),
                                '$failed' => $failed
                        ]);
                }
index 7cc7932af8f0bc3af8e4bd9704a159c97ef08b0f..9171d70fe86b430b255c09a87a6c21f0e75289be 100644 (file)
@@ -56,8 +56,8 @@ class Features extends BaseAdminModule
                        foreach (array_slice($fdata, 1) as $f) {
                                $set = Config::get('feature', $f[0], $f[3]);
                                $arr[$fname][1][] = [
-                                       ['feature_' . $f[0], $f[1], $set, $f[2], [L10n::t('Off'), L10n::t('On')]],
-                                       ['featurelock_' . $f[0], L10n::t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [L10n::t('Off'), L10n::t('On')]]
+                                       ['feature_' . $f[0], $f[1], $set, $f[2], [DI::l10n()->t('Off'), DI::l10n()->t('On')]],
+                                       ['featurelock_' . $f[0], DI::l10n()->t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [DI::l10n()->t('Off'), DI::l10n()->t('On')]]
                                ];
                        }
                }
@@ -65,9 +65,9 @@ class Features extends BaseAdminModule
                $tpl = Renderer::getMarkupTemplate('admin/features.tpl');
                $o = Renderer::replaceMacros($tpl, [
                        '$form_security_token' => parent::getFormSecurityToken("admin_manage_features"),
-                       '$title' => L10n::t('Manage Additional Features'),
+                       '$title' => DI::l10n()->t('Manage Additional Features'),
                        '$features' => $arr,
-                       '$submit' => L10n::t('Save Settings'),
+                       '$submit' => DI::l10n()->t('Save Settings'),
                ]);
 
                return $o;
index db7781f0f66994f47432f6885cc08a054627d019..4d7407432222ce9d833b11a5f70ee3b7e7725074 100644 (file)
@@ -31,7 +31,7 @@ class Federation extends BaseAdminModule
                        'socialhome'  => ['name' => 'SocialHome', 'color' => '#52056b'], // lilac from the Django Image used at the Socialhome homepage
                        'wordpress'   => ['name' => 'WordPress', 'color' => '#016087'], // Background color of the homepage
                        'writefreely' => ['name' => 'WriteFreely', 'color' => '#292929'], // Font color of the homepage
-                       'other'       => ['name' => L10n::t('Other'), 'color' => '#F1007E'], // ActivityPub main color
+                       'other'       => ['name' => DI::l10n()->t('Other'), 'color' => '#F1007E'], // ActivityPub main color
                ];
 
                $platforms = array_keys($systems);
@@ -85,7 +85,7 @@ class Federation extends BaseAdminModule
                        if ($platform != $gserver['platform']) {
                                if ($platform == 'other') {
                                        $versionCounts = $counts[$platform][1] ?? [];
-                                       $versionCounts[] = ['version' => $gserver['platform'] ?: L10n::t('unknown'), 'total' => $gserver['total']];
+                                       $versionCounts[] = ['version' => $gserver['platform'] ?: DI::l10n()->t('unknown'), 'total' => $gserver['total']];
                                        $gserver['version'] = '';
                                } else {
                                        $versionCounts = array_merge($versionCounts, $counts[$platform][1] ?? []);
@@ -113,20 +113,20 @@ class Federation extends BaseAdminModule
                DBA::close($gserver);
 
                // some helpful text
-               $intro = L10n::t('This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.');
-               $hint = L10n::t('The <em>Auto Discovered Contact Directory</em> feature is not enabled, it will improve the data displayed here.');
+               $intro = DI::l10n()->t('This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.');
+               $hint = DI::l10n()->t('The <em>Auto Discovered Contact Directory</em> feature is not enabled, it will improve the data displayed here.');
 
                // load the template, replace the macros and return the page content
                $t = Renderer::getMarkupTemplate('admin/federation.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Federation Statistics'),
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Federation Statistics'),
                        '$intro' => $intro,
                        '$hint' => $hint,
                        '$autoactive' => Config::get('system', 'poco_completion'),
                        '$counts' => $counts,
                        '$version' => FRIENDICA_VERSION,
-                       '$legendtext' => L10n::t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users),
+                       '$legendtext' => DI::l10n()->t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users),
                ]);
        }
 
@@ -247,7 +247,7 @@ class Federation extends BaseAdminModule
                // to the version string for the displayed list.
                foreach ($versionCounts as $key => $value) {
                        if ($versionCounts[$key]['version'] == '') {
-                               $versionCounts[$key] = ['total' => $versionCounts[$key]['total'], 'version' => L10n::t('unknown')];
+                               $versionCounts[$key] = ['total' => $versionCounts[$key]['total'], 'version' => DI::l10n()->t('unknown')];
                        }
                }
 
index 744a57f07346da29e5611c4ed973c12ee7ab2deb..6ceb20c05ce5edc5bc1863e28081a6284476646c 100644 (file)
@@ -33,7 +33,7 @@ class Delete extends BaseAdminModule
                        Item::delete(['guid' => $guid]);
                }
 
-               info(L10n::t('Item marked for deletion.') . EOL);
+               info(DI::l10n()->t('Item marked for deletion.') . EOL);
                DI::baseUrl()->redirect('admin/item/delete');
        }
 
@@ -44,12 +44,12 @@ class Delete extends BaseAdminModule
                $t = Renderer::getMarkupTemplate('admin/item/delete.tpl');
 
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Delete Item'),
-                       '$submit' => L10n::t('Delete this Item'),
-                       '$intro1' => L10n::t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
-                       '$intro2' => L10n::t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
-                       '$deleteitemguid' => ['deleteitemguid', L10n::t("GUID"), '', L10n::t("The GUID of the item you want to delete."), 'required', 'autofocus'],
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Delete Item'),
+                       '$submit' => DI::l10n()->t('Delete this Item'),
+                       '$intro1' => DI::l10n()->t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
+                       '$intro2' => DI::l10n()->t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
+                       '$deleteitemguid' => ['deleteitemguid', DI::l10n()->t("GUID"), '', DI::l10n()->t("The GUID of the item you want to delete."), 'required', 'autofocus'],
                        '$form_security_token' => parent::getFormSecurityToken("admin_deleteitem")
                ]);
        }
index 610f61aec3a9437b82dfcf9446e21021b215cb5a..9bdcd9b7df4e8f8873cf2c3ef8df942a9526e532 100644 (file)
@@ -45,7 +45,7 @@ class Source extends BaseAdminModule
 
                $tpl = Renderer::getMarkupTemplate('admin/item/source.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$guid'          => ['guid', L10n::t('Item Guid'), $guid, ''],
+                       '$guid'          => ['guid', DI::l10n()->t('Item Guid'), $guid, ''],
                        '$source'        => $source,
                        '$item_uri'      => $item_uri,
                        '$item_id'       => $item_id,
index 21380af4a560d64a8384e7fbb1a07f9ebd5806b1..f04057a98fde301993e62baabcc612efd5c26ef9 100644 (file)
@@ -25,7 +25,7 @@ class Settings extends BaseAdminModule
 
                        if (is_file($logfile) &&
                        !is_writeable($logfile)) {
-                               notice(L10n::t('The logfile \'%s\' is not writable. No logging possible', $logfile));
+                               notice(DI::l10n()->t('The logfile \'%s\' is not writable. No logging possible', $logfile));
                                return;
                        }
 
@@ -34,7 +34,7 @@ class Settings extends BaseAdminModule
                        Config::set('system', 'loglevel', $loglevel);
                }
 
-               info(L10n::t("Log settings updated."));
+               info(DI::l10n()->t("Log settings updated."));
                DI::baseUrl()->redirect('admin/logs');
        }
 
@@ -51,27 +51,27 @@ class Settings extends BaseAdminModule
                ];
 
                if (ini_get('log_errors')) {
-                       $phplogenabled = L10n::t('PHP log currently enabled.');
+                       $phplogenabled = DI::l10n()->t('PHP log currently enabled.');
                } else {
-                       $phplogenabled = L10n::t('PHP log currently disabled.');
+                       $phplogenabled = DI::l10n()->t('PHP log currently disabled.');
                }
 
                $t = Renderer::getMarkupTemplate('admin/logs/settings.tpl');
 
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Logs'),
-                       '$submit' => L10n::t('Save Settings'),
-                       '$clear' => L10n::t('Clear'),
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Logs'),
+                       '$submit' => DI::l10n()->t('Save Settings'),
+                       '$clear' => DI::l10n()->t('Clear'),
                        '$baseurl' => DI::baseUrl()->get(true),
                        '$logname' => Config::get('system', 'logfile'),
                        // see /help/smarty3-templates#1_1 on any Friendica node
-                       '$debugging' => ['debugging', L10n::t("Enable Debugging"), Config::get('system', 'debugging'), ""],
-                       '$logfile' => ['logfile', L10n::t("Log file"), Config::get('system', 'logfile'), L10n::t("Must be writable by web server. Relative to your Friendica top-level directory.")],
-                       '$loglevel' => ['loglevel', L10n::t("Log level"), Config::get('system', 'loglevel'), "", $log_choices],
+                       '$debugging' => ['debugging', DI::l10n()->t("Enable Debugging"), Config::get('system', 'debugging'), ""],
+                       '$logfile' => ['logfile', DI::l10n()->t("Log file"), Config::get('system', 'logfile'), DI::l10n()->t("Must be writable by web server. Relative to your Friendica top-level directory.")],
+                       '$loglevel' => ['loglevel', DI::l10n()->t("Log level"), Config::get('system', 'loglevel'), "", $log_choices],
                        '$form_security_token' => parent::getFormSecurityToken("admin_logs"),
-                       '$phpheader' => L10n::t("PHP logging"),
-                       '$phphint' => L10n::t("To temporarily enable logging of PHP errors and warnings you can prepend the following to the index.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
+                       '$phpheader' => DI::l10n()->t("PHP logging"),
+                       '$phphint' => DI::l10n()->t("To temporarily enable logging of PHP errors and warnings you can prepend the following to the index.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
                        '$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE);\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
                        '$phplogenabled' => $phplogenabled,
                ]);
index 51e083473498cf5015c879372e3b21eeadbe209c..fe8bf614cfc4cac606f665eb469f763e271b46da 100644 (file)
@@ -19,11 +19,11 @@ class View extends BaseAdminModule
                $data = '';
 
                if (!file_exists($f)) {
-                       $data = L10n::t('Error trying to open <strong>%1$s</strong> log file.\r\n<br/>Check to see if file %1$s exist and is readable.', $f);
+                       $data = DI::l10n()->t('Error trying to open <strong>%1$s</strong> log file.\r\n<br/>Check to see if file %1$s exist and is readable.', $f);
                } else {
                        $fp = fopen($f, 'r');
                        if (!$fp) {
-                               $data = L10n::t('Couldn\'t open <strong>%1$s</strong> log file.\r\n<br/>Check to see if file %1$s is readable.', $f);
+                               $data = DI::l10n()->t('Couldn\'t open <strong>%1$s</strong> log file.\r\n<br/>Check to see if file %1$s is readable.', $f);
                        } else {
                                $fstat = fstat($fp);
                                $size = $fstat['size'];
@@ -43,8 +43,8 @@ class View extends BaseAdminModule
                        }
                }
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('View Logs'),
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('View Logs'),
                        '$data' => $data,
                        '$logname' => Config::get('system', 'logfile')
                ]);
index 0dfc553a91202252976659b81da4c9e1da6cdc85..c13edb3f3008930428f373803c0ea4e18380e79a 100644 (file)
@@ -32,12 +32,12 @@ class Queue extends BaseAdminModule
                // get jobs from the workerqueue table
                if ($deferred) {
                        $condition = ["NOT `done` AND `retrial` > ?", 0];
-                       $sub_title = L10n::t('Inspect Deferred Worker Queue');
-                       $info = L10n::t("This page lists the deferred worker jobs. This are jobs that couldn't be executed at the first time.");
+                       $sub_title = DI::l10n()->t('Inspect Deferred Worker Queue');
+                       $info = DI::l10n()->t("This page lists the deferred worker jobs. This are jobs that couldn't be executed at the first time.");
                } else {
                        $condition = ["NOT `done` AND `retrial` = ?", 0];
-                       $sub_title = L10n::t('Inspect Worker Queue');
-                       $info = L10n::t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.');
+                       $sub_title = DI::l10n()->t('Inspect Worker Queue');
+                       $info = DI::l10n()->t('This page lists the currently queued worker jobs. These jobs are handled by the worker cronjob you\'ve set up during install.');
                }
 
                // @TODO Move to Model\WorkerQueue::getEntries()
@@ -54,13 +54,13 @@ class Queue extends BaseAdminModule
 
                $t = Renderer::getMarkupTemplate('admin/queue.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
+                       '$title' => DI::l10n()->t('Administration'),
                        '$page' => $sub_title,
                        '$count' => count($r),
-                       '$id_header' => L10n::t('ID'),
-                       '$param_header' => L10n::t('Job Parameters'),
-                       '$created_header' => L10n::t('Created'),
-                       '$prio_header' => L10n::t('Priority'),
+                       '$id_header' => DI::l10n()->t('ID'),
+                       '$param_header' => DI::l10n()->t('Job Parameters'),
+                       '$created_header' => DI::l10n()->t('Created'),
+                       '$prio_header' => DI::l10n()->t('Priority'),
                        '$info' => $info,
                        '$entries' => $r,
                ]);
index 433cddf6f75018e1dce4b3f59a63af2d9c257de7..aab66a7221d71689cb485b4e039374496b751543 100644 (file)
@@ -48,7 +48,7 @@ class Site extends BaseAdminModule
 
                        $parsed = @parse_url($new_url);
                        if (!is_array($parsed) || empty($parsed['host']) || empty($parsed['scheme'])) {
-                               notice(L10n::t("Can not parse base url. Must have at least <scheme>://<domain>"));
+                               notice(DI::l10n()->t("Can not parse base url. Must have at least <scheme>://<domain>"));
                                DI::baseUrl()->redirect('admin/site');
                        }
 
@@ -229,7 +229,7 @@ class Site extends BaseAdminModule
                                DI::baseUrl()->redirect('admin/site' . $active_panel);
                        }
                } else {
-                       info(L10n::t('Invalid storage backend setting value.'));
+                       info(DI::l10n()->t('Invalid storage backend setting value.'));
                }
 
                // Has the directory url changed? If yes, then resubmit the existing profiles there
@@ -404,7 +404,7 @@ class Site extends BaseAdminModule
 
                Config::set('system', 'rino_encrypt'     , $rino);
 
-               info(L10n::t('Site settings updated.') . EOL);
+               info(DI::l10n()->t('Site settings updated.') . EOL);
 
                DI::baseUrl()->redirect('admin/site' . $active_panel);
        }
@@ -425,7 +425,7 @@ class Site extends BaseAdminModule
                /* Installed themes */
                $theme_choices = [];
                $theme_choices_mobile = [];
-               $theme_choices_mobile['---'] = L10n::t('No special theme for mobile devices');
+               $theme_choices_mobile['---'] = DI::l10n()->t('No special theme for mobile devices');
                $files = glob('view/theme/*');
                if (is_array($files)) {
                        $allowed_theme_list = Config::get('system', 'allowed_themes');
@@ -442,7 +442,7 @@ class Site extends BaseAdminModule
                                        continue;
                                }
 
-                               $theme_name = ((file_exists($file . '/experimental')) ? L10n::t('%s - (Experimental)', $f) : $f);
+                               $theme_name = ((file_exists($file . '/experimental')) ? DI::l10n()->t('%s - (Experimental)', $f) : $f);
 
                                if (file_exists($file . '/mobile')) {
                                        $theme_choices_mobile[$f] = $theme_name;
@@ -454,31 +454,31 @@ class Site extends BaseAdminModule
 
                /* Community page style */
                $community_page_style_choices = [
-                       CP_NO_INTERNAL_COMMUNITY => L10n::t('No community page for local users'),
-                       CP_NO_COMMUNITY_PAGE => L10n::t('No community page'),
-                       CP_USERS_ON_SERVER => L10n::t('Public postings from users of this site'),
-                       CP_GLOBAL_COMMUNITY => L10n::t('Public postings from the federated network'),
-                       CP_USERS_AND_GLOBAL => L10n::t('Public postings from local users and the federated network')
+                       CP_NO_INTERNAL_COMMUNITY => DI::l10n()->t('No community page for local users'),
+                       CP_NO_COMMUNITY_PAGE => DI::l10n()->t('No community page'),
+                       CP_USERS_ON_SERVER => DI::l10n()->t('Public postings from users of this site'),
+                       CP_GLOBAL_COMMUNITY => DI::l10n()->t('Public postings from the federated network'),
+                       CP_USERS_AND_GLOBAL => DI::l10n()->t('Public postings from local users and the federated network')
                ];
 
                $poco_discovery_choices = [
-                       PortableContact::DISABLED => L10n::t('Disabled'),
-                       PortableContact::USERS => L10n::t('Users'),
-                       PortableContact::USERS_GCONTACTS => L10n::t('Users, Global Contacts'),
-                       PortableContact::USERS_GCONTACTS_FALLBACK => L10n::t('Users, Global Contacts/fallback'),
+                       PortableContact::DISABLED => DI::l10n()->t('Disabled'),
+                       PortableContact::USERS => DI::l10n()->t('Users'),
+                       PortableContact::USERS_GCONTACTS => DI::l10n()->t('Users, Global Contacts'),
+                       PortableContact::USERS_GCONTACTS_FALLBACK => DI::l10n()->t('Users, Global Contacts/fallback'),
                ];
 
                $poco_discovery_since_choices = [
-                       '30' => L10n::t('One month'),
-                       '91' => L10n::t('Three months'),
-                       '182' => L10n::t('Half a year'),
-                       '365' => L10n::t('One year'),
+                       '30' => DI::l10n()->t('One month'),
+                       '91' => DI::l10n()->t('Three months'),
+                       '182' => DI::l10n()->t('Half a year'),
+                       '365' => DI::l10n()->t('One year'),
                ];
 
                /* get user names to make the install a personal install of X */
                // @TODO Move to Model\User::getNames()
                $user_names = [];
-               $user_names['---'] = L10n::t('Multi user instance');
+               $user_names['---'] = DI::l10n()->t('Multi user instance');
 
                $usersStmt = DBA::select('user', ['username', 'nickname'], ['account_removed' => 0, 'account_expired' => 0]);
                foreach (DBA::toArray($usersStmt) as $user) {
@@ -500,21 +500,21 @@ class Site extends BaseAdminModule
 
                /* Register policy */
                $register_choices = [
-                       Register::CLOSED => L10n::t('Closed'),
-                       Register::APPROVE => L10n::t('Requires approval'),
-                       Register::OPEN => L10n::t('Open')
+                       Register::CLOSED => DI::l10n()->t('Closed'),
+                       Register::APPROVE => DI::l10n()->t('Requires approval'),
+                       Register::OPEN => DI::l10n()->t('Open')
                ];
 
                $ssl_choices = [
-                       App\BaseURL::SSL_POLICY_NONE => L10n::t('No SSL policy, links will track page SSL state'),
-                       App\BaseURL::SSL_POLICY_FULL => L10n::t('Force all links to use SSL'),
-                       App\BaseURL::SSL_POLICY_SELFSIGN => L10n::t('Self-signed certificate, use SSL for local links only (discouraged)')
+                       App\BaseURL::SSL_POLICY_NONE => DI::l10n()->t('No SSL policy, links will track page SSL state'),
+                       App\BaseURL::SSL_POLICY_FULL => DI::l10n()->t('Force all links to use SSL'),
+                       App\BaseURL::SSL_POLICY_SELFSIGN => DI::l10n()->t('Self-signed certificate, use SSL for local links only (discouraged)')
                ];
 
                $check_git_version_choices = [
-                       'none' => L10n::t('Don\'t check'),
-                       'master' => L10n::t('check the stable version'),
-                       'develop' => L10n::t('check the development version')
+                       'none' => DI::l10n()->t('Don\'t check'),
+                       'master' => DI::l10n()->t('check the stable version'),
+                       'develop' => DI::l10n()->t('check the development version')
                ];
 
                $diaspora_able = (DI::baseUrl()->getUrlPath() == '');
@@ -531,7 +531,7 @@ class Site extends BaseAdminModule
                // show legacy option only if it is the current backend:
                // once changed can't be selected anymore
                if ($current_storage_backend == null) {
-                       $available_storage_backends[''] = L10n::t('Database (legacy)');
+                       $available_storage_backends[''] = DI::l10n()->t('Database (legacy)');
                }
 
                foreach (DI::storageManager()->listBackends() as $name => $class) {
@@ -554,121 +554,121 @@ class Site extends BaseAdminModule
 
                $t = Renderer::getMarkupTemplate('admin/site.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title'             => L10n::t('Administration'),
-                       '$page'              => L10n::t('Site'),
-                       '$submit'            => L10n::t('Save Settings'),
-                       '$republish'         => L10n::t('Republish users to directory'),
-                       '$registration'      => L10n::t('Registration'),
-                       '$upload'            => L10n::t('File upload'),
-                       '$corporate'         => L10n::t('Policies'),
-                       '$advanced'          => L10n::t('Advanced'),
-                       '$portable_contacts' => L10n::t('Auto Discovered Contact Directory'),
-                       '$performance'       => L10n::t('Performance'),
-                       '$worker_title'      => L10n::t('Worker'),
-                       '$relay_title'       => L10n::t('Message Relay'),
-                       '$relocate'          => L10n::t('Relocate Instance'),
-                       '$relocate_warning'  => L10n::t('Warning! Advanced function. Could make this server unreachable.'),
+                       '$title'             => DI::l10n()->t('Administration'),
+                       '$page'              => DI::l10n()->t('Site'),
+                       '$submit'            => DI::l10n()->t('Save Settings'),
+                       '$republish'         => DI::l10n()->t('Republish users to directory'),
+                       '$registration'      => DI::l10n()->t('Registration'),
+                       '$upload'            => DI::l10n()->t('File upload'),
+                       '$corporate'         => DI::l10n()->t('Policies'),
+                       '$advanced'          => DI::l10n()->t('Advanced'),
+                       '$portable_contacts' => DI::l10n()->t('Auto Discovered Contact Directory'),
+                       '$performance'       => DI::l10n()->t('Performance'),
+                       '$worker_title'      => DI::l10n()->t('Worker'),
+                       '$relay_title'       => DI::l10n()->t('Message Relay'),
+                       '$relocate'          => DI::l10n()->t('Relocate Instance'),
+                       '$relocate_warning'  => DI::l10n()->t('Warning! Advanced function. Could make this server unreachable.'),
                        '$baseurl'           => DI::baseUrl()->get(true),
 
                        // name, label, value, help string, extra data...
-                       '$sitename'         => ['sitename', L10n::t('Site name'), Config::get('config', 'sitename'), ''],
-                       '$sender_email'     => ['sender_email', L10n::t('Sender Email'), Config::get('config', 'sender_email'), L10n::t('The email address your server shall use to send notification emails from.'), '', '', 'email'],
-                       '$banner'           => ['banner', L10n::t('Banner/Logo'), $banner, ''],
-                       '$shortcut_icon'    => ['shortcut_icon', L10n::t('Shortcut icon'), Config::get('system', 'shortcut_icon'), L10n::t('Link to an icon that will be used for browsers.')],
-                       '$touch_icon'       => ['touch_icon', L10n::t('Touch icon'), Config::get('system', 'touch_icon'), L10n::t('Link to an icon that will be used for tablets and mobiles.')],
-                       '$additional_info'  => ['additional_info', L10n::t('Additional Info'), $additional_info, L10n::t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())],
-                       '$language'         => ['language', L10n::t('System language'), Config::get('system', 'language'), '', $lang_choices],
-                       '$theme'            => ['theme', L10n::t('System theme'), Config::get('system', 'theme'), L10n::t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices],
-                       '$theme_mobile'     => ['theme_mobile', L10n::t('Mobile system theme'), Config::get('system', 'mobile-theme', '---'), L10n::t('Theme for mobile devices'), $theme_choices_mobile],
-                       '$ssl_policy'       => ['ssl_policy', L10n::t('SSL link policy'), (string)intval(Config::get('system', 'ssl_policy')), L10n::t('Determines whether generated links should be forced to use SSL'), $ssl_choices],
-                       '$force_ssl'        => ['force_ssl', L10n::t('Force SSL'), Config::get('system', 'force_ssl'), L10n::t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')],
-                       '$hide_help'        => ['hide_help', L10n::t('Hide help entry from navigation menu'), Config::get('system', 'hide_help'), L10n::t('Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.')],
-                       '$singleuser'       => ['singleuser', L10n::t('Single user instance'), Config::get('system', 'singleuser', '---'), L10n::t('Make this instance multi-user or single-user for the named user'), $user_names],
-
-                       '$storagebackend'   => ['storagebackend', L10n::t('File storage backend'), $current_storage_backend, L10n::t('The backend used to store uploaded data. If you change the storage backend, you can manually move the existing files. If you do not do so, the files uploaded before the change will still be available at the old backend. Please see <a href="/help/Settings#1_2_3_1">the settings documentation</a> for more information about the choices and the moving procedure.'), $available_storage_backends],
+                       '$sitename'         => ['sitename', DI::l10n()->t('Site name'), Config::get('config', 'sitename'), ''],
+                       '$sender_email'     => ['sender_email', DI::l10n()->t('Sender Email'), Config::get('config', 'sender_email'), DI::l10n()->t('The email address your server shall use to send notification emails from.'), '', '', 'email'],
+                       '$banner'           => ['banner', DI::l10n()->t('Banner/Logo'), $banner, ''],
+                       '$shortcut_icon'    => ['shortcut_icon', DI::l10n()->t('Shortcut icon'), Config::get('system', 'shortcut_icon'), DI::l10n()->t('Link to an icon that will be used for browsers.')],
+                       '$touch_icon'       => ['touch_icon', DI::l10n()->t('Touch icon'), Config::get('system', 'touch_icon'), DI::l10n()->t('Link to an icon that will be used for tablets and mobiles.')],
+                       '$additional_info'  => ['additional_info', DI::l10n()->t('Additional Info'), $additional_info, DI::l10n()->t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())],
+                       '$language'         => ['language', DI::l10n()->t('System language'), Config::get('system', 'language'), '', $lang_choices],
+                       '$theme'            => ['theme', DI::l10n()->t('System theme'), Config::get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices],
+                       '$theme_mobile'     => ['theme_mobile', DI::l10n()->t('Mobile system theme'), Config::get('system', 'mobile-theme', '---'), DI::l10n()->t('Theme for mobile devices'), $theme_choices_mobile],
+                       '$ssl_policy'       => ['ssl_policy', DI::l10n()->t('SSL link policy'), (string)intval(Config::get('system', 'ssl_policy')), DI::l10n()->t('Determines whether generated links should be forced to use SSL'), $ssl_choices],
+                       '$force_ssl'        => ['force_ssl', DI::l10n()->t('Force SSL'), Config::get('system', 'force_ssl'), DI::l10n()->t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')],
+                       '$hide_help'        => ['hide_help', DI::l10n()->t('Hide help entry from navigation menu'), Config::get('system', 'hide_help'), DI::l10n()->t('Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.')],
+                       '$singleuser'       => ['singleuser', DI::l10n()->t('Single user instance'), Config::get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names],
+
+                       '$storagebackend'   => ['storagebackend', DI::l10n()->t('File storage backend'), $current_storage_backend, DI::l10n()->t('The backend used to store uploaded data. If you change the storage backend, you can manually move the existing files. If you do not do so, the files uploaded before the change will still be available at the old backend. Please see <a href="/help/Settings#1_2_3_1">the settings documentation</a> for more information about the choices and the moving procedure.'), $available_storage_backends],
                        '$storageform'      => $storage_form,
-                       '$maximagesize'     => ['maximagesize', L10n::t('Maximum image size'), Config::get('system', 'maximagesize'), L10n::t('Maximum size in bytes of uploaded images. Default is 0, which means no limits.')],
-                       '$maximagelength'   => ['maximagelength', L10n::t('Maximum image length'), Config::get('system', 'max_image_length'), L10n::t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')],
-                       '$jpegimagequality' => ['jpegimagequality', L10n::t('JPEG image quality'), Config::get('system', 'jpeg_quality'), L10n::t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')],
-
-                       '$register_policy'        => ['register_policy', L10n::t('Register policy'), Config::get('config', 'register_policy'), '', $register_choices],
-                       '$daily_registrations'    => ['max_daily_registrations', L10n::t('Maximum Daily Registrations'), Config::get('system', 'max_daily_registrations'), L10n::t('If registration is permitted above, this sets the maximum number of new user registrations to accept per day.  If register is set to closed, this setting has no effect.')],
-                       '$register_text'          => ['register_text', L10n::t('Register text'), Config::get('config', 'register_text'), L10n::t('Will be displayed prominently on the registration page. You can use BBCode here.')],
-                       '$forbidden_nicknames'    => ['forbidden_nicknames', L10n::t('Forbidden Nicknames'), Config::get('system', 'forbidden_nicknames'), L10n::t('Comma separated list of nicknames that are forbidden from registration. Preset is a list of role names according RFC 2142.')],
-                       '$abandon_days'           => ['abandon_days', L10n::t('Accounts abandoned after x days'), Config::get('system', 'account_abandon_days'), L10n::t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
-                       '$allowed_sites'          => ['allowed_sites', L10n::t('Allowed friend domains'), Config::get('system', 'allowed_sites'), L10n::t('Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains')],
-                       '$allowed_email'          => ['allowed_email', L10n::t('Allowed email domains'), Config::get('system', 'allowed_email'), L10n::t('Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains')],
-                       '$no_oembed_rich_content' => ['no_oembed_rich_content', L10n::t('No OEmbed rich content'), Config::get('system', 'no_oembed_rich_content'), L10n::t('Don\'t show the rich content (e.g. embedded PDF), except from the domains listed below.')],
-                       '$allowed_oembed'         => ['allowed_oembed', L10n::t('Allowed OEmbed domains'), Config::get('system', 'allowed_oembed'), L10n::t('Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.')],
-                       '$block_public'           => ['block_public', L10n::t('Block public'), Config::get('system', 'block_public'), L10n::t('Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.')],
-                       '$force_publish'          => ['publish_all', L10n::t('Force publish'), Config::get('system', 'publish_all'), L10n::t('Check to force all profiles on this site to be listed in the site directory.') . '<strong>' . L10n::t('Enabling this may violate privacy laws like the GDPR') . '</strong>'],
-                       '$global_directory'       => ['directory', L10n::t('Global directory URL'), Config::get('system', 'directory', 'https://dir.friendica.social'), L10n::t('URL to the global directory. If this is not set, the global directory is completely unavailable to the application.')],
-                       '$newuser_private'        => ['newuser_private', L10n::t('Private posts by default for new users'), Config::get('system', 'newuser_private'), L10n::t('Set default post permissions for all new members to the default privacy group rather than public.')],
-                       '$enotify_no_content'     => ['enotify_no_content', L10n::t('Don\'t include post content in email notifications'), Config::get('system', 'enotify_no_content'), L10n::t('Don\'t include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.')],
-                       '$private_addons'         => ['private_addons', L10n::t('Disallow public access to addons listed in the apps menu.'), Config::get('config', 'private_addons'), L10n::t('Checking this box will restrict addons listed in the apps menu to members only.')],
-                       '$disable_embedded'       => ['disable_embedded', L10n::t('Don\'t embed private images in posts'), Config::get('system', 'disable_embedded'), L10n::t('Don\'t replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.')],
-                       '$explicit_content'       => ['explicit_content', L10n::t('Explicit Content'), Config::get('system', 'explicit_content', false), L10n::t('Set this to announce that your node is used mostly for explicit content that might not be suited for minors. This information will be published in the node information and might be used, e.g. by the global directory, to filter your node from listings of nodes to join. Additionally a note about this will be shown at the user registration page.')],
-                       '$allow_users_remote_self'=> ['allow_users_remote_self', L10n::t('Allow Users to set remote_self'), Config::get('system', 'allow_users_remote_self'), L10n::t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
-                       '$no_multi_reg'           => ['no_multi_reg', L10n::t('Block multiple registrations'), Config::get('system', 'block_extended_register'), L10n::t('Disallow users to register additional accounts for use as pages.')],
-                       '$no_openid'              => ['no_openid', L10n::t('Disable OpenID'), Config::get('system', 'no_openid'), L10n::t('Disable OpenID support for registration and logins.')],
-                       '$no_regfullname'         => ['no_regfullname', L10n::t('No Fullname check'), Config::get('system', 'no_regfullname'), L10n::t('Allow users to register without a space between the first name and the last name in their full name.')],
-                       '$community_page_style'   => ['community_page_style', L10n::t('Community pages for visitors'), Config::get('system', 'community_page_style'), L10n::t('Which community pages should be available for visitors. Local users always see both pages.'), $community_page_style_choices],
-                       '$max_author_posts_community_page' => ['max_author_posts_community_page', L10n::t('Posts per user on community page'), Config::get('system', 'max_author_posts_community_page'), L10n::t('The maximum number of posts per user on the community page. (Not valid for "Global Community")')],
-                       '$ostatus_disabled'       => ['ostatus_disabled', L10n::t('Disable OStatus support'), Config::get('system', 'ostatus_disabled'), L10n::t('Disable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.')],
-                       '$ostatus_not_able'       => L10n::t('OStatus support can only be enabled if threading is enabled.'),
+                       '$maximagesize'     => ['maximagesize', DI::l10n()->t('Maximum image size'), Config::get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits.')],
+                       '$maximagelength'   => ['maximagelength', DI::l10n()->t('Maximum image length'), Config::get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')],
+                       '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), Config::get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')],
+
+                       '$register_policy'        => ['register_policy', DI::l10n()->t('Register policy'), Config::get('config', 'register_policy'), '', $register_choices],
+                       '$daily_registrations'    => ['max_daily_registrations', DI::l10n()->t('Maximum Daily Registrations'), Config::get('system', 'max_daily_registrations'), DI::l10n()->t('If registration is permitted above, this sets the maximum number of new user registrations to accept per day.  If register is set to closed, this setting has no effect.')],
+                       '$register_text'          => ['register_text', DI::l10n()->t('Register text'), Config::get('config', 'register_text'), DI::l10n()->t('Will be displayed prominently on the registration page. You can use BBCode here.')],
+                       '$forbidden_nicknames'    => ['forbidden_nicknames', DI::l10n()->t('Forbidden Nicknames'), Config::get('system', 'forbidden_nicknames'), DI::l10n()->t('Comma separated list of nicknames that are forbidden from registration. Preset is a list of role names according RFC 2142.')],
+                       '$abandon_days'           => ['abandon_days', DI::l10n()->t('Accounts abandoned after x days'), Config::get('system', 'account_abandon_days'), DI::l10n()->t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
+                       '$allowed_sites'          => ['allowed_sites', DI::l10n()->t('Allowed friend domains'), Config::get('system', 'allowed_sites'), DI::l10n()->t('Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains')],
+                       '$allowed_email'          => ['allowed_email', DI::l10n()->t('Allowed email domains'), Config::get('system', 'allowed_email'), DI::l10n()->t('Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains')],
+                       '$no_oembed_rich_content' => ['no_oembed_rich_content', DI::l10n()->t('No OEmbed rich content'), Config::get('system', 'no_oembed_rich_content'), DI::l10n()->t('Don\'t show the rich content (e.g. embedded PDF), except from the domains listed below.')],
+                       '$allowed_oembed'         => ['allowed_oembed', DI::l10n()->t('Allowed OEmbed domains'), Config::get('system', 'allowed_oembed'), DI::l10n()->t('Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.')],
+                       '$block_public'           => ['block_public', DI::l10n()->t('Block public'), Config::get('system', 'block_public'), DI::l10n()->t('Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.')],
+                       '$force_publish'          => ['publish_all', DI::l10n()->t('Force publish'), Config::get('system', 'publish_all'), DI::l10n()->t('Check to force all profiles on this site to be listed in the site directory.') . '<strong>' . DI::l10n()->t('Enabling this may violate privacy laws like the GDPR') . '</strong>'],
+                       '$global_directory'       => ['directory', DI::l10n()->t('Global directory URL'), Config::get('system', 'directory', 'https://dir.friendica.social'), DI::l10n()->t('URL to the global directory. If this is not set, the global directory is completely unavailable to the application.')],
+                       '$newuser_private'        => ['newuser_private', DI::l10n()->t('Private posts by default for new users'), Config::get('system', 'newuser_private'), DI::l10n()->t('Set default post permissions for all new members to the default privacy group rather than public.')],
+                       '$enotify_no_content'     => ['enotify_no_content', DI::l10n()->t('Don\'t include post content in email notifications'), Config::get('system', 'enotify_no_content'), DI::l10n()->t('Don\'t include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.')],
+                       '$private_addons'         => ['private_addons', DI::l10n()->t('Disallow public access to addons listed in the apps menu.'), Config::get('config', 'private_addons'), DI::l10n()->t('Checking this box will restrict addons listed in the apps menu to members only.')],
+                       '$disable_embedded'       => ['disable_embedded', DI::l10n()->t('Don\'t embed private images in posts'), Config::get('system', 'disable_embedded'), DI::l10n()->t('Don\'t replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.')],
+                       '$explicit_content'       => ['explicit_content', DI::l10n()->t('Explicit Content'), Config::get('system', 'explicit_content', false), DI::l10n()->t('Set this to announce that your node is used mostly for explicit content that might not be suited for minors. This information will be published in the node information and might be used, e.g. by the global directory, to filter your node from listings of nodes to join. Additionally a note about this will be shown at the user registration page.')],
+                       '$allow_users_remote_self'=> ['allow_users_remote_self', DI::l10n()->t('Allow Users to set remote_self'), Config::get('system', 'allow_users_remote_self'), DI::l10n()->t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
+                       '$no_multi_reg'           => ['no_multi_reg', DI::l10n()->t('Block multiple registrations'), Config::get('system', 'block_extended_register'), DI::l10n()->t('Disallow users to register additional accounts for use as pages.')],
+                       '$no_openid'              => ['no_openid', DI::l10n()->t('Disable OpenID'), Config::get('system', 'no_openid'), DI::l10n()->t('Disable OpenID support for registration and logins.')],
+                       '$no_regfullname'         => ['no_regfullname', DI::l10n()->t('No Fullname check'), Config::get('system', 'no_regfullname'), DI::l10n()->t('Allow users to register without a space between the first name and the last name in their full name.')],
+                       '$community_page_style'   => ['community_page_style', DI::l10n()->t('Community pages for visitors'), Config::get('system', 'community_page_style'), DI::l10n()->t('Which community pages should be available for visitors. Local users always see both pages.'), $community_page_style_choices],
+                       '$max_author_posts_community_page' => ['max_author_posts_community_page', DI::l10n()->t('Posts per user on community page'), Config::get('system', 'max_author_posts_community_page'), DI::l10n()->t('The maximum number of posts per user on the community page. (Not valid for "Global Community")')],
+                       '$ostatus_disabled'       => ['ostatus_disabled', DI::l10n()->t('Disable OStatus support'), Config::get('system', 'ostatus_disabled'), DI::l10n()->t('Disable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.')],
+                       '$ostatus_not_able'       => DI::l10n()->t('OStatus support can only be enabled if threading is enabled.'),
                        '$diaspora_able'          => $diaspora_able,
-                       '$diaspora_not_able'      => L10n::t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'),
-                       '$diaspora_enabled'       => ['diaspora_enabled', L10n::t('Enable Diaspora support'), Config::get('system', 'diaspora_enabled', $diaspora_able), L10n::t('Provide built-in Diaspora network compatibility.')],
-                       '$dfrn_only'              => ['dfrn_only', L10n::t('Only allow Friendica contacts'), Config::get('system', 'dfrn_only'), L10n::t('All contacts must use Friendica protocols. All other built-in communication protocols disabled.')],
-                       '$verifyssl'              => ['verifyssl', L10n::t('Verify SSL'), Config::get('system', 'verifyssl'), L10n::t('If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.')],
-                       '$proxyuser'              => ['proxyuser', L10n::t('Proxy user'), Config::get('system', 'proxyuser'), ''],
-                       '$proxy'                  => ['proxy', L10n::t('Proxy URL'), Config::get('system', 'proxy'), ''],
-                       '$timeout'                => ['timeout', L10n::t('Network timeout'), Config::get('system', 'curl_timeout', 60), L10n::t('Value is in seconds. Set to 0 for unlimited (not recommended).')],
-                       '$maxloadavg'             => ['maxloadavg', L10n::t('Maximum Load Average'), Config::get('system', 'maxloadavg', 20), L10n::t('Maximum system load before delivery and poll processes are deferred - default %d.', 20)],
-                       '$maxloadavg_frontend'    => ['maxloadavg_frontend', L10n::t('Maximum Load Average (Frontend)'), Config::get('system', 'maxloadavg_frontend', 50), L10n::t('Maximum system load before the frontend quits service - default 50.')],
-                       '$min_memory'             => ['min_memory', L10n::t('Minimal Memory'), Config::get('system', 'min_memory', 0), L10n::t('Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).')],
-                       '$optimize_max_tablesize' => ['optimize_max_tablesize', L10n::t('Maximum table size for optimization'), $optimize_max_tablesize, L10n::t('Maximum table size (in MB) for the automatic optimization. Enter -1 to disable it.')],
-                       '$optimize_fragmentation' => ['optimize_fragmentation', L10n::t('Minimum level of fragmentation'), Config::get('system', 'optimize_fragmentation', 30), L10n::t('Minimum fragmenation level to start the automatic optimization - default value is 30%.')],
-
-                       '$poco_completion'        => ['poco_completion', L10n::t('Periodical check of global contacts'), Config::get('system', 'poco_completion'), L10n::t('If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.')],
-                       '$poco_requery_days'      => ['poco_requery_days', L10n::t('Days between requery'), Config::get('system', 'poco_requery_days'), L10n::t('Number of days after which a server is requeried for his contacts.')],
-                       '$poco_discovery'         => ['poco_discovery', L10n::t('Discover contacts from other servers'), (string)intval(Config::get('system', 'poco_discovery')), L10n::t('Periodically query other servers for contacts. You can choose between "Users": the users on the remote system, "Global Contacts": active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren\'t available. The fallback increases the server load, so the recommended setting is "Users, Global Contacts".'), $poco_discovery_choices],
-                       '$poco_discovery_since'   => ['poco_discovery_since', L10n::t('Timeframe for fetching global contacts'), (string)intval(Config::get('system', 'poco_discovery_since')), L10n::t('When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers.'), $poco_discovery_since_choices],
-                       '$poco_local_search'      => ['poco_local_search', L10n::t('Search the local directory'), Config::get('system', 'poco_local_search'), L10n::t('Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.')],
-
-                       '$nodeinfo'               => ['nodeinfo', L10n::t('Publish server information'), Config::get('system', 'nodeinfo'), L10n::t('If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href="http://the-federation.info/">the-federation.info</a> for details.')],
-
-                       '$check_new_version_url'  => ['check_new_version_url', L10n::t('Check upstream version'), Config::get('system', 'check_new_version_url'), L10n::t('Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview.'), $check_git_version_choices],
-                       '$suppress_tags'          => ['suppress_tags', L10n::t('Suppress Tags'), Config::get('system', 'suppress_tags'), L10n::t('Suppress showing a list of hashtags at the end of the posting.')],
-                       '$dbclean'                => ['dbclean', L10n::t('Clean database'), Config::get('system', 'dbclean', false), L10n::t('Remove old remote items, orphaned database records and old content from some other helper tables.')],
-                       '$dbclean_expire_days'    => ['dbclean_expire_days', L10n::t('Lifespan of remote items'), Config::get('system', 'dbclean-expire-days', 0), L10n::t('When the database cleanup is enabled, this defines the days after which remote items will be deleted. Own items, and marked or filed items are always kept. 0 disables this behaviour.')],
-                       '$dbclean_unclaimed'      => ['dbclean_unclaimed', L10n::t('Lifespan of unclaimed items'), Config::get('system', 'dbclean-expire-unclaimed', 90), L10n::t('When the database cleanup is enabled, this defines the days after which unclaimed remote items (mostly content from the relay) will be deleted. Default value is 90 days. Defaults to the general lifespan value of remote items if set to 0.')],
-                       '$dbclean_expire_conv'    => ['dbclean_expire_conv', L10n::t('Lifespan of raw conversation data'), Config::get('system', 'dbclean_expire_conversation', 90), L10n::t('The conversation data is used for ActivityPub and OStatus, as well as for debug purposes. It should be safe to remove it after 14 days, default is 90 days.')],
-                       '$itemcache'              => ['itemcache', L10n::t('Path to item cache'), Config::get('system', 'itemcache'), L10n::t('The item caches buffers generated bbcode and external images.')],
-                       '$itemcache_duration'     => ['itemcache_duration', L10n::t('Cache duration in seconds'), Config::get('system', 'itemcache_duration'), L10n::t('How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.')],
-                       '$max_comments'           => ['max_comments', L10n::t('Maximum numbers of comments per post'), Config::get('system', 'max_comments'), L10n::t('How much comments should be shown for each post? Default value is 100.')],
-                       '$temppath'               => ['temppath', L10n::t('Temp path'), Config::get('system', 'temppath'), L10n::t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')],
-                       '$proxy_disabled'         => ['proxy_disabled', L10n::t('Disable picture proxy'), Config::get('system', 'proxy_disabled'), L10n::t('The picture proxy increases performance and privacy. It shouldn\'t be used on systems with very low bandwidth.')],
-                       '$only_tag_search'        => ['only_tag_search', L10n::t('Only search in tags'), Config::get('system', 'only_tag_search'), L10n::t('On large systems the text search can slow down the system extremely.')],
-
-                       '$relocate_url'           => ['relocate_url', L10n::t('New base url'), DI::baseUrl()->get(), L10n::t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')],
-
-                       '$rino'                   => ['rino', L10n::t('RINO Encryption'), intval(Config::get('system', 'rino_encrypt')), L10n::t('Encryption layer between nodes.'), [0 => L10n::t('Disabled'), 1 => L10n::t('Enabled')]],
-
-                       '$worker_queues'          => ['worker_queues', L10n::t('Maximum number of parallel workers'), Config::get('system', 'worker_queues'), L10n::t('On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.', 5, 20, 10)],
-                       '$worker_dont_fork'       => ['worker_dont_fork', L10n::t('Don\'t use "proc_open" with the worker'), Config::get('system', 'worker_dont_fork'), L10n::t('Enable this if your system doesn\'t allow the use of "proc_open". This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.')],
-                       '$worker_fastlane'        => ['worker_fastlane', L10n::t('Enable fastlane'), Config::get('system', 'worker_fastlane'), L10n::t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')],
-                       '$worker_frontend'        => ['worker_frontend', L10n::t('Enable frontend worker'), Config::get('system', 'frontend_worker'), L10n::t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', DI::baseUrl()->get())],
-
-                       '$relay_subscribe'        => ['relay_subscribe', L10n::t('Subscribe to relay'), Config::get('system', 'relay_subscribe'), L10n::t('Enables the receiving of public posts from the relay. They will be included in the search, subscribed tags and on the global community page.')],
-                       '$relay_server'           => ['relay_server', L10n::t('Relay server'), Config::get('system', 'relay_server', 'https://relay.diasp.org'), L10n::t('Address of the relay server where public posts should be send to. For example https://relay.diasp.org')],
-                       '$relay_directly'         => ['relay_directly', L10n::t('Direct relay transfer'), Config::get('system', 'relay_directly'), L10n::t('Enables the direct transfer to other servers without using the relay servers')],
-                       '$relay_scope'            => ['relay_scope', L10n::t('Relay scope'), Config::get('system', 'relay_scope'), L10n::t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), ['' => L10n::t('Disabled'), 'all' => L10n::t('all'), 'tags' => L10n::t('tags')]],
-                       '$relay_server_tags'      => ['relay_server_tags', L10n::t('Server tags'), Config::get('system', 'relay_server_tags'), L10n::t('Comma separated list of tags for the "tags" subscription.')],
-                       '$relay_user_tags'        => ['relay_user_tags', L10n::t('Allow user tags'), Config::get('system', 'relay_user_tags', true), L10n::t('If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".')],
+                       '$diaspora_not_able'      => DI::l10n()->t('Diaspora support can\'t be enabled because Friendica was installed into a sub directory.'),
+                       '$diaspora_enabled'       => ['diaspora_enabled', DI::l10n()->t('Enable Diaspora support'), Config::get('system', 'diaspora_enabled', $diaspora_able), DI::l10n()->t('Provide built-in Diaspora network compatibility.')],
+                       '$dfrn_only'              => ['dfrn_only', DI::l10n()->t('Only allow Friendica contacts'), Config::get('system', 'dfrn_only'), DI::l10n()->t('All contacts must use Friendica protocols. All other built-in communication protocols disabled.')],
+                       '$verifyssl'              => ['verifyssl', DI::l10n()->t('Verify SSL'), Config::get('system', 'verifyssl'), DI::l10n()->t('If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.')],
+                       '$proxyuser'              => ['proxyuser', DI::l10n()->t('Proxy user'), Config::get('system', 'proxyuser'), ''],
+                       '$proxy'                  => ['proxy', DI::l10n()->t('Proxy URL'), Config::get('system', 'proxy'), ''],
+                       '$timeout'                => ['timeout', DI::l10n()->t('Network timeout'), Config::get('system', 'curl_timeout', 60), DI::l10n()->t('Value is in seconds. Set to 0 for unlimited (not recommended).')],
+                       '$maxloadavg'             => ['maxloadavg', DI::l10n()->t('Maximum Load Average'), Config::get('system', 'maxloadavg', 20), DI::l10n()->t('Maximum system load before delivery and poll processes are deferred - default %d.', 20)],
+                       '$maxloadavg_frontend'    => ['maxloadavg_frontend', DI::l10n()->t('Maximum Load Average (Frontend)'), Config::get('system', 'maxloadavg_frontend', 50), DI::l10n()->t('Maximum system load before the frontend quits service - default 50.')],
+                       '$min_memory'             => ['min_memory', DI::l10n()->t('Minimal Memory'), Config::get('system', 'min_memory', 0), DI::l10n()->t('Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).')],
+                       '$optimize_max_tablesize' => ['optimize_max_tablesize', DI::l10n()->t('Maximum table size for optimization'), $optimize_max_tablesize, DI::l10n()->t('Maximum table size (in MB) for the automatic optimization. Enter -1 to disable it.')],
+                       '$optimize_fragmentation' => ['optimize_fragmentation', DI::l10n()->t('Minimum level of fragmentation'), Config::get('system', 'optimize_fragmentation', 30), DI::l10n()->t('Minimum fragmenation level to start the automatic optimization - default value is 30%.')],
+
+                       '$poco_completion'        => ['poco_completion', DI::l10n()->t('Periodical check of global contacts'), Config::get('system', 'poco_completion'), DI::l10n()->t('If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.')],
+                       '$poco_requery_days'      => ['poco_requery_days', DI::l10n()->t('Days between requery'), Config::get('system', 'poco_requery_days'), DI::l10n()->t('Number of days after which a server is requeried for his contacts.')],
+                       '$poco_discovery'         => ['poco_discovery', DI::l10n()->t('Discover contacts from other servers'), (string)intval(Config::get('system', 'poco_discovery')), DI::l10n()->t('Periodically query other servers for contacts. You can choose between "Users": the users on the remote system, "Global Contacts": active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren\'t available. The fallback increases the server load, so the recommended setting is "Users, Global Contacts".'), $poco_discovery_choices],
+                       '$poco_discovery_since'   => ['poco_discovery_since', DI::l10n()->t('Timeframe for fetching global contacts'), (string)intval(Config::get('system', 'poco_discovery_since')), DI::l10n()->t('When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers.'), $poco_discovery_since_choices],
+                       '$poco_local_search'      => ['poco_local_search', DI::l10n()->t('Search the local directory'), Config::get('system', 'poco_local_search'), DI::l10n()->t('Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.')],
+
+                       '$nodeinfo'               => ['nodeinfo', DI::l10n()->t('Publish server information'), Config::get('system', 'nodeinfo'), DI::l10n()->t('If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href="http://the-federation.info/">the-federation.info</a> for details.')],
+
+                       '$check_new_version_url'  => ['check_new_version_url', DI::l10n()->t('Check upstream version'), Config::get('system', 'check_new_version_url'), DI::l10n()->t('Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview.'), $check_git_version_choices],
+                       '$suppress_tags'          => ['suppress_tags', DI::l10n()->t('Suppress Tags'), Config::get('system', 'suppress_tags'), DI::l10n()->t('Suppress showing a list of hashtags at the end of the posting.')],
+                       '$dbclean'                => ['dbclean', DI::l10n()->t('Clean database'), Config::get('system', 'dbclean', false), DI::l10n()->t('Remove old remote items, orphaned database records and old content from some other helper tables.')],
+                       '$dbclean_expire_days'    => ['dbclean_expire_days', DI::l10n()->t('Lifespan of remote items'), Config::get('system', 'dbclean-expire-days', 0), DI::l10n()->t('When the database cleanup is enabled, this defines the days after which remote items will be deleted. Own items, and marked or filed items are always kept. 0 disables this behaviour.')],
+                       '$dbclean_unclaimed'      => ['dbclean_unclaimed', DI::l10n()->t('Lifespan of unclaimed items'), Config::get('system', 'dbclean-expire-unclaimed', 90), DI::l10n()->t('When the database cleanup is enabled, this defines the days after which unclaimed remote items (mostly content from the relay) will be deleted. Default value is 90 days. Defaults to the general lifespan value of remote items if set to 0.')],
+                       '$dbclean_expire_conv'    => ['dbclean_expire_conv', DI::l10n()->t('Lifespan of raw conversation data'), Config::get('system', 'dbclean_expire_conversation', 90), DI::l10n()->t('The conversation data is used for ActivityPub and OStatus, as well as for debug purposes. It should be safe to remove it after 14 days, default is 90 days.')],
+                       '$itemcache'              => ['itemcache', DI::l10n()->t('Path to item cache'), Config::get('system', 'itemcache'), DI::l10n()->t('The item caches buffers generated bbcode and external images.')],
+                       '$itemcache_duration'     => ['itemcache_duration', DI::l10n()->t('Cache duration in seconds'), Config::get('system', 'itemcache_duration'), DI::l10n()->t('How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.')],
+                       '$max_comments'           => ['max_comments', DI::l10n()->t('Maximum numbers of comments per post'), Config::get('system', 'max_comments'), DI::l10n()->t('How much comments should be shown for each post? Default value is 100.')],
+                       '$temppath'               => ['temppath', DI::l10n()->t('Temp path'), Config::get('system', 'temppath'), DI::l10n()->t('If you have a restricted system where the webserver can\'t access the system temp path, enter another path here.')],
+                       '$proxy_disabled'         => ['proxy_disabled', DI::l10n()->t('Disable picture proxy'), Config::get('system', 'proxy_disabled'), DI::l10n()->t('The picture proxy increases performance and privacy. It shouldn\'t be used on systems with very low bandwidth.')],
+                       '$only_tag_search'        => ['only_tag_search', DI::l10n()->t('Only search in tags'), Config::get('system', 'only_tag_search'), DI::l10n()->t('On large systems the text search can slow down the system extremely.')],
+
+                       '$relocate_url'           => ['relocate_url', DI::l10n()->t('New base url'), DI::baseUrl()->get(), DI::l10n()->t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')],
+
+                       '$rino'                   => ['rino', DI::l10n()->t('RINO Encryption'), intval(Config::get('system', 'rino_encrypt')), DI::l10n()->t('Encryption layer between nodes.'), [0 => DI::l10n()->t('Disabled'), 1 => DI::l10n()->t('Enabled')]],
+
+                       '$worker_queues'          => ['worker_queues', DI::l10n()->t('Maximum number of parallel workers'), Config::get('system', 'worker_queues'), DI::l10n()->t('On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.', 5, 20, 10)],
+                       '$worker_dont_fork'       => ['worker_dont_fork', DI::l10n()->t('Don\'t use "proc_open" with the worker'), Config::get('system', 'worker_dont_fork'), DI::l10n()->t('Enable this if your system doesn\'t allow the use of "proc_open". This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.')],
+                       '$worker_fastlane'        => ['worker_fastlane', DI::l10n()->t('Enable fastlane'), Config::get('system', 'worker_fastlane'), DI::l10n()->t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')],
+                       '$worker_frontend'        => ['worker_frontend', DI::l10n()->t('Enable frontend worker'), Config::get('system', 'frontend_worker'), DI::l10n()->t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', DI::baseUrl()->get())],
+
+                       '$relay_subscribe'        => ['relay_subscribe', DI::l10n()->t('Subscribe to relay'), Config::get('system', 'relay_subscribe'), DI::l10n()->t('Enables the receiving of public posts from the relay. They will be included in the search, subscribed tags and on the global community page.')],
+                       '$relay_server'           => ['relay_server', DI::l10n()->t('Relay server'), Config::get('system', 'relay_server', 'https://relay.diasp.org'), DI::l10n()->t('Address of the relay server where public posts should be send to. For example https://relay.diasp.org')],
+                       '$relay_directly'         => ['relay_directly', DI::l10n()->t('Direct relay transfer'), Config::get('system', 'relay_directly'), DI::l10n()->t('Enables the direct transfer to other servers without using the relay servers')],
+                       '$relay_scope'            => ['relay_scope', DI::l10n()->t('Relay scope'), Config::get('system', 'relay_scope'), DI::l10n()->t('Can be "all" or "tags". "all" means that every public post should be received. "tags" means that only posts with selected tags should be received.'), ['' => DI::l10n()->t('Disabled'), 'all' => DI::l10n()->t('all'), 'tags' => DI::l10n()->t('tags')]],
+                       '$relay_server_tags'      => ['relay_server_tags', DI::l10n()->t('Server tags'), Config::get('system', 'relay_server_tags'), DI::l10n()->t('Comma separated list of tags for the "tags" subscription.')],
+                       '$relay_user_tags'        => ['relay_user_tags', DI::l10n()->t('Allow user tags'), Config::get('system', 'relay_user_tags', true), DI::l10n()->t('If enabled, the tags from the saved searches will used for the "tags" subscription in addition to the "relay_server_tags".')],
 
                        '$form_security_token'    => parent::getFormSecurityToken('admin_site'),
-                       '$relocate_button'        => L10n::t('Start Relocation'),
+                       '$relocate_button'        => DI::l10n()->t('Start Relocation'),
                ]);
        }
 }
index 6f304082af6d7d355056e8f4950c87927729a329..50b513bfcf5e7e592fe204cbb5f37f843ef16027 100644 (file)
@@ -30,7 +30,7 @@ class Summary extends BaseAdminModule
                // are there MyISAM tables in the DB? If so, trigger a warning message
                $warningtext = [];
                if (DBA::count(['information_schema' => 'tables'], ['engine' => 'myisam', 'table_schema' => DBA::databaseName()])) {
-                       $warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php bin/console.php dbstructure toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
+                       $warningtext[] = DI::l10n()->t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php bin/console.php dbstructure toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
                }
 
                // Check if github.com/friendica/master/VERSION is higher then
@@ -38,7 +38,7 @@ class Summary extends BaseAdminModule
                if (Config::get('system', 'check_new_version_url', 'none') != 'none') {
                        $gitversion = Config::get('system', 'git_friendica_version');
                        if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) {
-                               $warningtext[] = L10n::t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion);
+                               $warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion);
                        }
                }
 
@@ -47,33 +47,33 @@ class Summary extends BaseAdminModule
                }
 
                if (Config::get('system', 'dbupdate') == DBStructure::UPDATE_FAILED) {
-                       $warningtext[] = L10n::t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.');
+                       $warningtext[] = DI::l10n()->t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.');
                }
 
                if (Config::get('system', 'update') == Update::FAILED) {
-                       $warningtext[] = L10n::t('The last update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)');
+                       $warningtext[] = DI::l10n()->t('The last update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear. (Some of the errors are possibly inside the logfile.)');
                }
 
                $last_worker_call = Config::get('system', 'last_worker_execution', false);
                if (!$last_worker_call) {
-                       $warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
+                       $warningtext[] = DI::l10n()->t('The worker was never executed. Please check your database structure!');
                } elseif ((strtotime(DateTimeFormat::utcNow()) - strtotime($last_worker_call)) > 60 * 60) {
-                       $warningtext[] = L10n::t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
+                       $warningtext[] = DI::l10n()->t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.', $last_worker_call);
                }
 
                // Legacy config file warning
                if (file_exists('.htconfig.php')) {
-                       $warningtext[] = L10n::t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>.htconfig.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
+                       $warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>.htconfig.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
                }
 
                if (file_exists('config/local.ini.php')) {
-                       $warningtext[] = L10n::t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>config/local.ini.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
+                       $warningtext[] = DI::l10n()->t('Friendica\'s configuration now is stored in config/local.config.php, please copy config/local-sample.config.php and move your config from <code>config/local.ini.php</code>. See <a href="%s">the Config help page</a> for help with the transition.', DI::baseUrl()->get() . '/help/Config');
                }
 
                // Check server vitality
                if (!self::checkSelfHostMeta()) {
                        $well_known = DI::baseUrl()->get() . '/.well-known/host-meta';
-                       $warningtext[] = L10n::t('<a href="%s">%s</a> is not reachable on your system. This is a severe configuration issue that prevents server to server communication. See <a href="%s">the installation page</a> for help.',
+                       $warningtext[] = DI::l10n()->t('<a href="%s">%s</a> is not reachable on your system. This is a severe configuration issue that prevents server to server communication. See <a href="%s">the installation page</a> for help.',
                                $well_known, $well_known, DI::baseUrl()->get() . '/help/Install');
                }
 
@@ -91,7 +91,7 @@ class Summary extends BaseAdminModule
                                }
 
                        } catch (\Throwable $exception) {
-                               $warningtext[] = L10n::t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
+                               $warningtext[] = DI::l10n()->t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
                        }
 
                        $file = Config::get('system', 'dlogfile');
@@ -106,7 +106,7 @@ class Summary extends BaseAdminModule
                                }
 
                        } catch (\Throwable $exception) {
-                               $warningtext[] = L10n::t('The debug logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
+                               $warningtext[] = DI::l10n()->t('The debug logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
                        }
                }
 
@@ -122,7 +122,7 @@ class Summary extends BaseAdminModule
                                        'from' => $currBasepath,
                                        'to'   => $confBasepath,
                                ]);
-                               $warningtext[] = L10n::t('Friendica\'s system.basepath was updated from \'%s\' to \'%s\'. Please remove the system.basepath from your db to avoid differences.',
+                               $warningtext[] = DI::l10n()->t('Friendica\'s system.basepath was updated from \'%s\' to \'%s\'. Please remove the system.basepath from your db to avoid differences.',
                                        $currBasepath,
                                        $confBasepath);
                        } elseif (!is_dir($currBasepath)) {
@@ -130,7 +130,7 @@ class Summary extends BaseAdminModule
                                        'from' => $currBasepath,
                                        'to'   => $confBasepath,
                                ]);
-                               $warningtext[] = L10n::t('Friendica\'s current system.basepath \'%s\' is wrong and the config file \'%s\' isn\'t used.',
+                               $warningtext[] = DI::l10n()->t('Friendica\'s current system.basepath \'%s\' is wrong and the config file \'%s\' isn\'t used.',
                                        $currBasepath,
                                        $confBasepath);
                        } else {
@@ -138,19 +138,19 @@ class Summary extends BaseAdminModule
                                        'from' => $currBasepath,
                                        'to'   => $confBasepath,
                                ]);
-                               $warningtext[] = L10n::t('Friendica\'s current system.basepath \'%s\' is not equal to the config file \'%s\'. Please fix your configuration.',
+                               $warningtext[] = DI::l10n()->t('Friendica\'s current system.basepath \'%s\' is not equal to the config file \'%s\'. Please fix your configuration.',
                                        $currBasepath,
                                        $confBasepath);
                        }
                }
 
                $accounts = [
-                       [L10n::t('Normal Account'), 0],
-                       [L10n::t('Automatic Follower Account'), 0],
-                       [L10n::t('Public Forum Account'), 0],
-                       [L10n::t('Automatic Friend Account'), 0],
-                       [L10n::t('Blog Account'), 0],
-                       [L10n::t('Private Forum Account'), 0]
+                       [DI::l10n()->t('Normal Account'), 0],
+                       [DI::l10n()->t('Automatic Follower Account'), 0],
+                       [DI::l10n()->t('Public Forum Account'), 0],
+                       [DI::l10n()->t('Automatic Friend Account'), 0],
+                       [DI::l10n()->t('Blog Account'), 0],
+                       [DI::l10n()->t('Private Forum Account'), 0]
                ];
 
                $users = 0;
@@ -170,13 +170,13 @@ class Summary extends BaseAdminModule
                $workerqueue = DBA::count('workerqueue', ['NOT `done` AND `retrial` = ?', 0]);
 
                // We can do better, but this is a quick queue status
-               $queues = ['label' => L10n::t('Message queues'), 'deferred' => $deferred, 'workerq' => $workerqueue];
+               $queues = ['label' => DI::l10n()->t('Message queues'), 'deferred' => $deferred, 'workerq' => $workerqueue];
 
                $variables = DBA::toArray(DBA::p('SHOW variables LIKE "max_allowed_packet"'));
                $max_allowed_packet = $variables ? $variables[0]['Value'] : 0;
 
                $server_settings = [
-                       'label' => L10n::t('Server Settings'),
+                       'label' => DI::l10n()->t('Server Settings'),
                        'php' => [
                                'upload_max_filesize' => ini_get('upload_max_filesize'),
                                'post_max_size' => ini_get('post_max_size'),
@@ -189,17 +189,17 @@ class Summary extends BaseAdminModule
 
                $t = Renderer::getMarkupTemplate('admin/summary.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Summary'),
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Summary'),
                        '$queues' => $queues,
-                       '$users' => [L10n::t('Registered users'), $users],
+                       '$users' => [DI::l10n()->t('Registered users'), $users],
                        '$accounts' => $accounts,
-                       '$pending' => [L10n::t('Pending registrations'), $pending],
-                       '$version' => [L10n::t('Version'), FRIENDICA_VERSION],
+                       '$pending' => [DI::l10n()->t('Pending registrations'), $pending],
+                       '$version' => [DI::l10n()->t('Version'), FRIENDICA_VERSION],
                        '$platform' => FRIENDICA_PLATFORM,
                        '$codename' => FRIENDICA_CODENAME,
                        '$build' => Config::get('system', 'build'),
-                       '$addons' => [L10n::t('Active addons'), Addon::getEnabledList()],
+                       '$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()],
                        '$serversettings' => $server_settings,
                        '$warningtext' => $warningtext
                ]);
index 2b573eec3b4c2ae36f0422108abaf0443f6a0a22..0c2529b92e431f42862ef46de68c9e4a14d11728 100644 (file)
@@ -30,7 +30,7 @@ class Details extends BaseAdminModule
                                }
                        }
 
-                       info(L10n::t('Theme settings updated.'));
+                       info(DI::l10n()->t('Theme settings updated.'));
 
                        if (DI::mode()->isAjax()) {
                                return;
@@ -51,17 +51,17 @@ class Details extends BaseAdminModule
                        $theme = $a->argv[2];
                        $theme = Strings::sanitizeFilePathItem($theme);
                        if (!is_dir("view/theme/$theme")) {
-                               notice(L10n::t("Item not found."));
+                               notice(DI::l10n()->t("Item not found."));
                                return '';
                        }
 
                        $isEnabled = in_array($theme, Theme::getAllowedList());
                        if ($isEnabled) {
                                $status = "on";
-                               $action = L10n::t("Disable");
+                               $action = DI::l10n()->t("Disable");
                        } else {
                                $status = "off";
-                               $action = L10n::t("Enable");
+                               $action = DI::l10n()->t("Enable");
                        }
 
                        if (!empty($_GET['action']) && $_GET['action'] == 'toggle') {
@@ -69,11 +69,11 @@ class Details extends BaseAdminModule
 
                                if ($isEnabled) {
                                        Theme::uninstall($theme);
-                                       info(L10n::t('Theme %s disabled.', $theme));
+                                       info(DI::l10n()->t('Theme %s disabled.', $theme));
                                } elseif (Theme::install($theme)) {
-                                       info(L10n::t('Theme %s successfully enabled.', $theme));
+                                       info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
                                } else {
-                                       info(L10n::t('Theme %s failed to install.', $theme));
+                                       info(DI::l10n()->t('Theme %s failed to install.', $theme));
                                }
 
                                DI::baseUrl()->redirect('admin/themes/' . $theme);
@@ -95,17 +95,17 @@ class Details extends BaseAdminModule
                                }
                        }
 
-                       $screenshot = [Theme::getScreenshot($theme), L10n::t('Screenshot')];
+                       $screenshot = [Theme::getScreenshot($theme), DI::l10n()->t('Screenshot')];
                        if (!stristr($screenshot[0], $theme)) {
                                $screenshot = null;
                        }
 
                        $t = Renderer::getMarkupTemplate('admin/addons/details.tpl');
                        return Renderer::replaceMacros($t, [
-                               '$title' => L10n::t('Administration'),
-                               '$page' => L10n::t('Themes'),
-                               '$toggle' => L10n::t('Toggle'),
-                               '$settings' => L10n::t('Settings'),
+                               '$title' => DI::l10n()->t('Administration'),
+                               '$page' => DI::l10n()->t('Themes'),
+                               '$toggle' => DI::l10n()->t('Toggle'),
+                               '$settings' => DI::l10n()->t('Settings'),
                                '$baseurl' => DI::baseUrl()->get(true),
                                '$addon' => $theme,
                                '$status' => $status,
@@ -113,8 +113,8 @@ class Details extends BaseAdminModule
                                '$info' => Theme::getInfo($theme),
                                '$function' => 'themes',
                                '$admin_form' => $admin_form,
-                               '$str_author' => L10n::t('Author: '),
-                               '$str_maintainer' => L10n::t('Maintainer: '),
+                               '$str_author' => DI::l10n()->t('Author: '),
+                               '$str_maintainer' => DI::l10n()->t('Maintainer: '),
                                '$screenshot' => $screenshot,
                                '$readme' => $readme,
 
index fc0d3301bff06a89062dd3260569cb9d115b8e97..3da022322a26d034653c0728165eba327ac0e9ba 100644 (file)
@@ -44,7 +44,7 @@ class Embed extends BaseAdminModule
                                }
                        }
 
-                       info(L10n::t('Theme settings updated.'));
+                       info(DI::l10n()->t('Theme settings updated.'));
 
                        if (DI::mode()->isAjax()) {
                                return;
@@ -65,7 +65,7 @@ class Embed extends BaseAdminModule
                        $theme = $a->argv[2];
                        $theme = Strings::sanitizeFilePathItem($theme);
                        if (!is_dir("view/theme/$theme")) {
-                               notice(L10n::t('Unknown theme.'));
+                               notice(DI::l10n()->t('Unknown theme.'));
                                return '';
                        }
 
index dc848f93f85dd2d9008aee3b021c32d3c7a64f11..03794a155edee8357e8ee194223d6f366b68c31f 100644 (file)
@@ -39,17 +39,17 @@ class Index extends BaseAdminModule
                                        if ($theme) {
                                                $theme = Strings::sanitizeFilePathItem($theme);
                                                if (!is_dir("view/theme/$theme")) {
-                                                       notice(L10n::t('Item not found.'));
+                                                       notice(DI::l10n()->t('Item not found.'));
                                                        return '';
                                                }
 
                                                if (in_array($theme, Theme::getAllowedList())) {
                                                        Theme::uninstall($theme);
-                                                       info(L10n::t('Theme %s disabled.', $theme));
+                                                       info(DI::l10n()->t('Theme %s disabled.', $theme));
                                                } elseif (Theme::install($theme)) {
-                                                       info(L10n::t('Theme %s successfully enabled.', $theme));
+                                                       info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
                                                } else {
-                                                       info(L10n::t('Theme %s failed to install.', $theme));
+                                                       info(DI::l10n()->t('Theme %s failed to install.', $theme));
                                                }
                                        }
 
@@ -91,17 +91,17 @@ class Index extends BaseAdminModule
 
                $t = Renderer::getMarkupTemplate('admin/addons/index.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title'               => L10n::t('Administration'),
-                       '$page'                => L10n::t('Themes'),
-                       '$submit'              => L10n::t('Save Settings'),
-                       '$reload'              => L10n::t('Reload active themes'),
+                       '$title'               => DI::l10n()->t('Administration'),
+                       '$page'                => DI::l10n()->t('Themes'),
+                       '$submit'              => DI::l10n()->t('Save Settings'),
+                       '$reload'              => DI::l10n()->t('Reload active themes'),
                        '$baseurl'             => DI::baseUrl()->get(true),
                        '$function'            => 'themes',
                        '$addons'              => $addons,
                        '$pcount'              => count($themes),
-                       '$noplugshint'         => L10n::t('No themes found on the system. They should be placed in %1$s', '<code>/view/themes</code>'),
-                       '$experimental'        => L10n::t('[Experimental]'),
-                       '$unsupported'         => L10n::t('[Unsupported]'),
+                       '$noplugshint'         => DI::l10n()->t('No themes found on the system. They should be placed in %1$s', '<code>/view/themes</code>'),
+                       '$experimental'        => DI::l10n()->t('[Experimental]'),
+                       '$unsupported'         => DI::l10n()->t('[Unsupported]'),
                        '$form_security_token' => parent::getFormSecurityToken('admin_themes'),
                ]);
        }
index 5e434bc0d04a5ed98a54fe4115637d84bf6c81b9..158738fd8e21f256cce7f79a92c8fa09656c9a0a 100644 (file)
@@ -28,7 +28,7 @@ class Tos extends BaseAdminModule
                Config::set('system', 'tosprivstatement', $displayprivstatement);
                Config::set('system', 'tostext', $tostext);
 
-               info(L10n::t('The Terms of Service settings have been updated.'));
+               info(DI::l10n()->t('The Terms of Service settings have been updated.'));
 
                DI::baseUrl()->redirect('admin/tos');
        }
@@ -40,15 +40,15 @@ class Tos extends BaseAdminModule
                $tos = new \Friendica\Module\Tos();
                $t = Renderer::getMarkupTemplate('admin/tos.tpl');
                return Renderer::replaceMacros($t, [
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Terms of Service'),
-                       '$displaytos' => ['displaytos', L10n::t('Display Terms of Service'), Config::get('system', 'tosdisplay'), L10n::t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
-                       '$displayprivstatement' => ['displayprivstatement', L10n::t('Display Privacy Statement'), Config::get('system', 'tosprivstatement'), L10n::t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank">EU-GDPR</a>.', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
-                       '$preview' => L10n::t('Privacy Statement Preview'),
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Terms of Service'),
+                       '$displaytos' => ['displaytos', DI::l10n()->t('Display Terms of Service'), Config::get('system', 'tosdisplay'), DI::l10n()->t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
+                       '$displayprivstatement' => ['displayprivstatement', DI::l10n()->t('Display Privacy Statement'), Config::get('system', 'tosprivstatement'), DI::l10n()->t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank">EU-GDPR</a>.', 'https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
+                       '$preview' => DI::l10n()->t('Privacy Statement Preview'),
                        '$privtext' => $tos->privacy_complete,
-                       '$tostext' => ['tostext', L10n::t('The Terms of Service'), Config::get('system', 'tostext'), L10n::t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
+                       '$tostext' => ['tostext', DI::l10n()->t('The Terms of Service'), Config::get('system', 'tostext'), DI::l10n()->t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
                        '$form_security_token' => parent::getFormSecurityToken('admin_tos'),
-                       '$submit' => L10n::t('Save Settings'),
+                       '$submit' => DI::l10n()->t('Save Settings'),
                ]);
        }
 }
index b71f3f7513cb24927d1fef4972a0e5e3d0e69d2e..543562d9da5032b156271887e887ebb99c2e211a 100644 (file)
@@ -44,10 +44,10 @@ class Users extends BaseAdminModule
                        }
 
                        $user = $result['user'];
-                       $preamble = Strings::deindent(L10n::t('
+                       $preamble = Strings::deindent(DI::l10n()->t('
                        Dear %1$s,
                                the administrator of %2$s has set up an account for you.'));
-                       $body = Strings::deindent(L10n::t('
+                       $body = Strings::deindent(DI::l10n()->t('
                        The login details are as follows:
 
                        Site Location:  %1$s
@@ -84,7 +84,7 @@ class Users extends BaseAdminModule
                                'to_name'  => $user['username'],
                                'to_email' => $user['email'],
                                'uid'      => $user['uid'],
-                               'subject'  => L10n::t('Registration details for %s', Config::get('config', 'sitename')),
+                               'subject'  => DI::l10n()->t('Registration details for %s', Config::get('config', 'sitename')),
                                'preamble' => $preamble,
                                'body'     => $body]);
                }
@@ -106,7 +106,7 @@ class Users extends BaseAdminModule
                                if (local_user() != $uid) {
                                        User::remove($uid);
                                } else {
-                                       notice(L10n::t('You can\'t remove yourself'));
+                                       notice(DI::l10n()->t('You can\'t remove yourself'));
                                }
                        }
 
@@ -154,22 +154,22 @@ class Users extends BaseAdminModule
                                                // delete user
                                                User::remove($uid);
 
-                                               notice(L10n::t('User "%s" deleted', $user['username']));
+                                               notice(DI::l10n()->t('User "%s" deleted', $user['username']));
                                        } else {
-                                               notice(L10n::t('You can\'t remove yourself'));
+                                               notice(DI::l10n()->t('You can\'t remove yourself'));
                                        }
                                        break;
                                case 'block':
                                        parent::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
                                        // @TODO Move this to Model\User:block([$uid]);
                                        DBA::update('user', ['blocked' => 1], ['uid' => $uid]);
-                                       notice(L10n::t('User "%s" blocked', $user['username']));
+                                       notice(DI::l10n()->t('User "%s" blocked', $user['username']));
                                        break;
                                case 'unblock':
                                        parent::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
                                        // @TODO Move this to Model\User:unblock([$uid]);
                                        DBA::update('user', ['blocked' => 0], ['uid' => $uid]);
-                                       notice(L10n::t('User "%s" unblocked', $user['username']));
+                                       notice(DI::l10n()->t('User "%s" unblocked', $user['username']));
                                        break;
                        }
 
@@ -218,18 +218,18 @@ class Users extends BaseAdminModule
                $adminlist = explode(',', str_replace(' ', '', Config::get('config', 'admin_email')));
                $_setup_users = function ($e) use ($adminlist) {
                        $page_types = [
-                               User::PAGE_FLAGS_NORMAL    => L10n::t('Normal Account Page'),
-                               User::PAGE_FLAGS_SOAPBOX   => L10n::t('Soapbox Page'),
-                               User::PAGE_FLAGS_COMMUNITY => L10n::t('Public Forum'),
-                               User::PAGE_FLAGS_FREELOVE  => L10n::t('Automatic Friend Page'),
-                               User::PAGE_FLAGS_PRVGROUP  => L10n::t('Private Forum')
+                               User::PAGE_FLAGS_NORMAL    => DI::l10n()->t('Normal Account Page'),
+                               User::PAGE_FLAGS_SOAPBOX   => DI::l10n()->t('Soapbox Page'),
+                               User::PAGE_FLAGS_COMMUNITY => DI::l10n()->t('Public Forum'),
+                               User::PAGE_FLAGS_FREELOVE  => DI::l10n()->t('Automatic Friend Page'),
+                               User::PAGE_FLAGS_PRVGROUP  => DI::l10n()->t('Private Forum')
                        ];
                        $account_types = [
-                               User::ACCOUNT_TYPE_PERSON       => L10n::t('Personal Page'),
-                               User::ACCOUNT_TYPE_ORGANISATION => L10n::t('Organisation Page'),
-                               User::ACCOUNT_TYPE_NEWS         => L10n::t('News Page'),
-                               User::ACCOUNT_TYPE_COMMUNITY    => L10n::t('Community Forum'),
-                               User::ACCOUNT_TYPE_RELAY        => L10n::t('Relay'),
+                               User::ACCOUNT_TYPE_PERSON       => DI::l10n()->t('Personal Page'),
+                               User::ACCOUNT_TYPE_ORGANISATION => DI::l10n()->t('Organisation Page'),
+                               User::ACCOUNT_TYPE_NEWS         => DI::l10n()->t('News Page'),
+                               User::ACCOUNT_TYPE_COMMUNITY    => DI::l10n()->t('Community Forum'),
+                               User::ACCOUNT_TYPE_RELAY        => DI::l10n()->t('Relay'),
                        ];
 
                        $e['page_flags_raw'] = $e['page-flags'];
@@ -268,38 +268,38 @@ class Users extends BaseAdminModule
                        }
                }
 
-               $th_users = array_map(null, [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Type')], $valid_orders);
+               $th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last item'), DI::l10n()->t('Type')], $valid_orders);
 
                $t = Renderer::getMarkupTemplate('admin/users.tpl');
                $o = Renderer::replaceMacros($t, [
                        // strings //
-                       '$title' => L10n::t('Administration'),
-                       '$page' => L10n::t('Users'),
-                       '$submit' => L10n::t('Add User'),
-                       '$select_all' => L10n::t('select all'),
-                       '$h_pending' => L10n::t('User registrations waiting for confirm'),
-                       '$h_deleted' => L10n::t('User waiting for permanent deletion'),
-                       '$th_pending' => [L10n::t('Request date'), L10n::t('Name'), L10n::t('Email')],
-                       '$no_pending' => L10n::t('No registrations.'),
-                       '$pendingnotetext' => L10n::t('Note from the user'),
-                       '$approve' => L10n::t('Approve'),
-                       '$deny' => L10n::t('Deny'),
-                       '$delete' => L10n::t('Delete'),
-                       '$block' => L10n::t('Block'),
-                       '$blocked' => L10n::t('User blocked'),
-                       '$unblock' => L10n::t('Unblock'),
-                       '$siteadmin' => L10n::t('Site admin'),
-                       '$accountexpired' => L10n::t('Account expired'),
-
-                       '$h_users' => L10n::t('Users'),
-                       '$h_newuser' => L10n::t('New User'),
-                       '$th_deleted' => [L10n::t('Name'), L10n::t('Email'), L10n::t('Register date'), L10n::t('Last login'), L10n::t('Last item'), L10n::t('Permanent deletion')],
+                       '$title' => DI::l10n()->t('Administration'),
+                       '$page' => DI::l10n()->t('Users'),
+                       '$submit' => DI::l10n()->t('Add User'),
+                       '$select_all' => DI::l10n()->t('select all'),
+                       '$h_pending' => DI::l10n()->t('User registrations waiting for confirm'),
+                       '$h_deleted' => DI::l10n()->t('User waiting for permanent deletion'),
+                       '$th_pending' => [DI::l10n()->t('Request date'), DI::l10n()->t('Name'), DI::l10n()->t('Email')],
+                       '$no_pending' => DI::l10n()->t('No registrations.'),
+                       '$pendingnotetext' => DI::l10n()->t('Note from the user'),
+                       '$approve' => DI::l10n()->t('Approve'),
+                       '$deny' => DI::l10n()->t('Deny'),
+                       '$delete' => DI::l10n()->t('Delete'),
+                       '$block' => DI::l10n()->t('Block'),
+                       '$blocked' => DI::l10n()->t('User blocked'),
+                       '$unblock' => DI::l10n()->t('Unblock'),
+                       '$siteadmin' => DI::l10n()->t('Site admin'),
+                       '$accountexpired' => DI::l10n()->t('Account expired'),
+
+                       '$h_users' => DI::l10n()->t('Users'),
+                       '$h_newuser' => DI::l10n()->t('New User'),
+                       '$th_deleted' => [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last item'), DI::l10n()->t('Permanent deletion')],
                        '$th_users' => $th_users,
                        '$order_users' => $order,
                        '$order_direction_users' => $order_direction,
 
-                       '$confirm_delete_multi' => L10n::t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
-                       '$confirm_delete' => L10n::t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
+                       '$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
+                       '$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
 
                        '$form_security_token' => parent::getFormSecurityToken('admin_users'),
 
@@ -309,9 +309,9 @@ class Users extends BaseAdminModule
                        '$pending' => $pending,
                        'deleted' => $deleted,
                        '$users' => $users,
-                       '$newusername' => ['new_user_name', L10n::t('Name'), '', L10n::t('Name of the new user.')],
-                       '$newusernickname' => ['new_user_nickname', L10n::t('Nickname'), '', L10n::t('Nickname of the new user.')],
-                       '$newuseremail' => ['new_user_email', L10n::t('Email'), '', L10n::t('Email address of the new user.'), '', '', 'email'],
+                       '$newusername' => ['new_user_name', DI::l10n()->t('Name'), '', DI::l10n()->t('Name of the new user.')],
+                       '$newusernickname' => ['new_user_nickname', DI::l10n()->t('Nickname'), '', DI::l10n()->t('Nickname of the new user.')],
+                       '$newuseremail' => ['new_user_email', DI::l10n()->t('Email'), '', DI::l10n()->t('Email address of the new user.'), '', '', 'email'],
                ]);
 
                $o .= $pager->renderFull(DBA::count('user'));
index e145614982274a50d4741c29ba4ba5d96e5ed5a8..b9105c81d53055b57a192fc221ea8921e27c8846 100644 (file)
@@ -33,7 +33,7 @@ class AllFriends extends BaseModule
                }
 
                if (!$cid) {
-                       throw new HTTPException\BadRequestException(L10n::t('Invalid contact.'));
+                       throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid contact.'));
                }
 
                $uid = $app->user['uid'];
@@ -41,7 +41,7 @@ class AllFriends extends BaseModule
                $contact = Model\Contact::getContactForUser($cid, local_user(), ['name', 'url', 'photo', 'uid', 'id']);
 
                if (empty($contact)) {
-                       throw new HTTPException\BadRequestException(L10n::t('Invalid contact.'));
+                       throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid contact.'));
                }
 
                DI::page()['aside'] = "";
@@ -53,7 +53,7 @@ class AllFriends extends BaseModule
 
                $friends = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage());
                if (empty($friends)) {
-                       return L10n::t('No friends to display.');
+                       return DI::l10n()->t('No friends to display.');
                }
 
                $id = 0;
@@ -72,8 +72,8 @@ class AllFriends extends BaseModule
                        } else {
                                $connlnk = DI::baseUrl()->get() . '/follow/?url=' . $friend['url'];
                                $photoMenu = [
-                                       'profile' => [L10n::t('View Profile'), Model\Contact::magicLinkbyId($friend['id'], $friend['url'])],
-                                       'follow'  => [L10n::t('Connect/Follow'), $connlnk]
+                                       'profile' => [DI::l10n()->t('View Profile'), Model\Contact::magicLinkbyId($friend['id'], $friend['url'])],
+                                       'follow'  => [DI::l10n()->t('Connect/Follow'), $connlnk]
                                ];
                        }
 
@@ -89,7 +89,7 @@ class AllFriends extends BaseModule
                                'account_type' => Model\Contact::getAccountType($contactDetails),
                                'network'      => ContactSelector::networkToName($contactDetails['network'], $contactDetails['url']),
                                'photoMenu'    => $photoMenu,
-                               'conntxt'      => L10n::t('Connect'),
+                               'conntxt'      => DI::l10n()->t('Connect'),
                                'connlnk'      => $connlnk,
                                'id'           => ++$id,
                        ];
index d7cd0fc72e28b873f74b750756d5294d89f28d07..22585f86a5c6c0a78630391cecf2472d5c6eb458 100644 (file)
@@ -27,12 +27,12 @@ class Apps extends BaseModule
                $apps = Nav::getAppMenu();
 
                if (count($apps) == 0) {
-                       notice(L10n::t('No installed applications.') . EOL);
+                       notice(DI::l10n()->t('No installed applications.') . EOL);
                }
 
                $tpl = Renderer::getMarkupTemplate('apps.tpl');
                return Renderer::replaceMacros($tpl, [
-                       '$title' => L10n::t('Applications'),
+                       '$title' => DI::l10n()->t('Applications'),
                        '$apps'  => $apps,
                ]);
        }
index bad97b5736d7440b66c7f86bd9db3c5003ffdcfd..057b4a9aa10864ec8659b3cc1409066b73cb15ca 100644 (file)
@@ -34,19 +34,19 @@ class Attach extends BaseModule
                // Check for existence
                $item = MAttach::exists(['id' => $item_id]);
                if ($item === false) {
-                       throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('Item was not found.'));
+                       throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Item was not found.'));
                }
 
                // Now we'll fetch the item, if we have enough permisson
                $item = MAttach::getByIdWithPermission($item_id);
                if ($item === false) {
-                       throw new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Permission denied.'));
+                       throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                $data = MAttach::getData($item);
                if (is_null($data)) {
                        Logger::log('NULL data for attachment with id ' . $item['id']);
-                       throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('Item was not found.'));
+                       throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Item was not found.'));
                }
 
                // Use quotes around the filename to prevent a "multiple Content-Disposition"
index ac22822d0f8fff9f2405301addad66491b19bf4f..2df9f0090d7cc99ea0a497e5a30deaa2cc4d9d71 100644 (file)
@@ -39,13 +39,13 @@ class Api extends BaseModule
        public static function post(array $parameters = [])
        {
                if (!api_user()) {
-                       throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.'));
+                       throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
                }
 
                $a = DI::app();
 
                if (!empty($a->user['uid']) && $a->user['uid'] != api_user()) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
        }
 
index bbb633ab8c590e1b94e65a8f5a77e831f6beb06d..ea61a617287c26b1e582fccc7b2912609a408c4b 100644 (file)
@@ -52,13 +52,13 @@ abstract class BaseAdminModule extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!is_site_admin()) {
-                       notice(L10n::t('Please login to continue.'));
+                       notice(DI::l10n()->t('Please login to continue.'));
                        Session::set('return_path', DI::args()->getQueryString());
                        DI::baseUrl()->redirect('login');
                }
 
                if (!empty($_SESSION['submanage'])) {
-                       throw new ForbiddenException(L10n::t('Submanaged account can\'t access the administation pages. Please log back in as the master account.'));
+                       throw new ForbiddenException(DI::l10n()->t('Submanaged account can\'t access the administation pages. Please log back in as the master account.'));
                }
 
                // Header stuff
@@ -71,38 +71,38 @@ abstract class BaseAdminModule extends BaseModule
                // array(url, name, extra css classes)
                // not part of $aside to make the template more adjustable
                $aside_sub = [
-                       'information' => [L10n::t('Information'), [
-                               'overview'     => ['admin'             , L10n::t('Overview')                , 'overview'],
-                               'federation'   => ['admin/federation'  , L10n::t('Federation Statistics')   , 'federation']
+                       'information' => [DI::l10n()->t('Information'), [
+                               'overview'     => ['admin'             , DI::l10n()->t('Overview')                , 'overview'],
+                               'federation'   => ['admin/federation'  , DI::l10n()->t('Federation Statistics')   , 'federation']
                        ]],
-                       'configuration' => [L10n::t('Configuration'), [
-                               'site'         => ['admin/site'        , L10n::t('Site')                    , 'site'],
-                               'users'        => ['admin/users'       , L10n::t('Users')                   , 'users'],
-                               'addons'       => ['admin/addons'      , L10n::t('Addons')                  , 'addons'],
-                               'themes'       => ['admin/themes'      , L10n::t('Themes')                  , 'themes'],
-                               'features'     => ['admin/features'    , L10n::t('Additional features')     , 'features'],
-                               'tos'          => ['admin/tos'         , L10n::t('Terms of Service')        , 'tos'],
+                       'configuration' => [DI::l10n()->t('Configuration'), [
+                               'site'         => ['admin/site'        , DI::l10n()->t('Site')                    , 'site'],
+                               'users'        => ['admin/users'       , DI::l10n()->t('Users')                   , 'users'],
+                               'addons'       => ['admin/addons'      , DI::l10n()->t('Addons')                  , 'addons'],
+                               'themes'       => ['admin/themes'      , DI::l10n()->t('Themes')                  , 'themes'],
+                               'features'     => ['admin/features'    , DI::l10n()->t('Additional features')     , 'features'],
+                               'tos'          => ['admin/tos'         , DI::l10n()->t('Terms of Service')        , 'tos'],
                        ]],
-                       'database' => [L10n::t('Database'), [
-                               'dbsync'       => ['admin/dbsync'      , L10n::t('DB updates')              , 'dbsync'],
-                               'deferred'     => ['admin/queue/deferred', L10n::t('Inspect Deferred Workers'), 'deferred'],
-                               'workerqueue'  => ['admin/queue'       , L10n::t('Inspect worker Queue')    , 'workerqueue'],
+                       'database' => [DI::l10n()->t('Database'), [
+                               'dbsync'       => ['admin/dbsync'      , DI::l10n()->t('DB updates')              , 'dbsync'],
+                               'deferred'     => ['admin/queue/deferred', DI::l10n()->t('Inspect Deferred Workers'), 'deferred'],
+                               'workerqueue'  => ['admin/queue'       , DI::l10n()->t('Inspect worker Queue')    , 'workerqueue'],
                        ]],
-                       'tools' => [L10n::t('Tools'), [
-                               'contactblock' => ['admin/blocklist/contact', L10n::t('Contact Blocklist')  , 'contactblock'],
-                               'blocklist'    => ['admin/blocklist/server' , L10n::t('Server Blocklist')   , 'blocklist'],
-                               'deleteitem'   => ['admin/item/delete' , L10n::t('Delete Item')             , 'deleteitem'],
+                       'tools' => [DI::l10n()->t('Tools'), [
+                               'contactblock' => ['admin/blocklist/contact', DI::l10n()->t('Contact Blocklist')  , 'contactblock'],
+                               'blocklist'    => ['admin/blocklist/server' , DI::l10n()->t('Server Blocklist')   , 'blocklist'],
+                               'deleteitem'   => ['admin/item/delete' , DI::l10n()->t('Delete Item')             , 'deleteitem'],
                        ]],
-                       'logs' => [L10n::t('Logs'), [
-                               'logsconfig'   => ['admin/logs/', L10n::t('Logs')                           , 'logs'],
-                               'logsview'     => ['admin/logs/view'    , L10n::t('View Logs')              , 'viewlogs'],
+                       'logs' => [DI::l10n()->t('Logs'), [
+                               'logsconfig'   => ['admin/logs/', DI::l10n()->t('Logs')                           , 'logs'],
+                               'logsview'     => ['admin/logs/view'    , DI::l10n()->t('View Logs')              , 'viewlogs'],
                        ]],
-                       'diagnostics' => [L10n::t('Diagnostics'), [
-                               'phpinfo'      => ['admin/phpinfo'           , L10n::t('PHP Info')          , 'phpinfo'],
-                               'probe'        => ['probe'             , L10n::t('probe address')           , 'probe'],
-                               'webfinger'    => ['webfinger'         , L10n::t('check webfinger')         , 'webfinger'],
-                               'itemsource'   => ['admin/item/source' , L10n::t('Item Source')             , 'itemsource'],
-                               'babel'        => ['babel'             , L10n::t('Babel')                   , 'babel'],
+                       'diagnostics' => [DI::l10n()->t('Diagnostics'), [
+                               'phpinfo'      => ['admin/phpinfo'           , DI::l10n()->t('PHP Info')          , 'phpinfo'],
+                               'probe'        => ['probe'             , DI::l10n()->t('probe address')           , 'probe'],
+                               'webfinger'    => ['webfinger'         , DI::l10n()->t('check webfinger')         , 'webfinger'],
+                               'itemsource'   => ['admin/item/source' , DI::l10n()->t('Item Source')             , 'itemsource'],
+                               'babel'        => ['babel'             , DI::l10n()->t('Babel')                   , 'babel'],
                        ]],
                ];
 
@@ -110,9 +110,9 @@ abstract class BaseAdminModule extends BaseModule
                DI::page()['aside'] .= Renderer::replaceMacros($t, [
                        '$admin' => ['addons_admin' => Addon::getAdminList()],
                        '$subpages' => $aside_sub,
-                       '$admtxt' => L10n::t('Admin'),
-                       '$plugadmtxt' => L10n::t('Addon Features'),
-                       '$h_pending' => L10n::t('User registrations waiting for confirmation'),
+                       '$admtxt' => DI::l10n()->t('Admin'),
+                       '$plugadmtxt' => DI::l10n()->t('Addon Features'),
+                       '$h_pending' => DI::l10n()->t('User registrations waiting for confirmation'),
                        '$admurl' => 'admin/'
                ]);
 
index 2c1b2dc8d4d778d4bb0d98f369fc7ce6b8cf036d..eeb04feeb0a42c08dfdf758db9cae773dad3f955 100644 (file)
@@ -50,7 +50,7 @@ class BaseSearchModule extends BaseModule
                if (strpos($search, '@') === 0) {
                        $search  = substr($search, 1);
                        $type    = Search::TYPE_PEOPLE;
-                       $header  = L10n::t('People Search - %s', $search);
+                       $header  = DI::l10n()->t('People Search - %s', $search);
 
                        if (strrpos($search, '@') > 0) {
                                $results = Search::getContactsFromProbe($search);
@@ -60,7 +60,7 @@ class BaseSearchModule extends BaseModule
                if (strpos($search, '!') === 0) {
                        $search = substr($search, 1);
                        $type   = Search::TYPE_FORUM;
-                       $header = L10n::t('Forum Search - %s', $search);
+                       $header = DI::l10n()->t('Forum Search - %s', $search);
                }
 
                $args = DI::args();
@@ -91,7 +91,7 @@ class BaseSearchModule extends BaseModule
        protected static function printResult(ResultList $results, Pager $pager, $header = '')
        {
                if ($results->getTotal() == 0) {
-                       info(L10n::t('No matches'));
+                       info(DI::l10n()->t('No matches'));
                        return '';
                }
 
@@ -128,10 +128,10 @@ class BaseSearchModule extends BaseModule
                                        }
                                } else {
                                        $connLink = DI::baseUrl()->get() . '/follow/?url=' . $result->getUrl();
-                                       $connTxt  = L10n::t('Connect');
+                                       $connTxt  = DI::l10n()->t('Connect');
 
-                                       $photo_menu['profile'] = [L10n::t("View Profile"), Model\Contact::magicLink($result->getUrl())];
-                                       $photo_menu['follow']  = [L10n::t("Connect/Follow"), $connLink];
+                                       $photo_menu['profile'] = [DI::l10n()->t("View Profile"), Model\Contact::magicLink($result->getUrl())];
+                                       $photo_menu['follow']  = [DI::l10n()->t("Connect/Follow"), $connLink];
                                }
 
                                $photo = str_replace("http:///photo/", Search::getGlobalDirectory() . "/photo/", $result->getPhoto());
index 291ae8d0b6d7abee12f4cb10eab62ada7193edc2..4a6b7b28eb2feccfcf3d059404c57efbaf679f75 100644 (file)
@@ -16,27 +16,27 @@ class BaseSettingsModule extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('settings/head.tpl');
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$ispublic' => L10n::t('everybody')
+                       '$ispublic' => DI::l10n()->t('everybody')
                ]);
 
                $tabs = [];
 
                $tabs[] = [
-                       'label' => L10n::t('Account'),
+                       'label' => DI::l10n()->t('Account'),
                        'url' => 'settings',
                        'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings') ? 'active' : ''),
                        'accesskey' => 'o',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Two-factor authentication'),
+                       'label' => DI::l10n()->t('Two-factor authentication'),
                        'url' => 'settings/2fa',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === '2fa') ? 'active' : ''),
                        'accesskey' => 'o',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Profiles'),
+                       'label' => DI::l10n()->t('Profiles'),
                        'url' => 'profiles',
                        'selected' => (($a->argc == 1) && ($a->argv[0] === 'profiles') ? 'active' : ''),
                        'accesskey' => 'p',
@@ -44,7 +44,7 @@ class BaseSettingsModule extends BaseModule
 
                if (Feature::get()) {
                        $tabs[] = [
-                               'label' => L10n::t('Additional features'),
+                               'label' => DI::l10n()->t('Additional features'),
                                'url' => 'settings/features',
                                'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
                                'accesskey' => 't',
@@ -52,49 +52,49 @@ class BaseSettingsModule extends BaseModule
                }
 
                $tabs[] = [
-                       'label' => L10n::t('Display'),
+                       'label' => DI::l10n()->t('Display'),
                        'url' => 'settings/display',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === 'display') ? 'active' : ''),
                        'accesskey' => 'i',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Social Networks'),
+                       'label' => DI::l10n()->t('Social Networks'),
                        'url' => 'settings/connectors',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors') ? 'active' : ''),
                        'accesskey' => 'w',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Addons'),
+                       'label' => DI::l10n()->t('Addons'),
                        'url' => 'settings/addon',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon') ? 'active' : ''),
                        'accesskey' => 'l',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Delegations'),
+                       'label' => DI::l10n()->t('Delegations'),
                        'url' => 'settings/delegation',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === 'delegation') ? 'active' : ''),
                        'accesskey' => 'd',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Connected apps'),
+                       'label' => DI::l10n()->t('Connected apps'),
                        'url' => 'settings/oauth',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth') ? 'active' : ''),
                        'accesskey' => 'b',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Export personal data'),
+                       'label' => DI::l10n()->t('Export personal data'),
                        'url' => 'settings/userexport',
                        'selected' => (($a->argc > 1) && ($a->argv[1] === 'userexport') ? 'active' : ''),
                        'accesskey' => 'e',
                ];
 
                $tabs[] = [
-                       'label' => L10n::t('Remove account'),
+                       'label' => DI::l10n()->t('Remove account'),
                        'url' => 'removeme',
                        'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme') ? 'active' : ''),
                        'accesskey' => 'r',
@@ -103,7 +103,7 @@ class BaseSettingsModule extends BaseModule
 
                $tabtpl = Renderer::getMarkupTemplate("generic_links_widget.tpl");
                DI::page()['aside'] = Renderer::replaceMacros($tabtpl, [
-                       '$title' => L10n::t('Settings'),
+                       '$title' => DI::l10n()->t('Settings'),
                        '$class' => 'settings-widget',
                        '$items' => $tabs,
                ]);
index 5cd908488eed42dfee08882ac7b4475bd8fce4b3..a5d4801a9fb77c0a9ebab7d1e15da4ceafa65508 100644 (file)
@@ -24,7 +24,7 @@ class Bookmarklet extends BaseModule
                $config = DI::config();
 
                if (!local_user()) {
-                       $output = '<h2>' . L10n::t('Login') . '</h2>';
+                       $output = '<h2>' . DI::l10n()->t('Login') . '</h2>';
                        $output .= Login::form(DI::args()->getQueryString(), intval($config->get('config', 'register_policy')) === Register::CLOSED ? false : true);
                        return $output;
                }
@@ -34,7 +34,7 @@ class Bookmarklet extends BaseModule
 
                if (!strstr($referer, $page)) {
                        if (empty($_REQUEST["url"])) {
-                               throw new HTTPException\BadRequestException(L10n::t('This page is missing a url parameter.'));
+                               throw new HTTPException\BadRequestException(DI::l10n()->t('This page is missing a url parameter.'));
                        }
 
                        $content = add_page_info($_REQUEST["url"]);
@@ -56,7 +56,7 @@ class Bookmarklet extends BaseModule
                        $output = status_editor($app, $x, 0, false);
                        $output .= "<script>window.resizeTo(800,550);</script>";
                } else {
-                       $output = '<h2>' . L10n::t('The post was created') . '</h2>';
+                       $output = '<h2>' . DI::l10n()->t('The post was created') . '</h2>';
                        $output .= "<script>window.close()</script>";
                }
 
index d618e2486a5c96235dd6cf86b2ba69a4930af8ae..183a1bd16dffccf5a46bae4de0922d0d895ec9b3 100644 (file)
@@ -94,7 +94,7 @@ class Contact extends BaseModule
                }
 
                if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user(), 'deleted' => false])) {
-                       notice(L10n::t('Could not access contact record.') . EOL);
+                       notice(DI::l10n()->t('Could not access contact record.') . EOL);
                        DI::baseUrl()->redirect('contact');
                        return; // NOTREACHED
                }
@@ -104,7 +104,7 @@ class Contact extends BaseModule
                $profile_id = intval($_POST['profile-assign'] ?? 0);
                if ($profile_id) {
                        if (!DBA::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
-                               notice(L10n::t('Could not locate selected profile.') . EOL);
+                               notice(DI::l10n()->t('Could not locate selected profile.') . EOL);
                                return;
                        }
                }
@@ -136,9 +136,9 @@ class Contact extends BaseModule
                );
 
                if (DBA::isResult($r)) {
-                       info(L10n::t('Contact updated.') . EOL);
+                       info(DI::l10n()->t('Contact updated.') . EOL);
                } else {
-                       notice(L10n::t('Failed to update contact record.') . EOL);
+                       notice(DI::l10n()->t('Failed to update contact record.') . EOL);
                }
 
                $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user(), 'deleted' => false]);
@@ -311,13 +311,13 @@ class Contact extends BaseModule
                                '$url'          => Model\Contact::magicLinkByContact($contact, $contact['url']),
                                '$addr'         => $contact['addr'] ?? '',
                                '$network_link' => $network_link,
-                               '$network'      => L10n::t('Network:'),
+                               '$network'      => DI::l10n()->t('Network:'),
                                '$account_type' => Model\Contact::getAccountType($contact),
-                               '$follow'       => L10n::t('Follow'),
+                               '$follow'       => DI::l10n()->t('Follow'),
                                '$follow_link'   => $follow_link,
-                               '$unfollow'     => L10n::t('Unfollow'),
+                               '$unfollow'     => DI::l10n()->t('Unfollow'),
                                '$unfollow_link' => $unfollow_link,
-                               '$wallmessage'  => L10n::t('Message'),
+                               '$wallmessage'  => DI::l10n()->t('Message'),
                                '$wallmessage_link' => $wallmessage_link,
                        ]);
 
@@ -356,7 +356,7 @@ class Contact extends BaseModule
                Nav::setSelected('contact');
 
                if (!local_user()) {
-                       notice(L10n::t('Permission denied.') . EOL);
+                       notice(DI::l10n()->t('Permission denied.') . EOL);
                        return Login::form();
                }
 
@@ -371,7 +371,7 @@ class Contact extends BaseModule
 
                        $orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false, 'deleted' => false]);
                        if (!DBA::isResult($orig_record)) {
-                               throw new NotFoundException(L10n::t('Contact not found'));
+                               throw new NotFoundException(DI::l10n()->t('Contact not found'));
                        }
 
                        if ($cmd === 'update' && ($orig_record['uid'] != 0)) {
@@ -390,7 +390,7 @@ class Contact extends BaseModule
                                self::blockContact($contact_id);
 
                                $blocked = Model\Contact::isBlockedByUser($contact_id, local_user());
-                               info(($blocked ? L10n::t('Contact has been blocked') : L10n::t('Contact has been unblocked')) . EOL);
+                               info(($blocked ? DI::l10n()->t('Contact has been blocked') : DI::l10n()->t('Contact has been unblocked')) . EOL);
 
                                DI::baseUrl()->redirect('contact/' . $contact_id);
                                // NOTREACHED
@@ -400,7 +400,7 @@ class Contact extends BaseModule
                                self::ignoreContact($contact_id);
 
                                $ignored = Model\Contact::isIgnoredByUser($contact_id, local_user());
-                               info(($ignored ? L10n::t('Contact has been ignored') : L10n::t('Contact has been unignored')) . EOL);
+                               info(($ignored ? DI::l10n()->t('Contact has been ignored') : DI::l10n()->t('Contact has been unignored')) . EOL);
 
                                DI::baseUrl()->redirect('contact/' . $contact_id);
                                // NOTREACHED
@@ -410,7 +410,7 @@ class Contact extends BaseModule
                                $r = self::archiveContact($contact_id, $orig_record);
                                if ($r) {
                                        $archived = (($orig_record['archive']) ? 0 : 1);
-                                       info((($archived) ? L10n::t('Contact has been archived') : L10n::t('Contact has been unarchived')) . EOL);
+                                       info((($archived) ? DI::l10n()->t('Contact has been archived') : DI::l10n()->t('Contact has been unarchived')) . EOL);
                                }
 
                                DI::baseUrl()->redirect('contact/' . $contact_id);
@@ -434,15 +434,15 @@ class Contact extends BaseModule
                                        DI::page()['aside'] = '';
 
                                        return Renderer::replaceMacros(Renderer::getMarkupTemplate('contact_drop_confirm.tpl'), [
-                                               '$header' => L10n::t('Drop contact'),
+                                               '$header' => DI::l10n()->t('Drop contact'),
                                                '$contact' => self::getContactTemplateVars($orig_record),
                                                '$method' => 'get',
-                                               '$message' => L10n::t('Do you really want to delete this contact?'),
+                                               '$message' => DI::l10n()->t('Do you really want to delete this contact?'),
                                                '$extra_inputs' => $inputs,
-                                               '$confirm' => L10n::t('Yes'),
+                                               '$confirm' => DI::l10n()->t('Yes'),
                                                '$confirm_url' => $query['base'],
                                                '$confirm_name' => 'confirmed',
-                                               '$cancel' => L10n::t('Cancel'),
+                                               '$cancel' => DI::l10n()->t('Cancel'),
                                        ]);
                                }
                                // Now check how the user responded to the confirmation query
@@ -451,7 +451,7 @@ class Contact extends BaseModule
                                }
 
                                self::dropContact($orig_record);
-                               info(L10n::t('Contact has been removed.') . EOL);
+                               info(DI::l10n()->t('Contact has been removed.') . EOL);
 
                                DI::baseUrl()->redirect('contact');
                                // NOTREACHED
@@ -481,17 +481,17 @@ class Contact extends BaseModule
                        switch ($contact['rel']) {
                                case Model\Contact::FRIEND:
                                        $dir_icon = 'images/lrarrow.gif';
-                                       $relation_text = L10n::t('You are mutual friends with %s');
+                                       $relation_text = DI::l10n()->t('You are mutual friends with %s');
                                        break;
 
                                case Model\Contact::FOLLOWER;
                                        $dir_icon = 'images/larrow.gif';
-                                       $relation_text = L10n::t('You are sharing with %s');
+                                       $relation_text = DI::l10n()->t('You are sharing with %s');
                                        break;
 
                                case Model\Contact::SHARING;
                                        $dir_icon = 'images/rarrow.gif';
-                                       $relation_text = L10n::t('%s is sharing with you');
+                                       $relation_text = DI::l10n()->t('%s is sharing with you');
                                        break;
 
                                default:
@@ -515,36 +515,36 @@ class Contact extends BaseModule
                                $sparkle = '';
                        }
 
-                       $insecure = L10n::t('Private communications are not available for this contact.');
+                       $insecure = DI::l10n()->t('Private communications are not available for this contact.');
 
-                       $last_update = (($contact['last-update'] <= DBA::NULL_DATETIME) ? L10n::t('Never') : DateTimeFormat::local($contact['last-update'], 'D, j M Y, g:i A'));
+                       $last_update = (($contact['last-update'] <= DBA::NULL_DATETIME) ? DI::l10n()->t('Never') : DateTimeFormat::local($contact['last-update'], 'D, j M Y, g:i A'));
 
                        if ($contact['last-update'] > DBA::NULL_DATETIME) {
-                               $last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? L10n::t('(Update was successful)') : L10n::t('(Update was not successful)'));
+                               $last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? DI::l10n()->t('(Update was successful)') : DI::l10n()->t('(Update was not successful)'));
                        }
-                       $lblsuggest = (($contact['network'] === Protocol::DFRN) ? L10n::t('Suggest friends') : '');
+                       $lblsuggest = (($contact['network'] === Protocol::DFRN) ? DI::l10n()->t('Suggest friends') : '');
 
                        $poll_enabled = in_array($contact['network'], [Protocol::DFRN, Protocol::OSTATUS, Protocol::FEED, Protocol::MAIL]);
 
-                       $nettype = L10n::t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact['url'], $contact['protocol']));
+                       $nettype = DI::l10n()->t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact['url'], $contact['protocol']));
 
                        // tabs
                        $tab_str = self::getTabsHTML($a, $contact, 3);
 
-                       $lost_contact = (($contact['archive'] && $contact['term-date'] > DBA::NULL_DATETIME && $contact['term-date'] < DateTimeFormat::utcNow()) ? L10n::t('Communications lost with this contact!') : '');
+                       $lost_contact = (($contact['archive'] && $contact['term-date'] > DBA::NULL_DATETIME && $contact['term-date'] < DateTimeFormat::utcNow()) ? DI::l10n()->t('Communications lost with this contact!') : '');
 
                        $fetch_further_information = null;
                        if ($contact['network'] == Protocol::FEED) {
                                $fetch_further_information = [
                                        'fetch_further_information',
-                                       L10n::t('Fetch further information for feeds'),
+                                       DI::l10n()->t('Fetch further information for feeds'),
                                        $contact['fetch_further_information'],
-                                       L10n::t('Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn\'t contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags.'),
+                                       DI::l10n()->t('Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn\'t contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags.'),
                                        [
-                                               '0' => L10n::t('Disabled'),
-                                               '1' => L10n::t('Fetch information'),
-                                               '3' => L10n::t('Fetch keywords'),
-                                               '2' => L10n::t('Fetch information and keywords')
+                                               '0' => DI::l10n()->t('Disabled'),
+                                               '1' => DI::l10n()->t('Fetch information'),
+                                               '3' => DI::l10n()->t('Fetch keywords'),
+                                               '2' => DI::l10n()->t('Fetch information and keywords')
                                        ]
                                ];
                        }
@@ -563,9 +563,9 @@ class Contact extends BaseModule
                        $contact_actions = self::getContactActions($contact);
 
                        if ($contact['uid'] != 0) {
-                               $lbl_vis1 = L10n::t('Profile Visibility');
-                               $lbl_info1 = L10n::t('Contact Information / Notes');
-                               $contact_settings_label = L10n::t('Contact Settings');
+                               $lbl_vis1 = DI::l10n()->t('Profile Visibility');
+                               $lbl_info1 = DI::l10n()->t('Contact Information / Notes');
+                               $contact_settings_label = DI::l10n()->t('Contact Settings');
                        } else {
                                $lbl_vis1 = null;
                                $lbl_info1 = null;
@@ -574,67 +574,67 @@ class Contact extends BaseModule
 
                        $tpl = Renderer::getMarkupTemplate('contact_edit.tpl');
                        $o .= Renderer::replaceMacros($tpl, [
-                               '$header'         => L10n::t('Contact'),
+                               '$header'         => DI::l10n()->t('Contact'),
                                '$tab_str'        => $tab_str,
-                               '$submit'         => L10n::t('Submit'),
+                               '$submit'         => DI::l10n()->t('Submit'),
                                '$lbl_vis1'       => $lbl_vis1,
-                               '$lbl_vis2'       => L10n::t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
+                               '$lbl_vis2'       => DI::l10n()->t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
                                '$lbl_info1'      => $lbl_info1,
-                               '$lbl_info2'      => L10n::t('Their personal note'),
+                               '$lbl_info2'      => DI::l10n()->t('Their personal note'),
                                '$reason'         => trim(Strings::escapeTags($contact['reason'])),
-                               '$infedit'        => L10n::t('Edit contact notes'),
+                               '$infedit'        => DI::l10n()->t('Edit contact notes'),
                                '$common_link'    => 'common/loc/' . local_user() . '/' . $contact['id'],
                                '$relation_text'  => $relation_text,
-                               '$visit'          => L10n::t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
-                               '$blockunblock'   => L10n::t('Block/Unblock contact'),
-                               '$ignorecont'     => L10n::t('Ignore contact'),
-                               '$lblcrepair'     => L10n::t('Repair URL settings'),
-                               '$lblrecent'      => L10n::t('View conversations'),
+                               '$visit'          => DI::l10n()->t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
+                               '$blockunblock'   => DI::l10n()->t('Block/Unblock contact'),
+                               '$ignorecont'     => DI::l10n()->t('Ignore contact'),
+                               '$lblcrepair'     => DI::l10n()->t('Repair URL settings'),
+                               '$lblrecent'      => DI::l10n()->t('View conversations'),
                                '$lblsuggest'     => $lblsuggest,
                                '$nettype'        => $nettype,
                                '$poll_interval'  => $poll_interval,
                                '$poll_enabled'   => $poll_enabled,
-                               '$lastupdtext'    => L10n::t('Last update:'),
+                               '$lastupdtext'    => DI::l10n()->t('Last update:'),
                                '$lost_contact'   => $lost_contact,
-                               '$updpub'         => L10n::t('Update public posts'),
+                               '$updpub'         => DI::l10n()->t('Update public posts'),
                                '$last_update'    => $last_update,
-                               '$udnow'          => L10n::t('Update now'),
+                               '$udnow'          => DI::l10n()->t('Update now'),
                                '$profile_select' => $profile_select,
                                '$contact_id'     => $contact['id'],
-                               '$block_text'     => ($contact['blocked'] ? L10n::t('Unblock') : L10n::t('Block')),
-                               '$ignore_text'    => ($contact['readonly'] ? L10n::t('Unignore') : L10n::t('Ignore')),
+                               '$block_text'     => ($contact['blocked'] ? DI::l10n()->t('Unblock') : DI::l10n()->t('Block')),
+                               '$ignore_text'    => ($contact['readonly'] ? DI::l10n()->t('Unignore') : DI::l10n()->t('Ignore')),
                                '$insecure'       => (in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA]) ? '' : $insecure),
                                '$info'           => $contact['info'],
                                '$cinfo'          => ['info', '', $contact['info'], ''],
-                               '$blocked'        => ($contact['blocked'] ? L10n::t('Currently blocked') : ''),
-                               '$ignored'        => ($contact['readonly'] ? L10n::t('Currently ignored') : ''),
-                               '$archived'       => ($contact['archive'] ? L10n::t('Currently archived') : ''),
-                               '$pending'        => ($contact['pending'] ? L10n::t('Awaiting connection acknowledge') : ''),
-                               '$hidden'         => ['hidden', L10n::t('Hide this contact from others'), ($contact['hidden'] == 1), L10n::t('Replies/likes to your public posts <strong>may</strong> still be visible')],
-                               '$notify'         => ['notify', L10n::t('Notification for new posts'), ($contact['notify_new_posts'] == 1), L10n::t('Send a notification of every new post of this contact')],
+                               '$blocked'        => ($contact['blocked'] ? DI::l10n()->t('Currently blocked') : ''),
+                               '$ignored'        => ($contact['readonly'] ? DI::l10n()->t('Currently ignored') : ''),
+                               '$archived'       => ($contact['archive'] ? DI::l10n()->t('Currently archived') : ''),
+                               '$pending'        => ($contact['pending'] ? DI::l10n()->t('Awaiting connection acknowledge') : ''),
+                               '$hidden'         => ['hidden', DI::l10n()->t('Hide this contact from others'), ($contact['hidden'] == 1), DI::l10n()->t('Replies/likes to your public posts <strong>may</strong> still be visible')],
+                               '$notify'         => ['notify', DI::l10n()->t('Notification for new posts'), ($contact['notify_new_posts'] == 1), DI::l10n()->t('Send a notification of every new post of this contact')],
                                '$fetch_further_information' => $fetch_further_information,
-                               '$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', L10n::t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], L10n::t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
+                               '$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', DI::l10n()->t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], DI::l10n()->t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
                                '$photo'          => $contact['photo'],
                                '$name'           => $contact['name'],
                                '$dir_icon'       => $dir_icon,
                                '$sparkle'        => $sparkle,
                                '$url'            => $url,
-                               '$profileurllabel'=> L10n::t('Profile URL'),
+                               '$profileurllabel'=> DI::l10n()->t('Profile URL'),
                                '$profileurl'     => $contact['url'],
                                '$account_type'   => Model\Contact::getAccountType($contact),
                                '$location'       => BBCode::convert($contact['location']),
-                               '$location_label' => L10n::t('Location:'),
+                               '$location_label' => DI::l10n()->t('Location:'),
                                '$xmpp'           => BBCode::convert($contact['xmpp']),
-                               '$xmpp_label'     => L10n::t('XMPP:'),
+                               '$xmpp_label'     => DI::l10n()->t('XMPP:'),
                                '$about'          => BBCode::convert($contact['about'], false),
-                               '$about_label'    => L10n::t('About:'),
+                               '$about_label'    => DI::l10n()->t('About:'),
                                '$keywords'       => $contact['keywords'],
-                               '$keywords_label' => L10n::t('Tags:'),
-                               '$contact_action_button' => L10n::t('Actions'),
+                               '$keywords_label' => DI::l10n()->t('Tags:'),
+                               '$contact_action_button' => DI::l10n()->t('Actions'),
                                '$contact_actions'=> $contact_actions,
-                               '$contact_status' => L10n::t('Status'),
+                               '$contact_status' => DI::l10n()->t('Status'),
                                '$contact_settings_label' => $contact_settings_label,
-                               '$contact_profile_label' => L10n::t('Profile'),
+                               '$contact_profile_label' => DI::l10n()->t('Profile'),
                        ]);
 
                        $arr = ['contact' => $contact, 'output' => $o];
@@ -680,58 +680,58 @@ class Contact extends BaseModule
 
                $tabs = [
                        [
-                               'label' => L10n::t('All Contacts'),
+                               'label' => DI::l10n()->t('All Contacts'),
                                'url'   => 'contact',
                                'sel'   => !$type ? 'active' : '',
-                               'title' => L10n::t('Show all contacts'),
+                               'title' => DI::l10n()->t('Show all contacts'),
                                'id'    => 'showall-tab',
                                'accesskey' => 'l',
                        ],
                        [
-                               'label' => L10n::t('Pending'),
+                               'label' => DI::l10n()->t('Pending'),
                                'url'   => 'contact/pending',
                                'sel'   => $type == 'pending' ? 'active' : '',
-                               'title' => L10n::t('Only show pending contacts'),
+                               'title' => DI::l10n()->t('Only show pending contacts'),
                                'id'    => 'showpending-tab',
                                'accesskey' => 'p',
                        ],
                        [
-                               'label' => L10n::t('Blocked'),
+                               'label' => DI::l10n()->t('Blocked'),
                                'url'   => 'contact/blocked',
                                'sel'   => $type == 'blocked' ? 'active' : '',
-                               'title' => L10n::t('Only show blocked contacts'),
+                               'title' => DI::l10n()->t('Only show blocked contacts'),
                                'id'    => 'showblocked-tab',
                                'accesskey' => 'b',
                        ],
                        [
-                               'label' => L10n::t('Ignored'),
+                               'label' => DI::l10n()->t('Ignored'),
                                'url'   => 'contact/ignored',
                                'sel'   => $type == 'ignored' ? 'active' : '',
-                               'title' => L10n::t('Only show ignored contacts'),
+                               'title' => DI::l10n()->t('Only show ignored contacts'),
                                'id'    => 'showignored-tab',
                                'accesskey' => 'i',
                        ],
                        [
-                               'label' => L10n::t('Archived'),
+                               'label' => DI::l10n()->t('Archived'),
                                'url'   => 'contact/archived',
                                'sel'   => $type == 'archived' ? 'active' : '',
-                               'title' => L10n::t('Only show archived contacts'),
+                               'title' => DI::l10n()->t('Only show archived contacts'),
                                'id'    => 'showarchived-tab',
                                'accesskey' => 'y',
                        ],
                        [
-                               'label' => L10n::t('Hidden'),
+                               'label' => DI::l10n()->t('Hidden'),
                                'url'   => 'contact/hidden',
                                'sel'   => $type == 'hidden' ? 'active' : '',
-                               'title' => L10n::t('Only show hidden contacts'),
+                               'title' => DI::l10n()->t('Only show hidden contacts'),
                                'id'    => 'showhidden-tab',
                                'accesskey' => 'h',
                        ],
                        [
-                               'label' => L10n::t('Groups'),
+                               'label' => DI::l10n()->t('Groups'),
                                'url'   => 'group',
                                'sel'   => '',
-                               'title' => L10n::t('Organize your contact groups'),
+                               'title' => DI::l10n()->t('Organize your contact groups'),
                                'id'    => 'contactgroups-tab',
                                'accesskey' => 'e',
                        ],
@@ -791,18 +791,18 @@ class Contact extends BaseModule
                }
 
                switch ($rel) {
-                       case 'followers': $header = L10n::t('Followers'); break;
-                       case 'following': $header = L10n::t('Following'); break;
-                       case 'mutuals':   $header = L10n::t('Mutual friends'); break;
-                       default:          $header = L10n::t('Contacts');
+                       case 'followers': $header = DI::l10n()->t('Followers'); break;
+                       case 'following': $header = DI::l10n()->t('Following'); break;
+                       case 'mutuals':   $header = DI::l10n()->t('Mutual friends'); break;
+                       default:          $header = DI::l10n()->t('Contacts');
                }
 
                switch ($type) {
-                       case 'pending':  $header .= ' - ' . L10n::t('Pending'); break;
-                       case 'blocked':  $header .= ' - ' . L10n::t('Blocked'); break;
-                       case 'hidden':   $header .= ' - ' . L10n::t('Hidden'); break;
-                       case 'ignored':  $header .= ' - ' . L10n::t('Ignored'); break;
-                       case 'archived': $header .= ' - ' . L10n::t('Archived'); break;
+                       case 'pending':  $header .= ' - ' . DI::l10n()->t('Pending'); break;
+                       case 'blocked':  $header .= ' - ' . DI::l10n()->t('Blocked'); break;
+                       case 'hidden':   $header .= ' - ' . DI::l10n()->t('Hidden'); break;
+                       case 'ignored':  $header .= ' - ' . DI::l10n()->t('Ignored'); break;
+                       case 'archived': $header .= ' - ' . DI::l10n()->t('Archived'); break;
                }
 
                $header .= $nets ? ' - ' . ContactSelector::networkToName($nets) : '';
@@ -813,21 +813,21 @@ class Contact extends BaseModule
                        '$tabs'       => $t,
                        '$total'      => $total,
                        '$search'     => $search_hdr,
-                       '$desc'       => L10n::t('Search your contacts'),
-                       '$finding'    => $searching ? L10n::t('Results for: %s', $search) : '',
-                       '$submit'     => L10n::t('Find'),
+                       '$desc'       => DI::l10n()->t('Search your contacts'),
+                       '$finding'    => $searching ? DI::l10n()->t('Results for: %s', $search) : '',
+                       '$submit'     => DI::l10n()->t('Find'),
                        '$cmd'        => DI::args()->getCommand(),
                        '$contacts'   => $contacts,
-                       '$contact_drop_confirm' => L10n::t('Do you really want to delete this contact?'),
+                       '$contact_drop_confirm' => DI::l10n()->t('Do you really want to delete this contact?'),
                        'multiselect' => 1,
                        '$batch_actions' => [
-                               'contacts_batch_update'  => L10n::t('Update'),
-                               'contacts_batch_block'   => L10n::t('Block') . '/' . L10n::t('Unblock'),
-                               'contacts_batch_ignore'  => L10n::t('Ignore') . '/' . L10n::t('Unignore'),
-                               'contacts_batch_archive' => L10n::t('Archive') . '/' . L10n::t('Unarchive'),
-                               'contacts_batch_drop'    => L10n::t('Delete'),
+                               'contacts_batch_update'  => DI::l10n()->t('Update'),
+                               'contacts_batch_block'   => DI::l10n()->t('Block') . '/' . DI::l10n()->t('Unblock'),
+                               'contacts_batch_ignore'  => DI::l10n()->t('Ignore') . '/' . DI::l10n()->t('Unignore'),
+                               'contacts_batch_archive' => DI::l10n()->t('Archive') . '/' . DI::l10n()->t('Unarchive'),
+                               'contacts_batch_drop'    => DI::l10n()->t('Delete'),
                        ],
-                       '$h_batch_actions' => L10n::t('Batch Actions'),
+                       '$h_batch_actions' => DI::l10n()->t('Batch Actions'),
                        '$paginate'   => $pager->renderFull($total),
                ]);
 
@@ -851,26 +851,26 @@ class Contact extends BaseModule
                // tabs
                $tabs = [
                        [
-                               'label' => L10n::t('Status'),
+                               'label' => DI::l10n()->t('Status'),
                                'url'   => "contact/" . $contact['id'] . "/conversations",
                                'sel'   => (($active_tab == 1) ? 'active' : ''),
-                               'title' => L10n::t('Conversations started by this contact'),
+                               'title' => DI::l10n()->t('Conversations started by this contact'),
                                'id'    => 'status-tab',
                                'accesskey' => 'm',
                        ],
                        [
-                               'label' => L10n::t('Posts and Comments'),
+                               'label' => DI::l10n()->t('Posts and Comments'),
                                'url'   => "contact/" . $contact['id'] . "/posts",
                                'sel'   => (($active_tab == 2) ? 'active' : ''),
-                               'title' => L10n::t('Status Messages and Posts'),
+                               'title' => DI::l10n()->t('Status Messages and Posts'),
                                'id'    => 'posts-tab',
                                'accesskey' => 'p',
                        ],
                        [
-                               'label' => L10n::t('Profile'),
+                               'label' => DI::l10n()->t('Profile'),
                                'url'   => "contact/" . $contact['id'],
                                'sel'   => (($active_tab == 3) ? 'active' : ''),
-                               'title' => L10n::t('Profile Details'),
+                               'title' => DI::l10n()->t('Profile Details'),
                                'id'    => 'profile-tab',
                                'accesskey' => 'o',
                        ]
@@ -879,10 +879,10 @@ class Contact extends BaseModule
                // Show this tab only if there is visible friend list
                $x = Model\GContact::countAllFriends(local_user(), $contact['id']);
                if ($x) {
-                       $tabs[] = ['label' => L10n::t('Contacts'),
+                       $tabs[] = ['label' => DI::l10n()->t('Contacts'),
                                'url'   => "allfriends/" . $contact['id'],
                                'sel'   => (($active_tab == 4) ? 'active' : ''),
-                               'title' => L10n::t('View all contacts'),
+                               'title' => DI::l10n()->t('View all contacts'),
                                'id'    => 'allfriends-tab',
                                'accesskey' => 't'];
                }
@@ -890,20 +890,20 @@ class Contact extends BaseModule
                // Show this tab only if there is visible common friend list
                $common = Model\GContact::countCommonFriends(local_user(), $contact['id']);
                if ($common) {
-                       $tabs[] = ['label' => L10n::t('Common Friends'),
+                       $tabs[] = ['label' => DI::l10n()->t('Common Friends'),
                                'url'   => "common/loc/" . local_user() . "/" . $contact['id'],
                                'sel'   => (($active_tab == 5) ? 'active' : ''),
-                               'title' => L10n::t('View all common friends'),
+                               'title' => DI::l10n()->t('View all common friends'),
                                'id'    => 'common-loc-tab',
                                'accesskey' => 'd'
                        ];
                }
 
                if (!empty($contact['uid'])) {
-                       $tabs[] = ['label' => L10n::t('Advanced'),
+                       $tabs[] = ['label' => DI::l10n()->t('Advanced'),
                                'url'   => 'crepair/' . $contact['id'],
                                'sel'   => (($active_tab == 6) ? 'active' : ''),
-                               'title' => L10n::t('Advanced Contact Settings'),
+                               'title' => DI::l10n()->t('Advanced Contact Settings'),
                                'id'    => 'advanced-tab',
                                'accesskey' => 'r'
                        ];
@@ -986,17 +986,17 @@ class Contact extends BaseModule
                        switch ($rr['rel']) {
                                case Model\Contact::FRIEND:
                                        $dir_icon = 'images/lrarrow.gif';
-                                       $alt_text = L10n::t('Mutual Friendship');
+                                       $alt_text = DI::l10n()->t('Mutual Friendship');
                                        break;
 
                                case Model\Contact::FOLLOWER;
                                        $dir_icon = 'images/larrow.gif';
-                                       $alt_text = L10n::t('is a fan of yours');
+                                       $alt_text = DI::l10n()->t('is a fan of yours');
                                        break;
 
                                case Model\Contact::SHARING;
                                        $dir_icon = 'images/rarrow.gif';
-                                       $alt_text = L10n::t('you are a fan of');
+                                       $alt_text = DI::l10n()->t('you are a fan of');
                                        break;
 
                                default:
@@ -1014,22 +1014,22 @@ class Contact extends BaseModule
 
                if ($rr['pending']) {
                        if (in_array($rr['rel'], [Model\Contact::FRIEND, Model\Contact::SHARING])) {
-                               $alt_text = L10n::t('Pending outgoing contact request');
+                               $alt_text = DI::l10n()->t('Pending outgoing contact request');
                        } else {
-                               $alt_text = L10n::t('Pending incoming contact request');
+                               $alt_text = DI::l10n()->t('Pending incoming contact request');
                        }
                }
 
                if ($rr['self']) {
                        $dir_icon = 'images/larrow.gif';
-                       $alt_text = L10n::t('This is you');
+                       $alt_text = DI::l10n()->t('This is you');
                        $url = $rr['url'];
                        $sparkle = '';
                }
 
                return [
-                       'img_hover' => L10n::t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
-                       'edit_hover'=> L10n::t('Edit contact'),
+                       'img_hover' => DI::l10n()->t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
+                       'edit_hover'=> DI::l10n()->t('Edit contact'),
                        'photo_menu'=> Model\Contact::photoMenu($rr),
                        'id'        => $rr['id'],
                        'alt_text'  => $alt_text,
@@ -1062,7 +1062,7 @@ class Contact extends BaseModule
                // Provide friend suggestion only for Friendica contacts
                if ($contact['network'] === Protocol::DFRN) {
                        $contact_actions['suggest'] = [
-                               'label' => L10n::t('Suggest friends'),
+                               'label' => DI::l10n()->t('Suggest friends'),
                                'url'   => 'fsuggest/' . $contact['id'],
                                'title' => '',
                                'sel'   => '',
@@ -1072,7 +1072,7 @@ class Contact extends BaseModule
 
                if ($poll_enabled) {
                        $contact_actions['update'] = [
-                               'label' => L10n::t('Update now'),
+                               'label' => DI::l10n()->t('Update now'),
                                'url'   => 'contact/' . $contact['id'] . '/update',
                                'title' => '',
                                'sel'   => '',
@@ -1081,34 +1081,34 @@ class Contact extends BaseModule
                }
 
                $contact_actions['block'] = [
-                       'label' => (intval($contact['blocked']) ? L10n::t('Unblock') : L10n::t('Block')),
+                       'label' => (intval($contact['blocked']) ? DI::l10n()->t('Unblock') : DI::l10n()->t('Block')),
                        'url'   => 'contact/' . $contact['id'] . '/block',
-                       'title' => L10n::t('Toggle Blocked status'),
+                       'title' => DI::l10n()->t('Toggle Blocked status'),
                        'sel'   => (intval($contact['blocked']) ? 'active' : ''),
                        'id'    => 'toggle-block',
                ];
 
                $contact_actions['ignore'] = [
-                       'label' => (intval($contact['readonly']) ? L10n::t('Unignore') : L10n::t('Ignore')),
+                       'label' => (intval($contact['readonly']) ? DI::l10n()->t('Unignore') : DI::l10n()->t('Ignore')),
                        'url'   => 'contact/' . $contact['id'] . '/ignore',
-                       'title' => L10n::t('Toggle Ignored status'),
+                       'title' => DI::l10n()->t('Toggle Ignored status'),
                        'sel'   => (intval($contact['readonly']) ? 'active' : ''),
                        'id'    => 'toggle-ignore',
                ];
 
                if ($contact['uid'] != 0) {
                        $contact_actions['archive'] = [
-                               'label' => (intval($contact['archive']) ? L10n::t('Unarchive') : L10n::t('Archive')),
+                               'label' => (intval($contact['archive']) ? DI::l10n()->t('Unarchive') : DI::l10n()->t('Archive')),
                                'url'   => 'contact/' . $contact['id'] . '/archive',
-                               'title' => L10n::t('Toggle Archive status'),
+                               'title' => DI::l10n()->t('Toggle Archive status'),
                                'sel'   => (intval($contact['archive']) ? 'active' : ''),
                                'id'    => 'toggle-archive',
                        ];
 
                        $contact_actions['delete'] = [
-                               'label' => L10n::t('Delete'),
+                               'label' => DI::l10n()->t('Delete'),
                                'url'   => 'contact/' . $contact['id'] . '/drop',
-                               'title' => L10n::t('Delete contact'),
+                               'title' => DI::l10n()->t('Delete contact'),
                                'sel'   => '',
                                'id'    => 'delete',
                        ];
index c536dcaa5e8fae16f5d77215a91d2853bc08b2c4..9e0e4d4eaf0541b283f0fa51a6d321e0f305d69e 100644 (file)
@@ -22,8 +22,8 @@ class Credits extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('credits.tpl');
                return Renderer::replaceMacros($tpl, [
-                       '$title'  => L10n::t('Credits'),
-                       '$thanks' => L10n::t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
+                       '$title'  => DI::l10n()->t('Credits'),
+                       '$thanks' => DI::l10n()->t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
                        '$names'  => $names,
                ]);
        }
index edd897be87c608d4f2b478cc8ffc49e427a56460..528e553440b7b9ab867f07a8e09d5c01ecd92bfc 100644 (file)
@@ -29,58 +29,58 @@ class Babel extends BaseModule
                                case 'bbcode':
                                        $bbcode = trim($_REQUEST['text']);
                                        $results[] = [
-                                               'title'   => L10n::t('Source input'),
+                                               'title'   => DI::l10n()->t('Source input'),
                                                'content' => visible_whitespace($bbcode)
                                        ];
 
                                        $plain = Text\BBCode::toPlaintext($bbcode, false);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::toPlaintext'),
+                                               'title'   => DI::l10n()->t('BBCode::toPlaintext'),
                                                'content' => visible_whitespace($plain)
                                        ];
 
                                        $html = Text\BBCode::convert($bbcode);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::convert (raw HTML)'),
+                                               'title'   => DI::l10n()->t('BBCode::convert (raw HTML)'),
                                                'content' => visible_whitespace(htmlspecialchars($html))
                                        ];
 
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::convert'),
+                                               'title'   => DI::l10n()->t('BBCode::convert'),
                                                'content' => $html
                                        ];
 
                                        $bbcode2 = Text\HTML::toBBCode($html);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::convert => HTML::toBBCode'),
+                                               'title'   => DI::l10n()->t('BBCode::convert => HTML::toBBCode'),
                                                'content' => visible_whitespace($bbcode2)
                                        ];
 
                                        $markdown = Text\BBCode::toMarkdown($bbcode);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown'),
+                                               'title'   => DI::l10n()->t('BBCode::toMarkdown'),
                                                'content' => visible_whitespace(htmlspecialchars($markdown))
                                        ];
 
                                        $html2 = Text\Markdown::convert($markdown);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::convert (raw HTML)'),
+                                               'title'   => DI::l10n()->t('BBCode::toMarkdown => Markdown::convert (raw HTML)'),
                                                'content' => visible_whitespace(htmlspecialchars($html2))
                                        ];
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::convert'),
+                                               'title'   => DI::l10n()->t('BBCode::toMarkdown => Markdown::convert'),
                                                'content' => $html2
                                        ];
 
                                        $bbcode3 = Text\Markdown::toBBCode($markdown);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown => Markdown::toBBCode'),
+                                               'title'   => DI::l10n()->t('BBCode::toMarkdown => Markdown::toBBCode'),
                                                'content' => visible_whitespace($bbcode3)
                                        ];
 
                                        $bbcode4 = Text\HTML::toBBCode($html2);
                                        $results[] = [
-                                               'title'   => L10n::t('BBCode::toMarkdown =>  Markdown::convert => HTML::toBBCode'),
+                                               'title'   => DI::l10n()->t('BBCode::toMarkdown =>  Markdown::convert => HTML::toBBCode'),
                                                'content' => visible_whitespace($bbcode4)
                                        ];
 
@@ -91,88 +91,88 @@ class Babel extends BaseModule
 
                                        Item::setHashtags($item);
                                        $results[] = [
-                                               'title'   => L10n::t('Item Body'),
+                                               'title'   => DI::l10n()->t('Item Body'),
                                                'content' => visible_whitespace($item['body'])
                                        ];
                                        $results[] = [
-                                               'title'   => L10n::t('Item Tags'),
+                                               'title'   => DI::l10n()->t('Item Tags'),
                                                'content' => $item['tag']
                                        ];
                                        break;
                                case 'markdown':
                                        $markdown = trim($_REQUEST['text']);
                                        $results[] = [
-                                               'title'   => L10n::t('Source input (Diaspora format)'),
+                                               'title'   => DI::l10n()->t('Source input (Diaspora format)'),
                                                'content' => '<pre>' . htmlspecialchars($markdown) . '</pre>'
                                        ];
 
                                        $html = Text\Markdown::convert(html_entity_decode($markdown,ENT_COMPAT, 'UTF-8'));
                                        $results[] = [
-                                               'title'   => L10n::t('Markdown::convert (raw HTML)'),
+                                               'title'   => DI::l10n()->t('Markdown::convert (raw HTML)'),
                                                'content' => visible_whitespace(htmlspecialchars($html))
                                        ];
 
                                        $results[] = [
-                                               'title'   => L10n::t('Markdown::convert'),
+                                               'title'   => DI::l10n()->t('Markdown::convert'),
                                                'content' => $html
                                        ];
 
                                        $bbcode = Text\Markdown::toBBCode(XML::unescape($markdown));
                                        $results[] = [
-                                               'title'   => L10n::t('Markdown::toBBCode'),
+                                               'title'   => DI::l10n()->t('Markdown::toBBCode'),
                                                'content' => '<pre>' . $bbcode . '</pre>'
                                        ];
                                        break;
                                case 'html' :
                                        $html = trim($_REQUEST['text']);
                                        $results[] = [
-                                               'title'   => L10n::t('Raw HTML input'),
+                                               'title'   => DI::l10n()->t('Raw HTML input'),
                                                'content' => htmlspecialchars($html)
                                        ];
 
                                        $results[] = [
-                                               'title'   => L10n::t('HTML Input'),
+                                               'title'   => DI::l10n()->t('HTML Input'),
                                                'content' => $html
                                        ];
 
                                        $bbcode = Text\HTML::toBBCode($html);
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode'),
+                                               'title'   => DI::l10n()->t('HTML::toBBCode'),
                                                'content' => visible_whitespace($bbcode)
                                        ];
 
                                        $html2 = Text\BBCode::convert($bbcode);
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode => BBCode::convert'),
+                                               'title'   => DI::l10n()->t('HTML::toBBCode => BBCode::convert'),
                                                'content' => $html2
                                        ];
 
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode => BBCode::convert (raw HTML)'),
+                                               'title'   => DI::l10n()->t('HTML::toBBCode => BBCode::convert (raw HTML)'),
                                                'content' => htmlspecialchars($html2)
                                        ];
 
                                        $bbcode2plain = Text\BBCode::toPlaintext($bbcode);
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toBBCode => BBCode::toPlaintext'),
+                                               'title'   => DI::l10n()->t('HTML::toBBCode => BBCode::toPlaintext'),
                                                'content' => '<pre>' . $bbcode2plain . '</pre>'
                                        ];
 
                                        $markdown = Text\HTML::toMarkdown($html);
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toMarkdown'),
+                                               'title'   => DI::l10n()->t('HTML::toMarkdown'),
                                                'content' => visible_whitespace($markdown)
                                        ];
 
                                        $text = Text\HTML::toPlaintext($html, 0);
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toPlaintext'),
+                                               'title'   => DI::l10n()->t('HTML::toPlaintext'),
                                                'content' => '<pre>' . $text . '</pre>'
                                        ];
 
                                        $text = Text\HTML::toPlaintext($html, 0, true);
                                        $results[] = [
-                                               'title'   => L10n::t('HTML::toPlaintext (compact)'),
+                                               'title'   => DI::l10n()->t('HTML::toPlaintext (compact)'),
                                                'content' => '<pre>' . $text . '</pre>'
                                        ];
                        }
@@ -180,10 +180,10 @@ class Babel extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('babel.tpl');
                $o = Renderer::replaceMacros($tpl, [
-                       '$text'          => ['text', L10n::t('Source text'), $_REQUEST['text'] ?? '', ''],
-                       '$type_bbcode'   => ['type', L10n::t('BBCode'), 'bbcode', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'bbcode'],
-                       '$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'markdown'],
-                       '$type_html'     => ['type', L10n::t('HTML'), 'html', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'html'],
+                       '$text'          => ['text', DI::l10n()->t('Source text'), $_REQUEST['text'] ?? '', ''],
+                       '$type_bbcode'   => ['type', DI::l10n()->t('BBCode'), 'bbcode', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'bbcode'],
+                       '$type_markdown' => ['type', DI::l10n()->t('Markdown'), 'markdown', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'markdown'],
+                       '$type_html'     => ['type', DI::l10n()->t('HTML'), 'html', '', (($_REQUEST['type'] ?? '') ?: 'bbcode') == 'html'],
                        '$results'       => $results
                ]);
 
index f3e8af0c5736c49d1d8ff97304adb2686ca88c34..d3c0639b79be598eb771d0726811cfd8d0f89fb4 100644 (file)
@@ -18,7 +18,7 @@ class Feed extends BaseModule
        public static function init(array $parameters = [])
        {
                if (!local_user()) {
-                       info(L10n::t('You must be logged in to use this module'));
+                       info(DI::l10n()->t('You must be logged in to use this module'));
                        DI::baseUrl()->redirect();
                }
        }
@@ -44,7 +44,7 @@ class Feed extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('feedtest.tpl');
                return Renderer::replaceMacros($tpl, [
-                       '$url'    => ['url', L10n::t('Source URL'), $_REQUEST['url'] ?? '', ''],
+                       '$url'    => ['url', DI::l10n()->t('Source URL'), $_REQUEST['url'] ?? '', ''],
                        '$result' => $result
                ]);
        }
index d32e1f6c2dc8fd4fc5a33341e0669416fb7e679e..388b497ecbc5b742fad5a2a503a6c1b5e1c41a61 100644 (file)
@@ -16,7 +16,7 @@ class ItemBody extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));
+                       throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
                }
 
                $app = DI::app();
@@ -25,7 +25,7 @@ class ItemBody extends BaseModule
                $itemId = (($app->argc > 1) ? intval($app->argv[1]) : 0);
 
                if (!$itemId) {
-                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
+                       throw new HTTPException\NotFoundException(DI::l10n()->t('Item not found.'));
                }
 
                $item = Item::selectFirst(['body'], ['uid' => local_user(), 'id' => $itemId]);
@@ -38,7 +38,7 @@ class ItemBody extends BaseModule
                                return str_replace("\n", '<br />', $item['body']);
                        }
                } else {
-                       throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
+                       throw new HTTPException\NotFoundException(DI::l10n()->t('Item not found.'));
                }
        }
 }
index d9e2489790d77751cd9750d18078494af11c2f58..5d2e22a6f42017709d8d90ea3a4f2228c6c296ba 100644 (file)
@@ -15,7 +15,7 @@ class Localtime extends BaseModule
        {
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
-               $bd_format = L10n::t('l F d, Y \@ g:i A');
+               $bd_format = DI::l10n()->t('l F d, Y \@ g:i A');
 
                if (!empty($_POST['timezone'])) {
                        DI::app()->data['mod-localtime'] = DateTimeFormat::convert($time, $_POST['timezone'], 'UTC', $bd_format);
@@ -28,22 +28,22 @@ class Localtime extends BaseModule
 
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
-               $output  = '<h3>' . L10n::t('Time Conversion') . '</h3>';
-               $output .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
-               $output .= '<p>' . L10n::t('UTC time: %s', $time) . '</p>';
+               $output  = '<h3>' . DI::l10n()->t('Time Conversion') . '</h3>';
+               $output .= '<p>' . DI::l10n()->t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
+               $output .= '<p>' . DI::l10n()->t('UTC time: %s', $time) . '</p>';
 
                if (!empty($_REQUEST['timezone'])) {
-                       $output .= '<p>' . L10n::t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
+                       $output .= '<p>' . DI::l10n()->t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
                }
 
                if (!empty($app->data['mod-localtime'])) {
-                       $output .= '<p>' . L10n::t('Converted localtime: %s', $app->data['mod-localtime']) . '</p>';
+                       $output .= '<p>' . DI::l10n()->t('Converted localtime: %s', $app->data['mod-localtime']) . '</p>';
                }
 
                $output .= '<form action ="' . DI::baseUrl()->get() . '/localtime?time=' . $time . '" method="post" >';
-               $output .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
+               $output .= '<p>' . DI::l10n()->t('Please select your timezone:') . '</p>';
                $output .= Temporal::getTimezoneSelect(($_REQUEST['timezone'] ?? '') ?: Installer::DEFAULT_TZ);
-               $output .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';
+               $output .= '<input type="submit" name="submit" value="' . DI::l10n()->t('Submit') . '" /></form>';
 
                return $output;
        }
index 85c5f900fad4fc2d3c927665eb61b8d435c8e3fb..b5380c536fb2461776d66807322f5e4258d93fc2 100644 (file)
@@ -16,8 +16,8 @@ class Probe extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       $e           = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
-                       $e->httpdesc = L10n::t('Public access denied.');
+                       $e           = new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
+                       $e->httpdesc = DI::l10n()->t('Public access denied.');
                        throw $e;
                }
 
@@ -32,7 +32,7 @@ class Probe extends BaseModule
                $tpl = Renderer::getMarkupTemplate('probe.tpl');
                return Renderer::replaceMacros($tpl, [
                        '$addr' => ['addr',
-                               L10n::t('Lookup address'),
+                               DI::l10n()->t('Lookup address'),
                                $addr,
                                '',
                                'required'
index 90da40bf09d12d5e15a289b5eea203965e570b3b..ad3963cb9af2015b7dc94d562d4567d3f49ee66d 100644 (file)
@@ -15,8 +15,8 @@ class WebFinger extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       $e           = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
-                       $e->httpdesc = L10n::t('Public access denied.');
+                       $e           = new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
+                       $e->httpdesc = DI::l10n()->t('Public access denied.');
                        throw $e;
                }
 
index cb2f24ce1e3f84d9166abf292799e1424809a4f9..ef6a5edf919f738dac4744592cff26fa288cbc38 100644 (file)
@@ -96,7 +96,7 @@ class Delegation extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new ForbiddenException(L10n::t('Permission denied.'));
+                       throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                $identities = DI::app()->identities;
@@ -125,11 +125,11 @@ class Delegation extends BaseModule
                }
 
                $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('delegation.tpl'), [
-                       '$title'      => L10n::t('Manage Identities and/or Pages'),
-                       '$desc'       => L10n::t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
-                       '$choose'     => L10n::t('Select an identity to manage: '),
+                       '$title'      => DI::l10n()->t('Manage Identities and/or Pages'),
+                       '$desc'       => DI::l10n()->t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
+                       '$choose'     => DI::l10n()->t('Select an identity to manage: '),
                        '$identities' => $identities,
-                       '$submit'     => L10n::t('Submit'),
+                       '$submit'     => DI::l10n()->t('Submit'),
                ]);
 
                return $o;
index 41f27502875207eab78f8326ac7b452ca02f072f..9dec1ca23ada861d2f260570289638efbbea4698 100644 (file)
@@ -29,7 +29,7 @@ class Directory extends BaseModule
 
                if (($config->get('system', 'block_public') && !Session::isAuthenticated()) ||
                        ($config->get('system', 'block_local_dir') && !Session::isAuthenticated())) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Public access denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
                }
 
                if (local_user()) {
@@ -57,7 +57,7 @@ class Directory extends BaseModule
                $profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search);
 
                if ($profiles['total'] === 0) {
-                       info(L10n::t('No entries (some entries may be hidden).') . EOL);
+                       info(DI::l10n()->t('No entries (some entries may be hidden).') . EOL);
                } else {
                        if (in_array('small', $app->argv)) {
                                $photo = 'thumb';
@@ -74,15 +74,15 @@ class Directory extends BaseModule
 
                $output .= Renderer::replaceMacros($tpl, [
                        '$search'     => $search,
-                       '$globaldir'  => L10n::t('Global Directory'),
+                       '$globaldir'  => DI::l10n()->t('Global Directory'),
                        '$gDirPath'   => $gDirPath,
-                       '$desc'       => L10n::t('Find on this site'),
+                       '$desc'       => DI::l10n()->t('Find on this site'),
                        '$contacts'   => $entries,
-                       '$finding'    => L10n::t('Results for:'),
+                       '$finding'    => DI::l10n()->t('Results for:'),
                        '$findterm'   => (strlen($search) ? $search : ""),
-                       '$title'      => L10n::t('Site Directory'),
+                       '$title'      => DI::l10n()->t('Site Directory'),
                        '$search_mod' => 'directory',
-                       '$submit'     => L10n::t('Find'),
+                       '$submit'     => DI::l10n()->t('Find'),
                        '$paginate'   => $pager->renderFull($profiles['total']),
                ]);
 
@@ -133,20 +133,20 @@ class Directory extends BaseModule
                        || !empty($profile['postal-code'])
                        || !empty($profile['country-name'])
                ) {
-                       $location = L10n::t('Location:');
+                       $location = DI::l10n()->t('Location:');
                } else {
                        $location = '';
                }
 
-               $gender =   (!empty($profile['gender'])   ? L10n::t('Gender:')   : false);
-               $marital =  (!empty($profile['marital'])  ? L10n::t('Status:')   : false);
-               $homepage = (!empty($profile['homepage']) ? L10n::t('Homepage:') : false);
-               $about =    (!empty($profile['about'])    ? L10n::t('About:')    : false);
+               $gender =   (!empty($profile['gender'])   ? DI::l10n()->t('Gender:')   : false);
+               $marital =  (!empty($profile['marital'])  ? DI::l10n()->t('Status:')   : false);
+               $homepage = (!empty($profile['homepage']) ? DI::l10n()->t('Homepage:') : false);
+               $about =    (!empty($profile['about'])    ? DI::l10n()->t('About:')    : false);
 
                $location_e = $location;
 
                $photo_menu = [
-                       'profile' => [L10n::t("View Profile"), Contact::magicLink($profile_link)]
+                       'profile' => [DI::l10n()->t("View Profile"), Contact::magicLink($profile_link)]
                ];
 
                $entry = [
index 0b6a41ae22afa1507a71731cb78ca8f2dd05b8ee..93cb5f5a8aa46f461377c7e6f4eb46bc3972cdc4 100644 (file)
@@ -17,7 +17,7 @@ class SaveTag extends BaseModule
        public static function init(array $parameters = [])
        {
                if (!local_user()) {
-                       info(L10n::t('You must be logged in to use this module'));
+                       info(DI::l10n()->t('You must be logged in to use this module'));
                        DI::baseUrl()->redirect();
                }
        }
@@ -36,7 +36,7 @@ class SaveTag extends BaseModule
                if ($item_id && strlen($term)) {
                        // file item
                        Model\FileTag::saveFile(local_user(), $item_id, $term);
-                       info(L10n::t('Filetag %s saved to item', $term));
+                       info(DI::l10n()->t('Filetag %s saved to item', $term));
                }
 
                // return filer dialog
@@ -45,8 +45,8 @@ class SaveTag extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
                echo Renderer::replaceMacros($tpl, [
-                       '$field' => ['term', L10n::t("Save to Folder:"), '', '', $filetags, L10n::t('- select -')],
-                       '$submit' => L10n::t('Save'),
+                       '$field' => ['term', DI::l10n()->t("Save to Folder:"), '', '', $filetags, DI::l10n()->t('- select -')],
+                       '$submit' => DI::l10n()->t('Save'),
                ]);
 
                exit;
index 2da2685b6d250fd81060deeaf00afa609b5b6896..5ff618ae62b7c710c5d760dc6fb33b216ba2391e 100644 (file)
@@ -15,7 +15,7 @@ class FollowConfirm extends BaseModule
        {
                $uid = local_user();
                if (!$uid) {
-                       notice(L10n::t('Permission denied.') . EOL);
+                       notice(DI::l10n()->t('Permission denied.') . EOL);
                        return;
                }
 
index 53bb6eaf682b2e66f31870558ac1662b16b5420b..b48ad7f03d540d523c4744bd3e8dfa832bf365cb 100644 (file)
@@ -37,27 +37,27 @@ class Friendica extends BaseModule
                                }
                        }
                        $addon = [
-                               'title' => L10n::t('Installed addons/apps:'),
+                               'title' => DI::l10n()->t('Installed addons/apps:'),
                                'list'  => $sortedAddonList,
                        ];
                } else {
                        $addon = [
-                               'title' => L10n::t('No installed addons/apps'),
+                               'title' => DI::l10n()->t('No installed addons/apps'),
                        ];
                }
 
                $tos = ($config->get('system', 'tosdisplay')) ?
-                       L10n::t('Read about the <a href="%1$s/tos">Terms of Service</a> of this node.', DI::baseUrl()->get()) :
+                       DI::l10n()->t('Read about the <a href="%1$s/tos">Terms of Service</a> of this node.', DI::baseUrl()->get()) :
                        '';
 
                $blockList = $config->get('system', 'blocklist');
 
                if (!empty($blockList)) {
                        $blocked = [
-                               'title'  => L10n::t('On this server the following remote servers are blocked.'),
+                               'title'  => DI::l10n()->t('On this server the following remote servers are blocked.'),
                                'header' => [
-                                       L10n::t('Blocked domain'),
-                                       L10n::t('Reason for the block'),
+                                       DI::l10n()->t('Blocked domain'),
+                                       DI::l10n()->t('Reason for the block'),
                                ],
                                'list'   => $blockList,
                        ];
@@ -72,14 +72,14 @@ class Friendica extends BaseModule
                $tpl = Renderer::getMarkupTemplate('friendica.tpl');
 
                return Renderer::replaceMacros($tpl, [
-                       'about'     => L10n::t('This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.',
+                       'about'     => DI::l10n()->t('This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.',
                                '<strong>' . FRIENDICA_VERSION . '</strong>',
                                DI::baseUrl()->get(),
                                '<strong>' . DB_UPDATE_VERSION . '</strong>',
                                '<strong>' . $config->get('system', 'post_update_version') . '</strong>'),
-                       'friendica' => L10n::t('Please visit <a href="https://friendi.ca">Friendi.ca</a> to learn more about the Friendica project.'),
-                       'bugs'      => L10n::t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">' . L10n::t('the bugtracker at github') . '</a>',
-                       'info'      => L10n::t('Suggestions, praise, etc. - please email "info" at "friendi - dot - ca'),
+                       'friendica' => DI::l10n()->t('Please visit <a href="https://friendi.ca">Friendi.ca</a> to learn more about the Friendica project.'),
+                       'bugs'      => DI::l10n()->t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">' . DI::l10n()->t('the bugtracker at github') . '</a>',
+                       'info'      => DI::l10n()->t('Suggestions, praise, etc. - please email "info" at "friendi - dot - ca'),
 
                        'visible_addons' => $addon,
                        'tos'            => $tos,
index 6542cc74a8b02abc984fbdc128a74cc368487bd3..e9d4020ead04ea658945ab315f07282d4c8ba3b2 100644 (file)
@@ -28,7 +28,7 @@ class Group extends BaseModule
                }
 
                if (!local_user()) {
-                       notice(L10n::t('Permission denied.'));
+                       notice(DI::l10n()->t('Permission denied.'));
                        DI::baseUrl()->redirect();
                }
 
@@ -39,13 +39,13 @@ class Group extends BaseModule
                        $name = Strings::escapeTags(trim($_POST['groupname']));
                        $r = Model\Group::create(local_user(), $name);
                        if ($r) {
-                               info(L10n::t('Group created.'));
+                               info(DI::l10n()->t('Group created.'));
                                $r = Model\Group::getIdByName(local_user(), $name);
                                if ($r) {
                                        DI::baseUrl()->redirect('group/' . $r);
                                }
                        } else {
-                               notice(L10n::t('Could not create group.'));
+                               notice(DI::l10n()->t('Could not create group.'));
                        }
                        DI::baseUrl()->redirect('group');
                }
@@ -56,13 +56,13 @@ class Group extends BaseModule
 
                        $group = DBA::selectFirst('group', ['id', 'name'], ['id' => $a->argv[1], 'uid' => local_user()]);
                        if (!DBA::isResult($group)) {
-                               notice(L10n::t('Group not found.'));
+                               notice(DI::l10n()->t('Group not found.'));
                                DI::baseUrl()->redirect('contact');
                        }
                        $groupname = Strings::escapeTags(trim($_POST['groupname']));
                        if (strlen($groupname) && ($groupname != $group['name'])) {
                                if (Model\Group::update($group['id'], $groupname)) {
-                                       info(L10n::t('Group name changed.'));
+                                       info(DI::l10n()->t('Group name changed.'));
                                }
                        }
                }
@@ -74,7 +74,7 @@ class Group extends BaseModule
                        $a = DI::app();
 
                        if (!local_user()) {
-                               throw new \Exception(L10n::t('Permission denied.'), 403);
+                               throw new \Exception(DI::l10n()->t('Permission denied.'), 403);
                        }
 
                        // POST /group/123/add/123
@@ -84,38 +84,38 @@ class Group extends BaseModule
                                list($group_id, $command, $contact_id) = array_slice($a->argv, 1);
 
                                if (!Model\Group::exists($group_id, local_user())) {
-                                       throw new \Exception(L10n::t('Unknown group.'), 404);
+                                       throw new \Exception(DI::l10n()->t('Unknown group.'), 404);
                                }
 
                                $contact = DBA::selectFirst('contact', ['deleted'], ['id' => $contact_id, 'uid' => local_user()]);
                                if (!DBA::isResult($contact)) {
-                                       throw new \Exception(L10n::t('Contact not found.'), 404);
+                                       throw new \Exception(DI::l10n()->t('Contact not found.'), 404);
                                }
 
                                if ($contact['deleted']) {
-                                       throw new \Exception(L10n::t('Contact is deleted.'), 410);
+                                       throw new \Exception(DI::l10n()->t('Contact is deleted.'), 410);
                                }
 
                                switch($command) {
                                        case 'add':
                                                if (!Model\Group::addMember($group_id, $contact_id)) {
-                                                       throw new \Exception(L10n::t('Unable to add the contact to the group.'), 500);
+                                                       throw new \Exception(DI::l10n()->t('Unable to add the contact to the group.'), 500);
                                                }
 
-                                               $message = L10n::t('Contact successfully added to group.');
+                                               $message = DI::l10n()->t('Contact successfully added to group.');
                                                break;
                                        case 'remove':
                                                if (!Model\Group::removeMember($group_id, $contact_id)) {
-                                                       throw new \Exception(L10n::t('Unable to remove the contact from the group.'), 500);
+                                                       throw new \Exception(DI::l10n()->t('Unable to remove the contact from the group.'), 500);
                                                }
 
-                                               $message = L10n::t('Contact successfully removed from group.');
+                                               $message = DI::l10n()->t('Contact successfully removed from group.');
                                                break;
                                        default:
-                                               throw new \Exception(L10n::t('Unknown group command.'), 400);
+                                               throw new \Exception(DI::l10n()->t('Unknown group command.'), 400);
                                }
                        } else {
-                               throw new \Exception(L10n::t('Bad request.'), 400);
+                               throw new \Exception(DI::l10n()->t('Bad request.'), 400);
                        }
 
                        notice($message);
@@ -154,15 +154,15 @@ class Group extends BaseModule
 
 
                $context = [
-                       '$submit' => L10n::t('Save Group'),
-                       '$submit_filter' => L10n::t('Filter'),
+                       '$submit' => DI::l10n()->t('Save Group'),
+                       '$submit_filter' => DI::l10n()->t('Filter'),
                ];
 
                // @TODO: Replace with parameter from router
                if (($a->argc == 2) && ($a->argv[1] === 'new')) {
                        return Renderer::replaceMacros($tpl, $context + [
-                               '$title' => L10n::t('Create a group of contacts/friends.'),
-                               '$gname' => ['groupname', L10n::t('Group Name: '), '', ''],
+                               '$title' => DI::l10n()->t('Create a group of contacts/friends.'),
+                               '$gname' => ['groupname', DI::l10n()->t('Group Name: '), '', ''],
                                '$gid' => 'new',
                                '$form_security_token' => BaseModule::getFormSecurityToken("group_edit"),
                        ]);
@@ -177,7 +177,7 @@ class Group extends BaseModule
                        $nogroup = true;
                        $group = [
                                'id' => $id,
-                               'name' => L10n::t('Contacts not in any group'),
+                               'name' => DI::l10n()->t('Contacts not in any group'),
                        ];
 
                        $members = [];
@@ -185,7 +185,7 @@ class Group extends BaseModule
 
                        $context = $context + [
                                '$title' => $group['name'],
-                               '$gname' => ['groupname', L10n::t('Group Name: '), $group['name'], ''],
+                               '$gname' => ['groupname', DI::l10n()->t('Group Name: '), $group['name'], ''],
                                '$gid' => $id,
                                '$editable' => 0,
                        ];
@@ -198,14 +198,14 @@ class Group extends BaseModule
                        // @TODO: Replace with parameter from router
                        if (intval($a->argv[2])) {
                                if (!Model\Group::exists($a->argv[2], local_user())) {
-                                       notice(L10n::t('Group not found.'));
+                                       notice(DI::l10n()->t('Group not found.'));
                                        DI::baseUrl()->redirect('contact');
                                }
 
                                if (Model\Group::remove($a->argv[2])) {
-                                       info(L10n::t('Group removed.'));
+                                       info(DI::l10n()->t('Group removed.'));
                                } else {
-                                       notice(L10n::t('Unable to remove group.'));
+                                       notice(DI::l10n()->t('Unable to remove group.'));
                                }
                        }
                        DI::baseUrl()->redirect('group');
@@ -224,7 +224,7 @@ class Group extends BaseModule
                if (($a->argc > 1) && intval($a->argv[1])) {
                        $group = DBA::selectFirst('group', ['id', 'name'], ['id' => $a->argv[1], 'uid' => local_user(), 'deleted' => false]);
                        if (!DBA::isResult($group)) {
-                               notice(L10n::t('Group not found.'));
+                               notice(DI::l10n()->t('Group not found.'));
                                DI::baseUrl()->redirect('contact');
                        }
 
@@ -256,17 +256,17 @@ class Group extends BaseModule
                        $drop_tpl = Renderer::getMarkupTemplate('group_drop.tpl');
                        $drop_txt = Renderer::replaceMacros($drop_tpl, [
                                '$id' => $group['id'],
-                               '$delete' => L10n::t('Delete Group'),
+                               '$delete' => DI::l10n()->t('Delete Group'),
                                '$form_security_token' => BaseModule::getFormSecurityToken("group_drop"),
                        ]);
 
                        $context = $context + [
                                '$title' => $group['name'],
-                               '$gname' => ['groupname', L10n::t('Group Name: '), $group['name'], ''],
+                               '$gname' => ['groupname', DI::l10n()->t('Group Name: '), $group['name'], ''],
                                '$gid' => $group['id'],
                                '$drop' => $drop_txt,
                                '$form_security_token' => BaseModule::getFormSecurityToken('group_edit'),
-                               '$edit_name' => L10n::t('Edit Group Name'),
+                               '$edit_name' => DI::l10n()->t('Edit Group Name'),
                                '$editable' => 1,
                        ];
                }
@@ -276,10 +276,10 @@ class Group extends BaseModule
                }
 
                $groupeditor = [
-                       'label_members' => L10n::t('Members'),
+                       'label_members' => DI::l10n()->t('Members'),
                        'members' => [],
-                       'label_contacts' => L10n::t('All Contacts'),
-                       'group_is_empty' => L10n::t('Group is empty'),
+                       'label_contacts' => DI::l10n()->t('All Contacts'),
+                       'group_is_empty' => DI::l10n()->t('Group is empty'),
                        'contacts' => [],
                ];
 
@@ -292,7 +292,7 @@ class Group extends BaseModule
                                $entry['label'] = 'members';
                                $entry['photo_menu'] = '';
                                $entry['change_member'] = [
-                                       'title'     => L10n::t("Remove contact from group"),
+                                       'title'     => DI::l10n()->t("Remove contact from group"),
                                        'gid'       => $group['id'],
                                        'cid'       => $member['id'],
                                        'sec_token' => $sec_token
@@ -312,7 +312,7 @@ class Group extends BaseModule
                                ['order' => ['name']]
                        );
                        $contacts = DBA::toArray($contacts_stmt);
-                       $context['$desc'] = L10n::t('Click on a contact to add or remove.');
+                       $context['$desc'] = DI::l10n()->t('Click on a contact to add or remove.');
                }
 
                if (DBA::isResult($contacts)) {
@@ -326,7 +326,7 @@ class Group extends BaseModule
 
                                        if (!$nogroup) {
                                                $entry['change_member'] = [
-                                                       'title'     => L10n::t("Add contact to group"),
+                                                       'title'     => DI::l10n()->t("Add contact to group"),
                                                        'gid'       => $group['id'],
                                                        'cid'       => $member['id'],
                                                        'sec_token' => $sec_token
index b4f9e9766165eb0d400bf71cc88ef3d5d7794306..f75bdd8caa44f7eb23c46c187f30b3f5af69fb4a 100644 (file)
@@ -10,6 +10,6 @@ class MethodNotAllowed extends BaseModule
 {
        public static function content(array $parameters = [])
        {
-               throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.'));
+               throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
        }
 }
index c79d9c2778521d0e24c1b21fea021ca30a091e3e..6c2395b0e2030e5379359366a70c15a3ff341a1d 100644 (file)
@@ -10,6 +10,6 @@ class PageNotFound extends BaseModule
 {
        public static function content(array $parameters = [])
        {
-               throw new HTTPException\NotFoundException(L10n::t('Page not found.'));
+               throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
        }
 }
index b18500a1096907f45b4e6d5ac0c7d0c054ad15fb..061ab2a43380034bf992feab3f1885138f30a301 100644 (file)
@@ -41,14 +41,14 @@ class Help extends BaseModule
                        $title = basename($path);
                        $filename = $path;
                        $text = self::loadDocFile('doc/' . $path . '.md', $lang);
-                       DI::page()['title'] = L10n::t('Help:') . ' ' . str_replace('-', ' ', Strings::escapeTags($title));
+                       DI::page()['title'] = DI::l10n()->t('Help:') . ' ' . str_replace('-', ' ', Strings::escapeTags($title));
                }
 
                $home = self::loadDocFile('doc/Home.md', $lang);
                if (!$text) {
                        $text = $home;
                        $filename = "Home";
-                       DI::page()['title'] = L10n::t('Help');
+                       DI::page()['title'] = DI::l10n()->t('Help');
                } else {
                        DI::page()['aside'] = Markdown::convert($home, false);
                }
index 77eec34c428ed0f8a5ba3546f641e5da35cb0038..6ce025208ac4690113a5a9f888df78744fca1f03 100644 (file)
@@ -33,7 +33,7 @@ class Home extends BaseModule
                }
 
                $customHome = '';
-               $defaultHeader = ($config->get('config', 'sitename') ? L10n::t('Welcome to %s', $config->get('config', 'sitename')) : '');
+               $defaultHeader = ($config->get('config', 'sitename') ? DI::l10n()->t('Welcome to %s', $config->get('config', 'sitename')) : '');
 
                $homeFilePath = $app->getBasePath() . '/home.html';
                $cssFilePath = $app->getBasePath() . '/home.css';
index 537338da15d3ee93259adf4b88f353998c5ae703..4b0809e1f99b19ad4ed26fff6b7993fa57df2a27 100644 (file)
@@ -156,7 +156,7 @@ class Install extends BaseModule
 
                $output = '';
 
-               $install_title = L10n::t('Friendica Communications Server - Setup');
+               $install_title = DI::l10n()->t('Friendica Communications Server - Setup');
 
                switch (self::$currentWizardStep) {
                        case self::SYSTEM_CHECK:
@@ -167,49 +167,49 @@ class Install extends BaseModule
                                $tpl    = Renderer::getMarkupTemplate('install_checks.tpl');
                                $output .= Renderer::replaceMacros($tpl, [
                                        '$title'       => $install_title,
-                                       '$pass'        => L10n::t('System check'),
+                                       '$pass'        => DI::l10n()->t('System check'),
                                        '$checks'      => self::$installer->getChecks(),
                                        '$passed'      => $status,
-                                       '$see_install' => L10n::t('Please see the file "INSTALL.txt".'),
-                                       '$next'        => L10n::t('Next'),
-                                       '$reload'      => L10n::t('Check again'),
+                                       '$see_install' => DI::l10n()->t('Please see the file "INSTALL.txt".'),
+                                       '$next'        => DI::l10n()->t('Next'),
+                                       '$reload'      => DI::l10n()->t('Check again'),
                                        '$php_path'    => $php_path,
                                ]);
                                break;
 
                        case self::BASE_CONFIG:
                                $ssl_choices = [
-                                       App\BaseURL::SSL_POLICY_NONE     => L10n::t("No SSL policy, links will track page SSL state"),
-                                       App\BaseURL::SSL_POLICY_FULL     => L10n::t("Force all links to use SSL"),
-                                       App\BaseURL::SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
+                                       App\BaseURL::SSL_POLICY_NONE     => DI::l10n()->t("No SSL policy, links will track page SSL state"),
+                                       App\BaseURL::SSL_POLICY_FULL     => DI::l10n()->t("Force all links to use SSL"),
+                                       App\BaseURL::SSL_POLICY_SELFSIGN => DI::l10n()->t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
                                ];
 
                                $tpl    = Renderer::getMarkupTemplate('install_base.tpl');
                                $output .= Renderer::replaceMacros($tpl, [
                                        '$title'      => $install_title,
-                                       '$pass'       => L10n::t('Base settings'),
+                                       '$pass'       => DI::l10n()->t('Base settings'),
                                        '$ssl_policy' => ['system-ssl_policy',
-                                               L10n::t("SSL link policy"),
+                                               DI::l10n()->t("SSL link policy"),
                                                $configCache->get('system', 'ssl_policy'),
-                                               L10n::t("Determines whether generated links should be forced to use SSL"),
+                                               DI::l10n()->t("Determines whether generated links should be forced to use SSL"),
                                                $ssl_choices],
                                        '$hostname'   => ['config-hostname',
-                                               L10n::t('Host name'),
+                                               DI::l10n()->t('Host name'),
                                                $configCache->get('config', 'hostname'),
-                                               L10n::t('Overwrite this field in case the determinated hostname isn\'t right, otherweise leave it as is.'),
+                                               DI::l10n()->t('Overwrite this field in case the determinated hostname isn\'t right, otherweise leave it as is.'),
                                                'required'],
                                        '$basepath'   => ['system-basepath',
-                                               L10n::t("Base path to installation"),
+                                               DI::l10n()->t("Base path to installation"),
                                                $configCache->get('system', 'basepath'),
-                                               L10n::t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
+                                               DI::l10n()->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
                                                'required'],
                                        '$urlpath'    => ['system-urlpath',
-                                               L10n::t('Sub path of the URL'),
+                                               DI::l10n()->t('Sub path of the URL'),
                                                $configCache->get('system', 'urlpath'),
-                                               L10n::t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'),
+                                               DI::l10n()->t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'),
                                                ''],
                                        '$php_path'   => $configCache->get('config', 'php_path'),
-                                       '$submit'     => L10n::t('Submit'),
+                                       '$submit'     => DI::l10n()->t('Submit'),
                                ]);
                                break;
 
@@ -217,39 +217,39 @@ class Install extends BaseModule
                                $tpl    = Renderer::getMarkupTemplate('install_db.tpl');
                                $output .= Renderer::replaceMacros($tpl, [
                                        '$title'      => $install_title,
-                                       '$pass'       => L10n::t('Database connection'),
-                                       '$info_01'    => L10n::t('In order to install Friendica we need to know how to connect to your database.'),
-                                       '$info_02'    => L10n::t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
-                                       '$info_03'    => L10n::t('The database you specify below should already exist. If it does not, please create it before continuing.'),
+                                       '$pass'       => DI::l10n()->t('Database connection'),
+                                       '$info_01'    => DI::l10n()->t('In order to install Friendica we need to know how to connect to your database.'),
+                                       '$info_02'    => DI::l10n()->t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
+                                       '$info_03'    => DI::l10n()->t('The database you specify below should already exist. If it does not, please create it before continuing.'),
                                        'checks'      => self::$installer->getChecks(),
                                        '$hostname'   => $configCache->get('config', 'hostname'),
                                        '$ssl_policy' => $configCache->get('system', 'ssl_policy'),
                                        '$basepath'   => $configCache->get('system', 'basepath'),
                                        '$urlpath'    => $configCache->get('system', 'urlpath'),
                                        '$dbhost'     => ['database-hostname',
-                                               L10n::t('Database Server Name'),
+                                               DI::l10n()->t('Database Server Name'),
                                                $configCache->get('database', 'hostname'),
                                                '',
                                                'required'],
                                        '$dbuser'     => ['database-username',
-                                               L10n::t('Database Login Name'),
+                                               DI::l10n()->t('Database Login Name'),
                                                $configCache->get('database', 'username'),
                                                '',
                                                'required',
                                                'autofocus'],
                                        '$dbpass'     => ['database-password',
-                                               L10n::t('Database Login Password'),
+                                               DI::l10n()->t('Database Login Password'),
                                                $configCache->get('database', 'password'),
-                                               L10n::t("For security reasons the password must not be empty"),
+                                               DI::l10n()->t("For security reasons the password must not be empty"),
                                                'required'],
                                        '$dbdata'     => ['database-database',
-                                               L10n::t('Database Name'),
+                                               DI::l10n()->t('Database Name'),
                                                $configCache->get('database', 'database'),
                                                '',
                                                'required'],
-                                       '$lbl_10'     => L10n::t('Please select a default timezone for your website'),
+                                       '$lbl_10'     => DI::l10n()->t('Please select a default timezone for your website'),
                                        '$php_path'   => $configCache->get('config', 'php_path'),
-                                       '$submit'     => L10n::t('Submit')
+                                       '$submit'     => DI::l10n()->t('Submit')
                                ]);
                                break;
 
@@ -261,7 +261,7 @@ class Install extends BaseModule
                                $output .= Renderer::replaceMacros($tpl, [
                                        '$title'      => $install_title,
                                        '$checks'     => self::$installer->getChecks(),
-                                       '$pass'       => L10n::t('Site settings'),
+                                       '$pass'       => DI::l10n()->t('Site settings'),
                                        '$hostname'   => $configCache->get('config', 'hostname'),
                                        '$ssl_policy' => $configCache->get('system', 'ssl_policy'),
                                        '$basepath'   => $configCache->get('system', 'basepath'),
@@ -271,21 +271,21 @@ class Install extends BaseModule
                                        '$dbpass'     => $configCache->get('database', 'password'),
                                        '$dbdata'     => $configCache->get('database', 'database'),
                                        '$adminmail'  => ['config-admin_email',
-                                               L10n::t('Site administrator email address'),
+                                               DI::l10n()->t('Site administrator email address'),
                                                $configCache->get('config', 'admin_email'),
-                                               L10n::t('Your account email address must match this in order to use the web admin panel.'),
+                                               DI::l10n()->t('Your account email address must match this in order to use the web admin panel.'),
                                                'required', 'autofocus', 'email'],
                                        '$timezone'   => Temporal::getTimezoneField('system-default_timezone',
-                                               L10n::t('Please select a default timezone for your website'),
+                                               DI::l10n()->t('Please select a default timezone for your website'),
                                                $configCache->get('system', 'default_timezone'),
                                                ''),
                                        '$language'   => ['system-language',
-                                               L10n::t('System Language:'),
+                                               DI::l10n()->t('System Language:'),
                                                $configCache->get('system', 'language'),
-                                               L10n::t('Set the default language for your Friendica installation interface and to send emails.'),
+                                               DI::l10n()->t('Set the default language for your Friendica installation interface and to send emails.'),
                                                $lang_choices],
                                        '$php_path'   => $configCache->get('config', 'php_path'),
-                                       '$submit'     => L10n::t('Submit')
+                                       '$submit'     => DI::l10n()->t('Submit')
                                ]);
                                break;
 
@@ -294,7 +294,7 @@ class Install extends BaseModule
 
                                if (count(self::$installer->getChecks()) == 0) {
                                        $txt            = '<p style="font-size: 130%;">';
-                                       $txt            .= L10n::t('Your Friendica site database has been installed.') . EOL;
+                                       $txt            .= DI::l10n()->t('Your Friendica site database has been installed.') . EOL;
                                        $db_return_text .= $txt;
                                }
 
@@ -302,7 +302,7 @@ class Install extends BaseModule
                                $output .= Renderer::replaceMacros($tpl, [
                                        '$title'  => $install_title,
                                        '$checks' => self::$installer->getChecks(),
-                                       '$pass'   => L10n::t('Installation finished'),
+                                       '$pass'   => DI::l10n()->t('Installation finished'),
                                        '$text'   => $db_return_text . self::whatNext(),
                                ]);
 
@@ -322,11 +322,11 @@ class Install extends BaseModule
        {
                $baseurl = DI::baseUrl()->get();
                return
-                       L10n::t('<h1>What next</h1>')
-                       . "<p>" . L10n::t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
-                       . L10n::t('Please see the file "INSTALL.txt".')
+                       DI::l10n()->t('<h1>What next</h1>')
+                       . "<p>" . DI::l10n()->t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
+                       . DI::l10n()->t('Please see the file "INSTALL.txt".')
                        . "</p><p>"
-                       . L10n::t('Go to your new Friendica node <a href="%s/register">registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.', $baseurl)
+                       . DI::l10n()->t('Go to your new Friendica node <a href="%s/register">registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.', $baseurl)
                        . "</p>";
        }
 
index b06efc5a2aaa35f3e0cd635e47eddd038afbb757..cdc5ac6376b515b5d79f0b6a830f4f4545621aa7 100644 (file)
@@ -19,7 +19,7 @@ class Invite extends BaseModule
        public static function post(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                self::checkFormSecurityTokenRedirectOnError('/', 'send_invite');
@@ -34,7 +34,7 @@ class Invite extends BaseModule
 
                $current_invites = intval(DI::pConfig()->get(local_user(), 'system', 'sent_invites'));
                if ($current_invites > $max_invites) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Total invitation limit exceeded.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Total invitation limit exceeded.'));
                }
 
 
@@ -57,7 +57,7 @@ class Invite extends BaseModule
                        $recipient = trim($recipient);
 
                        if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
-                               notice(L10n::t('%s : Not a valid email address.', $recipient) . EOL);
+                               notice(DI::l10n()->t('%s : Not a valid email address.', $recipient) . EOL);
                                continue;
                        }
 
@@ -84,7 +84,7 @@ class Invite extends BaseModule
 
                        $res = mail(
                                $recipient,
-                               Email::encodeHeader(L10n::t('Please join us on Friendica'), 'UTF-8'),
+                               Email::encodeHeader(DI::l10n()->t('Please join us on Friendica'), 'UTF-8'),
                                $nmessage,
                                $additional_headers);
 
@@ -93,11 +93,11 @@ class Invite extends BaseModule
                                $current_invites++;
                                DI::pConfig()->set(local_user(), 'system', 'sent_invites', $current_invites);
                                if ($current_invites > $max_invites) {
-                                       notice(L10n::t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
+                                       notice(DI::l10n()->t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
                                        return;
                                }
                        } else {
-                               notice(L10n::t('%s : Message delivery failed.', $recipient) . EOL);
+                               notice(DI::l10n()->t('%s : Message delivery failed.', $recipient) . EOL);
                        }
 
                }
@@ -107,7 +107,7 @@ class Invite extends BaseModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                $app = DI::app();
@@ -119,42 +119,42 @@ class Invite extends BaseModule
                        $inviteOnly = true;
                        $x = DI::pConfig()->get(local_user(), 'system', 'invites_remaining');
                        if ((!$x) && (!is_site_admin())) {
-                               throw new HTTPException\ForbiddenException(L10n::t('You have no more invitations available'));
+                               throw new HTTPException\ForbiddenException(DI::l10n()->t('You have no more invitations available'));
                        }
                }
 
                $dirLocation = $config->get('system', 'directory');
                if (strlen($dirLocation)) {
                        if ($config->get('config', 'register_policy') === Register::CLOSED) {
-                               $linkTxt = L10n::t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.', $dirLocation . '/servers');
+                               $linkTxt = DI::l10n()->t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.', $dirLocation . '/servers');
                        } else {
-                               $linkTxt = L10n::t('To accept this invitation, please visit and register at %s or any other public Friendica website.', DI::baseUrl()->get())
-                                       . "\r\n" . "\r\n" . L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.', $dirLocation . '/servers');
+                               $linkTxt = DI::l10n()->t('To accept this invitation, please visit and register at %s or any other public Friendica website.', DI::baseUrl()->get())
+                                       . "\r\n" . "\r\n" . DI::l10n()->t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.', $dirLocation . '/servers');
                        }
                } else { // there is no global directory URL defined
                        if ($config->get('config', 'register_policy') === Register::CLOSED) {
-                               return L10n::t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
+                               return DI::l10n()->t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
                        } else {
-                               $linkTxt = L10n::t('To accept this invitation, please visit and register at %s.', DI::baseUrl()->get()
-                                       . "\r\n" . "\r\n" . L10n::t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
+                               $linkTxt = DI::l10n()->t('To accept this invitation, please visit and register at %s.', DI::baseUrl()->get()
+                                       . "\r\n" . "\r\n" . DI::l10n()->t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.'));
                        }
                }
 
                $tpl = Renderer::getMarkupTemplate('invite.tpl');
                return Renderer::replaceMacros($tpl, [
                        '$form_security_token' => self::getFormSecurityToken('send_invite'),
-                       '$title'               => L10n::t('Send invitations'),
-                       '$recipients'          => ['recipients', L10n::t('Enter email addresses, one per line:')],
+                       '$title'               => DI::l10n()->t('Send invitations'),
+                       '$recipients'          => ['recipients', DI::l10n()->t('Enter email addresses, one per line:')],
                        '$message'             => [
                                'message',
-                               L10n::t('Your message:'),
-                               L10n::t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
+                               DI::l10n()->t('Your message:'),
+                               DI::l10n()->t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n"
                                . $linkTxt
-                               . "\r\n" . "\r\n" . (($inviteOnly) ? L10n::t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') . L10n::t('Once you have registered, please connect with me via my profile page at:')
+                               . "\r\n" . "\r\n" . (($inviteOnly) ? DI::l10n()->t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') . DI::l10n()->t('Once you have registered, please connect with me via my profile page at:')
                                . "\r\n" . "\r\n" . DI::baseUrl()->get() . '/profile/' . $app->user['nickname']
-                               . "\r\n" . "\r\n" . L10n::t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n",
+                               . "\r\n" . "\r\n" . DI::l10n()->t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n",
                        ],
-                       '$submit'              => L10n::t('Submit')
+                       '$submit'              => DI::l10n()->t('Submit')
                ]);
        }
 }
index d30b0d86f1f65da756b39464d8dd958720aba71c..c033f097da403ea259818442d067706d4d690122 100644 (file)
@@ -25,7 +25,7 @@ class Compose extends BaseModule
                        require_once 'mod/item.php';
                        item_post(DI::app());
                } else {
-                       notice(L10n::t('Please enter a post body.'));
+                       notice(DI::l10n()->t('Please enter a post body.'));
                }
        }
 
@@ -38,7 +38,7 @@ class Compose extends BaseModule
                $a = DI::app();
 
                if ($a->getCurrentTheme() !== 'frio') {
-                       throw new NotImplementedException(L10n::t('This feature is only available with the frio theme.'));
+                       throw new NotImplementedException(DI::l10n()->t('This feature is only available with the frio theme.'));
                }
 
                /// @TODO Retrieve parameter from router
@@ -65,7 +65,7 @@ class Compose extends BaseModule
 
                switch ($posttype) {
                        case Item::PT_PERSONAL_NOTE:
-                               $compose_title = L10n::t('Compose new personal note');
+                               $compose_title = DI::l10n()->t('Compose new personal note');
                                $type = 'note';
                                $doesFederate = false;
                                $contact_allow_list = [$a->contact['id']];
@@ -74,7 +74,7 @@ class Compose extends BaseModule
                                $group_deny_list = [];
                                break;
                        default:
-                               $compose_title = L10n::t('Compose new post');
+                               $compose_title = DI::l10n()->t('Compose new post');
                                $type = 'post';
                                $doesFederate = true;
 
@@ -114,33 +114,33 @@ class Compose extends BaseModule
                $tpl = Renderer::getMarkupTemplate('item/compose.tpl');
                return Renderer::replaceMacros($tpl, [
                        '$compose_title'=> $compose_title,
-                       '$visibility_title'=> L10n::t('Visibility'),
+                       '$visibility_title'=> DI::l10n()->t('Visibility'),
                        '$id'           => 0,
                        '$posttype'     => $posttype,
                        '$type'         => $type,
                        '$wall'         => $wall,
                        '$default'      => '',
                        '$mylink'       => DI::baseUrl()->remove($a->contact['url']),
-                       '$mytitle'      => L10n::t('This is you'),
+                       '$mytitle'      => DI::l10n()->t('This is you'),
                        '$myphoto'      => DI::baseUrl()->remove($a->contact['thumb']),
-                       '$submit'       => L10n::t('Submit'),
-                       '$edbold'       => L10n::t('Bold'),
-                       '$editalic'     => L10n::t('Italic'),
-                       '$eduline'      => L10n::t('Underline'),
-                       '$edquote'      => L10n::t('Quote'),
-                       '$edcode'       => L10n::t('Code'),
-                       '$edimg'        => L10n::t('Image'),
-                       '$edurl'        => L10n::t('Link'),
-                       '$edattach'     => L10n::t('Link or Media'),
-                       '$prompttext'   => L10n::t('Please enter a image/video/audio/webpage URL:'),
-                       '$preview'      => L10n::t('Preview'),
-                       '$location_set' => L10n::t('Set your location'),
-                       '$location_clear' => L10n::t('Clear the location'),
-                       '$location_unavailable' => L10n::t('Location services are unavailable on your device'),
-                       '$location_disabled' => L10n::t('Location services are disabled. Please check the website\'s permissions on your device'),
-                       '$wait'         => L10n::t('Please wait'),
-                       '$placeholdertitle' => L10n::t('Set title'),
-                       '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? L10n::t('Categories (comma-separated list)') : ''),
+                       '$submit'       => DI::l10n()->t('Submit'),
+                       '$edbold'       => DI::l10n()->t('Bold'),
+                       '$editalic'     => DI::l10n()->t('Italic'),
+                       '$eduline'      => DI::l10n()->t('Underline'),
+                       '$edquote'      => DI::l10n()->t('Quote'),
+                       '$edcode'       => DI::l10n()->t('Code'),
+                       '$edimg'        => DI::l10n()->t('Image'),
+                       '$edurl'        => DI::l10n()->t('Link'),
+                       '$edattach'     => DI::l10n()->t('Link or Media'),
+                       '$prompttext'   => DI::l10n()->t('Please enter a image/video/audio/webpage URL:'),
+                       '$preview'      => DI::l10n()->t('Preview'),
+                       '$location_set' => DI::l10n()->t('Set your location'),
+                       '$location_clear' => DI::l10n()->t('Clear the location'),
+                       '$location_unavailable' => DI::l10n()->t('Location services are unavailable on your device'),
+                       '$location_disabled' => DI::l10n()->t('Location services are disabled. Please check the website\'s permissions on your device'),
+                       '$wait'         => DI::l10n()->t('Please wait'),
+                       '$placeholdertitle' => DI::l10n()->t('Set title'),
+                       '$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t('Categories (comma-separated list)') : ''),
 
                        '$title'        => $title,
                        '$category'     => $category,
@@ -153,7 +153,7 @@ class Compose extends BaseModule
                        '$group_deny'   => implode(',', $group_deny_list),
 
                        '$jotplugins'   => $jotplugins,
-                       '$sourceapp'    => L10n::t($a->sourcename),
+                       '$sourceapp'    => DI::l10n()->t($a->sourcename),
                        '$rand_num'     => Crypto::randomDigits(12),
                        '$acl_selector'  => ACL::getFullSelectorHTML(DI::page(), $a->user, $doesFederate, [
                                'allow_cid' => $contact_allow_list,
index bee9ab53f505524d2cf89db4039e0d37ec8264d0..09cdb02dac30090ffaa806844da142fab7549e12 100644 (file)
@@ -25,7 +25,7 @@ class Maintenance extends BaseModule
                }
 
                $exception = new HTTPException\ServiceUnavailableException($reason);
-               $exception->httpdesc = L10n::t('System down for maintenance');
+               $exception->httpdesc = DI::l10n()->t('System down for maintenance');
                throw $exception;
        }
 }
index bb52ce8124faca9315019bd0f0720cfa4678889d..7aeb1c2262e0518caf220fefb3a6b3ad635bc1ad 100644 (file)
@@ -16,7 +16,7 @@ class Notify extends BaseModule
        public static function init(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.'));
+                       throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
                }
        }
 
index 47ab051ad9ab3b44fbe932a9f6fb6adbcd01cd37..cc341bad23c6052b41c19b94d2c24b92bf6b3489 100644 (file)
@@ -85,7 +85,7 @@ class Photo extends BaseModule
 
                if (is_null($img) || !$img->isValid()) {
                        Logger::log("Invalid photo with id {$photo["id"]}.");
-                       throw new \Friendica\Network\HTTPException\InternalServerErrorException(L10n::t('Invalid photo with id %s.', $photo["id"]));
+                       throw new \Friendica\Network\HTTPException\InternalServerErrorException(DI::l10n()->t('Invalid photo with id %s.', $photo["id"]));
                }
 
                // if customsize is set and image is not a gif, resize it
index 3dc35cb2ddc3581149ff131ad23301f8fee68e3d..77033741cc4b79072691e72a1d649eb1a419cc1d 100644 (file)
@@ -114,10 +114,10 @@ class Profile extends BaseModule
                                $page['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
                        }
 
-                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . self::$which . '" title="DFRN: ' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
-                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\n";
-                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\n";
-                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
+                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . self::$which . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
+                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/" title="' . DI::l10n()->t('%s\'s posts', $a->profile['username']) . '"/>' . "\n";
+                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/comments" title="' . DI::l10n()->t('%s\'s comments', $a->profile['username']) . '"/>' . "\n";
+                       $page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
                        $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . DI::baseUrl()->getHostname() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''));
                        $page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . DI::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\n";
                        header('Link: <' . DI::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
@@ -169,7 +169,7 @@ class Profile extends BaseModule
                $last_updated_key = "profile:" . $a->profile['profile_uid'] . ":" . local_user() . ":" . $remote_contact;
 
                if (!empty($a->profile['hidewall']) && !$is_owner && !$remote_contact) {
-                       notice(L10n::t('Access to this profile has been restricted.') . EOL);
+                       notice(DI::l10n()->t('Access to this profile has been restricted.') . EOL);
                        return '';
                }
 
index f848945bcbda5238deafb13e935bfa3b346d462a..afde70e3453fa331a0d6eb1e023c8d940f24c51a 100644 (file)
@@ -22,7 +22,7 @@ class Contacts extends BaseModule
        public static function content(array $parameters = [])
        {
                if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
-                       throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.'));
+                       throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
 
                $a = DI::app();
@@ -35,7 +35,7 @@ class Contacts extends BaseModule
 
                $user = DBA::selectFirst('user', [], ['nickname' => $nickname, 'blocked' => false]);
                if (!DBA::isResult($user)) {
-                       throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.'));
+                       throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
 
                $a->profile_uid  = $user['uid'];
@@ -48,7 +48,7 @@ class Contacts extends BaseModule
                $o = Profile::getTabs($a, 'contacts', $is_owner, $nickname);
 
                if (!count($a->profile) || $a->profile['hide-friends']) {
-                       notice(L10n::t('Permission denied.') . EOL);
+                       notice(DI::l10n()->t('Permission denied.') . EOL);
                        return $o;
                }
 
@@ -76,7 +76,7 @@ class Contacts extends BaseModule
                $contacts_stmt = DBA::select('contact', [], $condition, $params);
 
                if (!DBA::isResult($contacts_stmt)) {
-                       info(L10n::t('No contacts.') . EOL);
+                       info(DI::l10n()->t('No contacts.') . EOL);
                        return $o;
                }
 
@@ -91,7 +91,7 @@ class Contacts extends BaseModule
 
                        $contacts[] = [
                                'id'           => $contact['id'],
-                               'img_hover'    => L10n::t('Visit %s\'s profile [%s]', $contact_details['name'], $contact['url']),
+                               'img_hover'    => DI::l10n()->t('Visit %s\'s profile [%s]', $contact_details['name'], $contact['url']),
                                'photo_menu'   => Contact::photoMenu($contact),
                                'thumb'        => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
                                'name'         => substr($contact_details['name'], 0, 20),
@@ -123,10 +123,10 @@ class Contacts extends BaseModule
                        '$nickname' => $nickname,
                        '$type'     => $type,
 
-                       '$all_label' => L10n::t('All contacts'),
-                       '$followers_label' => L10n::t('Followers'),
-                       '$following_label' => L10n::t('Following'),
-                       '$mutuals_label' => L10n::t('Mutual friends'),
+                       '$all_label' => DI::l10n()->t('All contacts'),
+                       '$followers_label' => DI::l10n()->t('Followers'),
+                       '$following_label' => DI::l10n()->t('Following'),
+                       '$mutuals_label' => DI::l10n()->t('Mutual friends'),
 
                        '$contacts' => $contacts,
                        '$paginate' => $pager->renderFull($total),
index 215def13e23f0d3acce585fe15f0c0281c52d743..dfe0a534f33b963244de106bf328096318ab85eb 100644 (file)
@@ -42,20 +42,20 @@ class Register extends BaseModule
                $block = Config::get('system', 'block_extended_register');
 
                if (local_user() && $block) {
-                       notice(L10n::t('Permission denied.'));
+                       notice(DI::l10n()->t('Permission denied.'));
                        return '';
                }
 
                if (local_user()) {
                        $user = DBA::selectFirst('user', ['parent-uid'], ['uid' => local_user()]);
                        if (!empty($user['parent-uid'])) {
-                               notice(L10n::t('Only parent users can create additional accounts.'));
+                               notice(DI::l10n()->t('Only parent users can create additional accounts.'));
                                return '';
                        }
                }
 
                if (!local_user() && (intval(Config::get('config', 'register_policy')) === self::CLOSED)) {
-                       notice(L10n::t('Permission denied.'));
+                       notice(DI::l10n()->t('Permission denied.'));
                        return '';
                }
 
@@ -64,7 +64,7 @@ class Register extends BaseModule
                        $count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']);
                        if ($count >= $max_dailies) {
                                Logger::log('max daily registrations exceeded.');
-                               notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
+                               notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
                                return '';
                        }
                }
@@ -81,9 +81,9 @@ class Register extends BaseModule
                        $fillext  = '';
                        $oidlabel = '';
                } else {
-                       $fillwith = L10n::t('You may (optionally) fill in this form via OpenID by supplying your OpenID and clicking "Register".');
-                       $fillext  = L10n::t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
-                       $oidlabel = L10n::t('Your OpenID (optional): ');
+                       $fillwith = DI::l10n()->t('You may (optionally) fill in this form via OpenID by supplying your OpenID and clicking "Register".');
+                       $fillext  = DI::l10n()->t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.');
+                       $oidlabel = DI::l10n()->t('Your OpenID (optional): ');
                }
 
                if (Config::get('system', 'publish_all')) {
@@ -92,11 +92,11 @@ class Register extends BaseModule
                        $publish_tpl = Renderer::getMarkupTemplate('profile_publish.tpl');
                        $profile_publish = Renderer::replaceMacros($publish_tpl, [
                                '$instance'     => 'reg',
-                               '$pubdesc'      => L10n::t('Include your profile in member directory?'),
+                               '$pubdesc'      => DI::l10n()->t('Include your profile in member directory?'),
                                '$yes_selected' => '',
                                '$no_selected'  => ' checked="checked"',
-                               '$str_yes'      => L10n::t('Yes'),
-                               '$str_no'       => L10n::t('No'),
+                               '$str_yes'      => DI::l10n()->t('Yes'),
+                               '$str_no'       => DI::l10n()->t('No'),
                        ]);
                }
 
@@ -115,42 +115,42 @@ class Register extends BaseModule
                $o = Renderer::replaceMacros($tpl, [
                        '$invitations'  => Config::get('system', 'invitation_only'),
                        '$permonly'     => intval(Config::get('config', 'register_policy')) === self::APPROVE,
-                       '$permonlybox'  => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node'), 'required'],
-                       '$invite_desc'  => L10n::t('Membership on this site is by invitation only.'),
-                       '$invite_label' => L10n::t('Your invitation code: '),
+                       '$permonlybox'  => ['permonlybox', DI::l10n()->t('Note for the admin'), '', DI::l10n()->t('Leave a message for the admin, why you want to join this node'), 'required'],
+                       '$invite_desc'  => DI::l10n()->t('Membership on this site is by invitation only.'),
+                       '$invite_label' => DI::l10n()->t('Your invitation code: '),
                        '$invite_id'    => $invite_id,
-                       '$regtitle'     => L10n::t('Registration'),
+                       '$regtitle'     => DI::l10n()->t('Registration'),
                        '$registertext' => BBCode::convert(Config::get('config', 'register_text', '')),
                        '$fillwith'     => $fillwith,
                        '$fillext'      => $fillext,
                        '$oidlabel'     => $oidlabel,
                        '$openid'       => $openid_url,
-                       '$namelabel'    => L10n::t('Your Full Name (e.g. Joe Smith, real or real-looking): '),
-                       '$addrlabel'    => L10n::t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
-                       '$addrlabel2'   => L10n::t('Please repeat your e-mail address:'),
+                       '$namelabel'    => DI::l10n()->t('Your Full Name (e.g. Joe Smith, real or real-looking): '),
+                       '$addrlabel'    => DI::l10n()->t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
+                       '$addrlabel2'   => DI::l10n()->t('Please repeat your e-mail address:'),
                        '$ask_password' => $ask_password,
-                       '$password1'    => ['password1', L10n::t('New Password:'), '', L10n::t('Leave empty for an auto generated password.')],
-                       '$password2'    => ['confirm', L10n::t('Confirm:'), '', ''],
-                       '$nickdesc'     => L10n::t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be "<strong>nickname@%s</strong>".', DI::baseUrl()->getHostname()),
-                       '$nicklabel'    => L10n::t('Choose a nickname: '),
+                       '$password1'    => ['password1', DI::l10n()->t('New Password:'), '', DI::l10n()->t('Leave empty for an auto generated password.')],
+                       '$password2'    => ['confirm', DI::l10n()->t('Confirm:'), '', ''],
+                       '$nickdesc'     => DI::l10n()->t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be "<strong>nickname@%s</strong>".', DI::baseUrl()->getHostname()),
+                       '$nicklabel'    => DI::l10n()->t('Choose a nickname: '),
                        '$photo'        => $photo,
                        '$publish'      => $profile_publish,
-                       '$regbutt'      => L10n::t('Register'),
+                       '$regbutt'      => DI::l10n()->t('Register'),
                        '$username'     => $username,
                        '$email'        => $email,
                        '$nickname'     => $nickname,
                        '$sitename'     => DI::baseUrl()->getHostname(),
-                       '$importh'      => L10n::t('Import'),
-                       '$importt'      => L10n::t('Import your profile to this friendica instance'),
+                       '$importh'      => DI::l10n()->t('Import'),
+                       '$importt'      => DI::l10n()->t('Import your profile to this friendica instance'),
                        '$showtoslink'  => Config::get('system', 'tosdisplay'),
-                       '$tostext'      => L10n::t('Terms of Service'),
+                       '$tostext'      => DI::l10n()->t('Terms of Service'),
                        '$showprivstatement' => Config::get('system', 'tosprivstatement'),
                        '$privstatement'=> $tos->privacy_complete,
                        '$form_security_token' => BaseModule::getFormSecurityToken('register'),
                        '$explicit_content' => Config::get('system', 'explicit_content', false),
-                       '$explicit_content_note' => L10n::t('Note: This node explicitly contains adult content'),
+                       '$explicit_content_note' => DI::l10n()->t('Note: This node explicitly contains adult content'),
                        '$additional'   => !empty(local_user()),
-                       '$parent_password' => ['parent_password', L10n::t('Parent Password:'), '', L10n::t('Please enter the password of the parent account to legitimize your request.')]
+                       '$parent_password' => ['parent_password', DI::l10n()->t('Parent Password:'), '', DI::l10n()->t('Please enter the password of the parent account to legitimize your request.')]
 
                ]);
 
@@ -175,19 +175,19 @@ class Register extends BaseModule
                $additional_account = false;
 
                if (!local_user() && !empty($arr['post']['parent_password'])) {
-                       notice(L10n::t('Permission denied.'));
+                       notice(DI::l10n()->t('Permission denied.'));
                        return;
                } elseif (local_user() && !empty($arr['post']['parent_password'])) {
                        try {
                                Model\User::getIdFromPasswordAuthentication(local_user(), $arr['post']['parent_password']);
                        } catch (\Exception $ex) {
-                               notice(L10n::t("Password doesn't match."));
+                               notice(DI::l10n()->t("Password doesn't match."));
                                $regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
                                DI::baseUrl()->redirect('register?' . http_build_query($regdata));
                        }
                        $additional_account = true;
                } elseif (local_user()) {
-                       notice(L10n::t('Please enter your password.'));
+                       notice(DI::l10n()->t('Please enter your password.'));
                        $regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
                        DI::baseUrl()->redirect('register?' . http_build_query($regdata));
                }
@@ -214,7 +214,7 @@ class Register extends BaseModule
                        case self::CLOSED:
                        default:
                                if (empty($_SESSION['authenticated']) && empty($_SESSION['administrator'])) {
-                                       notice(L10n::t('Permission denied.'));
+                                       notice(DI::l10n()->t('Permission denied.'));
                                        return;
                                }
                                $blocked = 1;
@@ -229,7 +229,7 @@ class Register extends BaseModule
                // Is there text in the tar pit?
                if (!empty($arr['email'])) {
                        Logger::info('Tar pit', $arr);
-                       notice(L10n::t('You have entered too much information.'));
+                       notice(DI::l10n()->t('You have entered too much information.'));
                        DI::baseUrl()->redirect('register/');
                }
 
@@ -240,7 +240,7 @@ class Register extends BaseModule
                if ($additional_account) {
                        $user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]);
                        if (!DBA::isResult($user)) {
-                               notice(L10n::t('User not found.'));
+                               notice(DI::l10n()->t('User not found.'));
                                DI::baseUrl()->redirect('register');
                        }
 
@@ -253,7 +253,7 @@ class Register extends BaseModule
 
                if ($arr['email'] != $arr['repeat']) {
                        Logger::info('Mail mismatch', $arr);
-                       notice(L10n::t('Please enter the identical mail address in the second field.'));
+                       notice(DI::l10n()->t('Please enter the identical mail address in the second field.'));
                        $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']];
                        DI::baseUrl()->redirect('register?' . http_build_query($regdata));
                }
@@ -280,7 +280,7 @@ class Register extends BaseModule
 
                if ($additional_account) {
                        DBA::update('user', ['parent-uid' => local_user()], ['uid' => $user['uid']]);
-                       info(L10n::t('The additional account was created.'));
+                       info(DI::l10n()->t('The additional account was created.'));
                        DI::baseUrl()->redirect('delegation');
                }
 
@@ -305,29 +305,29 @@ class Register extends BaseModule
                                );
 
                                if ($res) {
-                                       info(L10n::t('Registration successful. Please check your email for further instructions.'));
+                                       info(DI::l10n()->t('Registration successful. Please check your email for further instructions.'));
                                        DI::baseUrl()->redirect();
                                } else {
                                        notice(
-                                               L10n::t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
+                                               DI::l10n()->t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
                                                        $user['email'],
                                                        $result['password'])
                                        );
                                }
                        } else {
-                               info(L10n::t('Registration successful.'));
+                               info(DI::l10n()->t('Registration successful.'));
                                DI::baseUrl()->redirect();
                        }
                } elseif (intval(Config::get('config', 'register_policy')) === self::APPROVE) {
                        if (!strlen(Config::get('config', 'admin_email'))) {
-                               notice(L10n::t('Your registration can not be processed.'));
+                               notice(DI::l10n()->t('Your registration can not be processed.'));
                                DI::baseUrl()->redirect();
                        }
 
                        // Check if the note to the admin is actually filled out
                        if (empty($_POST['permonlybox'])) {
-                               notice(L10n::t('You have to leave a request note for the admin.')
-                                       . L10n::t('Your registration can not be processed.'));
+                               notice(DI::l10n()->t('You have to leave a request note for the admin.')
+                                       . DI::l10n()->t('Your registration can not be processed.'));
 
                                DI::baseUrl()->redirect('register/');
                        }
@@ -374,7 +374,7 @@ class Register extends BaseModule
                                $result['password']
                        );
 
-                       info(L10n::t('Your registration is pending approval by the site owner.'));
+                       info(DI::l10n()->t('Your registration is pending approval by the site owner.'));
                        DI::baseUrl()->redirect();
                }
 
index 74ce55fb53597a66d29ba705a3ded9458d3acdd0..2455e2cb834922e9021534f1ae879b968a20d00f 100644 (file)
@@ -34,7 +34,7 @@ class Acl extends BaseModule
        public static function rawContent(array $parameters = [])
        {
                if (!local_user()) {
-                       throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this module.'));
+                       throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
                }
 
                $type = $_REQUEST['type'] ?? self::TYPE_MENTION_CONTACT_GROUP;
index 55510aa5391de55b22981db336311783abb2546c..093c0f9fbd57922c2563f842acb6356ceb2d6225 100644 (file)
@@ -17,7 +17,7 @@ class Directory extends BaseSearchModule
        public static function content(array $parameters = [])
        {
                if (!local_user()) {
-                       notice(L10n::t('Permission denied.'));
+                       notice(DI::l10n()->t('Permission denied.'));
                        return Login::form();
                }
 
index 98c593f45fd842e159b5e850713934101229702e..2b86617c168433b4a04c0209e8e85b08dc78969d 100644 (file)
@@ -28,12 +28,12 @@ class Index extends BaseSearchModule
                $search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : '');
 
                if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Public access denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
                }
 
                if (Config::get('system', 'local_search') && !Session::isAuthenticated()) {
-                       $e = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a search.'));
-                       $e->httpdesc = L10n::t('Public access denied.');
+                       $e = new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a search.'));
+                       $e->httpdesc = DI::l10n()->t('Public access denied.');
                        throw $e;
                }
 
@@ -54,7 +54,7 @@ class Index extends BaseSearchModule
                        if (!is_null($result)) {
                                $resultdata = json_decode($result);
                                if (($resultdata->time > (time() - $crawl_permit_period)) && ($resultdata->accesses > $free_crawls)) {
-                                       throw new HTTPException\TooManyRequestsException(L10n::t('Only one search per minute is permitted for not logged in users.'));
+                                       throw new HTTPException\TooManyRequestsException(DI::l10n()->t('Only one search per minute is permitted for not logged in users.'));
                                }
                                DI::cache()->set('remote_search:' . $remote, json_encode(['time' => time(), 'accesses' => $resultdata->accesses + 1]), Duration::HOUR);
                        } else {
@@ -77,7 +77,7 @@ class Index extends BaseSearchModule
                // contruct a wrapper for the search header
                $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('content_wrapper.tpl'), [
                        'name' => 'search-header',
-                       '$title' => L10n::t('Search'),
+                       '$title' => DI::l10n()->t('Search'),
                        '$title_size' => 3,
                        '$content' => HTML::search($search, 'search-box', false)
                ]);
@@ -167,14 +167,14 @@ class Index extends BaseSearchModule
                }
 
                if (!DBA::isResult($r)) {
-                       info(L10n::t('No results.'));
+                       info(DI::l10n()->t('No results.'));
                        return $o;
                }
 
                if ($tag) {
-                       $title = L10n::t('Items tagged with: %s', $search);
+                       $title = DI::l10n()->t('Items tagged with: %s', $search);
                } else {
-                       $title = L10n::t('Results for: %s', $search);
+                       $title = DI::l10n()->t('Results for: %s', $search);
                }
 
                $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
index 47925b0ae1348426db08401a4224bc0d84f6fae5..72232ac7d670a11f2f268e27acb80f487af02de2 100644 (file)
@@ -23,15 +23,15 @@ class Saved extends BaseModule
                                        $fields = ['uid' => local_user(), 'term' => $search];
                                        if (!DBA::exists('search', $fields)) {
                                                DBA::insert('search', $fields);
-                                               info(L10n::t('Search term successfully saved.'));
+                                               info(DI::l10n()->t('Search term successfully saved.'));
                                        } else {
-                                               info(L10n::t('Search term already saved.'));
+                                               info(DI::l10n()->t('Search term already saved.'));
                                        }
                                        break;
 
                                case 'remove':
                                        DBA::delete('search', ['uid' => local_user(), 'term' => $search]);
-                                       info(L10n::t('Search term successfully removed.'));
+                                       info(DI::l10n()->t('Search term successfully removed.'));
                                        break;
                        }
                }
index e2e9ff04d72b89ef04e6c5c3b2c8c1027a81540b..9e5a7b18a1d5c9b866ceeb9ba64bbb47d8e2adae 100644 (file)
@@ -87,8 +87,8 @@ class Login extends BaseModule
                $reg = false;
                if ($register && intval(DI::config()->get('config', 'register_policy')) !== Register::CLOSED) {
                        $reg = [
-                               'title' => L10n::t('Create a New Account'),
-                               'desc' => L10n::t('Register'),
+                               'title' => DI::l10n()->t('Create a New Account'),
+                               'desc' => DI::l10n()->t('Register'),
                                'url' => self::getRegisterURL()
                        ];
                }
@@ -112,12 +112,12 @@ class Login extends BaseModule
                }
 
                if (!empty(Session::get('openid_identity'))) {
-                       $openid_title = L10n::t('Your OpenID: ');
+                       $openid_title = DI::l10n()->t('Your OpenID: ');
                        $openid_readonly = true;
                        $identity = Session::get('openid_identity');
-                       $username_desc = L10n::t('Please enter your username and password to add the OpenID to your existing account.');
+                       $username_desc = DI::l10n()->t('Please enter your username and password to add the OpenID to your existing account.');
                } else {
-                       $openid_title = L10n::t('Or login using OpenID: ');
+                       $openid_title = DI::l10n()->t('Or login using OpenID: ');
                        $openid_readonly = false;
                        $identity = '';
                        $username_desc = '';
@@ -127,12 +127,12 @@ class Login extends BaseModule
                        $tpl,
                        [
                                '$dest_url'     => DI::baseUrl()->get(true) . '/login',
-                               '$logout'       => L10n::t('Logout'),
-                               '$login'        => L10n::t('Login'),
+                               '$logout'       => DI::l10n()->t('Logout'),
+                               '$login'        => DI::l10n()->t('Login'),
 
-                               '$lname'        => ['username', L10n::t('Nickname or Email: '), '', $username_desc],
-                               '$lpassword'    => ['password', L10n::t('Password: '), '', ''],
-                               '$lremember'    => ['remember', L10n::t('Remember me'), 0,  ''],
+                               '$lname'        => ['username', DI::l10n()->t('Nickname or Email: '), '', $username_desc],
+                               '$lpassword'    => ['password', DI::l10n()->t('Password: '), '', ''],
+                               '$lremember'    => ['remember', DI::l10n()->t('Remember me'), 0,  ''],
 
                                '$openid'       => !$noid,
                                '$lopenid'      => ['openid_url', $openid_title, $identity, '', $openid_readonly],
@@ -141,14 +141,14 @@ class Login extends BaseModule
 
                                '$register'     => $reg,
 
-                               '$lostpass'     => L10n::t('Forgot your password?'),
-                               '$lostlink'     => L10n::t('Password Reset'),
+                               '$lostpass'     => DI::l10n()->t('Forgot your password?'),
+                               '$lostlink'     => DI::l10n()->t('Password Reset'),
 
-                               '$tostitle'     => L10n::t('Website Terms of Service'),
-                               '$toslink'      => L10n::t('terms of service'),
+                               '$tostitle'     => DI::l10n()->t('Website Terms of Service'),
+                               '$toslink'      => DI::l10n()->t('terms of service'),
 
-                               '$privacytitle' => L10n::t('Website Privacy Policy'),
-                               '$privacylink'  => L10n::t('privacy policy'),
+                               '$privacytitle' => DI::l10n()->t('Website Privacy Policy'),
+                               '$privacylink'  => DI::l10n()->t('privacy policy'),
                        ]
                );
 
index bbbb2d44514dbe38635ab81b486749d2bf267007..443256d9769499d26275db6195d5f2f1ad820819 100644 (file)
@@ -40,11 +40,11 @@ class Recovery extends BaseModule
                        if (RecoveryCode::existsForUser(local_user(), $recovery_code)) {
                                RecoveryCode::markUsedForUser(local_user(), $recovery_code);
                                Session::set('2fa', true);
-                               notice(L10n::t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
+                               notice(DI::l10n()->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
 
                                DI::auth()->setForUser($a, $a->user, true, true);
                        } else {
-                               notice(L10n::t('Invalid code, please retry.'));
+                               notice(DI::l10n()->t('Invalid code, please retry.'));
                        }
                }
        }
@@ -63,11 +63,11 @@ class Recovery extends BaseModule
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/recovery.tpl'), [
                        '$form_security_token' => self::getFormSecurityToken('twofactor_recovery'),
 
-                       '$title'            => L10n::t('Two-factor recovery'),
-                       '$message'          => L10n::t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
-                       '$recovery_message' => L10n::t('Don’t have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
-                       '$recovery_code'    => ['recovery_code', L10n::t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
-                       '$recovery_label'   => L10n::t('Submit recovery code and complete login'),
+                       '$title'            => DI::l10n()->t('Two-factor recovery'),
+                       '$message'          => DI::l10n()->t('<p>You can enter one of your one-time recovery codes in case you lost access to your mobile device.</p>'),
+                       '$recovery_message' => DI::l10n()->t('Don’t have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
+                       '$recovery_code'    => ['recovery_code', DI::l10n()->t('Please enter a recovery code'), '', '', '', 'placeholder="000000-000000"'],
+                       '$recovery_label'   => DI::l10n()->t('Submit recovery code and complete login'),
                ]);
        }
 }
index c00c8abe5897b109c3ec4dda942415058246d678..a95b02d42e061178706277841b9d88bb009072ce 100644 (file)
@@ -40,7 +40,7 @@ class Verify extends BaseModule
                                // Resume normal login workflow
                                DI::auth()->setForUser($a, $a->user, true, true);
                        } else {
-                               self::$errors[] = L10n::t('Invalid code, please retry.');
+                               self::$errors[] = DI::l10n()->t('Invalid code, please retry.');
                        }
                }
        }
@@ -59,13 +59,13 @@ class Verify extends BaseModule
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('twofactor/verify.tpl'), [
                        '$form_security_token' => self::getFormSecurityToken('twofactor_verify'),
 
-                       '$title'            => L10n::t('Two-factor authentication'),
-                       '$message'          => L10n::t('<p>Open the two-factor authentication app on your device to get an authentication code and verify your identity.</p>'),
+                       '$title'            => DI::l10n()->t('Two-factor authentication'),
+                       '$message'          => DI::l10n()->t('<p>Open the two-factor authentication app on your device to get an authentication code and verify your identity.</p>'),
                        '$errors_label'     => L10n::tt('Error', 'Errors', count(self::$errors)),
                        '$errors'           => self::$errors,
-                       '$recovery_message' => L10n::t('Don’t have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
-                       '$verify_code'      => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"', 'tel'],
-                       '$verify_label'     => L10n::t('Verify code and complete login'),
+                       '$recovery_message' => DI::l10n()->t('Don’t have your phone? <a href="%s">Enter a two-factor recovery code</a>', '2fa/recovery'),
+                       '$verify_code'      => ['verify_code', DI::l10n()->t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"', 'tel'],
+                       '$verify_label'     => DI::l10n()->t('Verify code and complete login'),
                ]);
        }
 }
index f0a335550a618a3d8b823bda9ceaba35e502f5ab..dffb23eb6f6a2feaa5c79da01bcc6e5f06f0dc56 100644 (file)
@@ -23,7 +23,7 @@ class Delegation extends BaseSettingsModule
        public static function post(array $parameters = [])
        {
                if (!local_user() || !empty(DI::app()->user['uid']) && DI::app()->user['uid'] != local_user()) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                BaseModule::checkFormSecurityTokenRedirectOnError('settings/delegation', 'delegate');
@@ -34,13 +34,13 @@ class Delegation extends BaseSettingsModule
                if ($parent_uid != 0) {
                        try {
                                User::getIdFromPasswordAuthentication($parent_uid, $parent_password);
-                               info(L10n::t('Delegation successfully granted.'));
+                               info(DI::l10n()->t('Delegation successfully granted.'));
                        } catch (\Exception $ex) {
-                               notice(L10n::t('Parent user not found, unavailable or password doesn\'t match.'));
+                               notice(DI::l10n()->t('Parent user not found, unavailable or password doesn\'t match.'));
                                return;
                        }
                } else {
-                       info(L10n::t('Delegation successfully revoked.'));
+                       info(DI::l10n()->t('Delegation successfully revoked.'));
                }
 
                DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
@@ -51,7 +51,7 @@ class Delegation extends BaseSettingsModule
                parent::content($parameters);
 
                if (!local_user()) {
-                       throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
+                       throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                $args = DI::args();
@@ -62,7 +62,7 @@ class Delegation extends BaseSettingsModule
 
                if ($action === 'add' && $user_id) {
                        if (Session::get('submanage')) {
-                               notice(L10n::t('Delegated administrators can view but not change delegation permissions.'));
+                               notice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.'));
                                DI::baseUrl()->redirect('settings/delegation');
                        }
 
@@ -76,7 +76,7 @@ class Delegation extends BaseSettingsModule
                                        DBA::insert('manage', ['uid' => $user_id, 'mid' => local_user()]);
                                }
                        } else {
-                               notice(L10n::t('Delegate user not found.'));
+                               notice(DI::l10n()->t('Delegate user not found.'));
                        }
 
                        DI::baseUrl()->redirect('settings/delegation');
@@ -84,7 +84,7 @@ class Delegation extends BaseSettingsModule
 
                if ($action === 'remove' && $user_id) {
                        if (Session::get('submanage')) {
-                               notice(L10n::t('Delegated administrators can view but not change delegation permissions.'));
+                               notice(DI::l10n()->t('Delegated administrators can view but not change delegation permissions.'));
                                DI::baseUrl()->redirect('settings/delegation');
                        }
 
@@ -123,7 +123,7 @@ class Delegation extends BaseSettingsModule
                $user = User::getById(local_user(), ['parent-uid', 'email']);
                if (DBA::isResult($user) && !DBA::exists('user', ['parent-uid' => local_user()])) {
                        $parent_uid = $user['parent-uid'];
-                       $parents = [0 => L10n::t('No parent user')];
+                       $parents = [0 => DI::l10n()->t('No parent user')];
 
                        $fields = ['uid', 'username', 'nickname'];
                        $condition = ['email' => $user['email'], 'verified' => true, 'blocked' => false, 'parent-uid' => 0];
@@ -135,33 +135,33 @@ class Delegation extends BaseSettingsModule
                        }
 
                        $parent_user = ['parent_user', '', $parent_uid, '', $parents];
-                       $parent_password = ['parent_password', L10n::t('Parent Password:'), '', L10n::t('Please enter the password of the parent account to legitimize your request.')];
+                       $parent_password = ['parent_password', DI::l10n()->t('Parent Password:'), '', DI::l10n()->t('Please enter the password of the parent account to legitimize your request.')];
                }
 
                $is_child_user = !empty($user['parent-uid']);
 
                $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/delegation.tpl'), [
                        '$form_security_token' => BaseModule::getFormSecurityToken('delegate'),
-                       '$account_header' => L10n::t('Additional Accounts'),
-                       '$account_desc' => L10n::t('Register additional accounts that are automatically connected to your existing account so you can manage it from this account.'),
-                       '$add_account' => L10n::t('Register an additional account'),
-                       '$parent_header' => L10n::t('Parent User'),
+                       '$account_header' => DI::l10n()->t('Additional Accounts'),
+                       '$account_desc' => DI::l10n()->t('Register additional accounts that are automatically connected to your existing account so you can manage it from this account.'),
+                       '$add_account' => DI::l10n()->t('Register an additional account'),
+                       '$parent_header' => DI::l10n()->t('Parent User'),
                        '$parent_user' => $parent_user,
                        '$parent_password' => $parent_password,
-                       '$parent_desc' => L10n::t('Parent users have total control about this account, including the account settings. Please double check whom you give this access.'),
+                       '$parent_desc' => DI::l10n()->t('Parent users have total control about this account, including the account settings. Please double check whom you give this access.'),
                        '$is_child_user' => $is_child_user,
-                       '$submit' => L10n::t('Save Settings'),
-                       '$header' => L10n::t('Manage Accounts'),
-                       '$delegates_header' => L10n::t('Delegates'),
+                       '$submit' => DI::l10n()->t('Save Settings'),
+                       '$header' => DI::l10n()->t('Manage Accounts'),
+                       '$delegates_header' => DI::l10n()->t('Delegates'),
                        '$base' => DI::baseUrl(),
-                       '$desc' => L10n::t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'),
-                       '$head_delegates' => L10n::t('Existing Page Delegates'),
+                       '$desc' => DI::l10n()->t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'),
+                       '$head_delegates' => DI::l10n()->t('Existing Page Delegates'),
                        '$delegates' => $delegates,
-                       '$head_potentials' => L10n::t('Potential Delegates'),
+                       '$head_potentials' => DI::l10n()->t('Potential Delegates'),
                        '$potentials' => $potentials,
-                       '$remove' => L10n::t('Remove'),
-                       '$add' => L10n::t('Add'),
-                       '$none' => L10n::t('No entries.')
+                       '$remove' => DI::l10n()->t('Remove'),
+                       '$add' => DI::l10n()->t('Add'),
+                       '$none' => DI::l10n()->t('No entries.')
                ]);
 
                return $o;
index d87247346e748ceb1889667ba127fd331e631e89..f80e466a844cc648640dae2a181f0bff18e5cc89 100644 (file)
@@ -31,7 +31,7 @@ class AppSpecific extends BaseSettingsModule
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice(L10n::t('Please enter your password to access this page.'));
+                       notice(DI::l10n()->t('Please enter your password to access this page.'));
                        DI::baseUrl()->redirect('settings/2fa');
                }
        }
@@ -49,20 +49,20 @@ class AppSpecific extends BaseSettingsModule
                                case 'generate':
                                        $description = $_POST['description'] ?? '';
                                        if (empty($description)) {
-                                               notice(L10n::t('App-specific password generation failed: The description is empty.'));
+                                               notice(DI::l10n()->t('App-specific password generation failed: The description is empty.'));
                                                DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        } elseif (AppSpecificPassword::checkDuplicateForUser(local_user(), $description)) {
-                                               notice(L10n::t('App-specific password generation failed: This description already exists.'));
+                                               notice(DI::l10n()->t('App-specific password generation failed: This description already exists.'));
                                                DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        } else {
                                                self::$appSpecificPassword = AppSpecificPassword::generateForUser(local_user(), $_POST['description'] ?? '');
-                                               notice(L10n::t('New app-specific password generated.'));
+                                               notice(DI::l10n()->t('New app-specific password generated.'));
                                        }
 
                                        break;
                                case 'revoke_all' :
                                        AppSpecificPassword::deleteAllForUser(local_user());
-                                       notice(L10n::t('App-specific passwords successfully revoked.'));
+                                       notice(DI::l10n()->t('App-specific passwords successfully revoked.'));
                                        DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
                                        break;
                        }
@@ -72,7 +72,7 @@ class AppSpecific extends BaseSettingsModule
                        self::checkFormSecurityTokenRedirectOnError('settings/2fa/app_specific', 'settings_2fa_app_specific');
 
                        if (AppSpecificPassword::deleteForUser(local_user(), $_POST['revoke_id'])) {
-                               notice(L10n::t('App-specific password successfully revoked.'));
+                               notice(DI::l10n()->t('App-specific password successfully revoked.'));
                        }
 
                        DI::baseUrl()->redirect('settings/2fa/app_specific?t=' . self::getFormSecurityToken('settings_2fa_password'));
@@ -93,22 +93,22 @@ class AppSpecific extends BaseSettingsModule
                        '$form_security_token'     => self::getFormSecurityToken('settings_2fa_app_specific'),
                        '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
 
-                       '$title'                  => L10n::t('Two-factor app-specific passwords'),
-                       '$help_label'             => L10n::t('Help'),
-                       '$message'                => L10n::t('<p>App-specific passwords are randomly generated passwords used instead your regular password to authenticate your account on third-party applications that don\'t support two-factor authentication.</p>'),
-                       '$generated_message'      => L10n::t('Make sure to copy your new app-specific password now. You won’t be able to see it again!'),
+                       '$title'                  => DI::l10n()->t('Two-factor app-specific passwords'),
+                       '$help_label'             => DI::l10n()->t('Help'),
+                       '$message'                => DI::l10n()->t('<p>App-specific passwords are randomly generated passwords used instead your regular password to authenticate your account on third-party applications that don\'t support two-factor authentication.</p>'),
+                       '$generated_message'      => DI::l10n()->t('Make sure to copy your new app-specific password now. You won’t be able to see it again!'),
                        '$generated_app_specific_password' => self::$appSpecificPassword,
 
-                       '$description_label'      => L10n::t('Description'),
-                       '$last_used_label'        => L10n::t('Last Used'),
-                       '$revoke_label'           => L10n::t('Revoke'),
-                       '$revoke_all_label'       => L10n::t('Revoke All'),
+                       '$description_label'      => DI::l10n()->t('Description'),
+                       '$last_used_label'        => DI::l10n()->t('Last Used'),
+                       '$revoke_label'           => DI::l10n()->t('Revoke'),
+                       '$revoke_all_label'       => DI::l10n()->t('Revoke All'),
 
                        '$app_specific_passwords' => $appSpecificPasswords,
-                       '$generate_message'       => L10n::t('When you generate a new app-specific password, you must use it right away, it will be shown to you once after you generate it.'),
-                       '$generate_title'         => L10n::t('Generate new app-specific password'),
-                       '$description_placeholder_label' => L10n::t('Friendiqa on my Fairphone 2...'),
-                       '$generate_label' => L10n::t('Generate'),
+                       '$generate_message'       => DI::l10n()->t('When you generate a new app-specific password, you must use it right away, it will be shown to you once after you generate it.'),
+                       '$generate_title'         => DI::l10n()->t('Generate new app-specific password'),
+                       '$description_placeholder_label' => DI::l10n()->t('Friendiqa on my Fairphone 2...'),
+                       '$generate_label' => DI::l10n()->t('Generate'),
                ]);
        }
 }
index df06333fce8bebc3cc71cdd4b739c59b75e00415..0385b8dba42e5f6122ea017c5ba16c4fe50a2aac 100644 (file)
@@ -46,7 +46,7 @@ class Index extends BaseSettingsModule
                                                DI::pConfig()->delete(local_user(), '2fa', 'verified');
                                                Session::remove('2fa');
 
-                                               notice(L10n::t('Two-factor authentication successfully disabled.'));
+                                               notice(DI::l10n()->t('Two-factor authentication successfully disabled.'));
                                                DI::baseUrl()->redirect('settings/2fa');
                                        }
                                        break;
@@ -67,7 +67,7 @@ class Index extends BaseSettingsModule
                                        break;
                        }
                } catch (\Exception $e) {
-                       notice(L10n::t('Wrong Password'));
+                       notice(DI::l10n()->t('Wrong Password'));
                }
        }
 
@@ -84,35 +84,35 @@ class Index extends BaseSettingsModule
 
                return Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/twofactor/index.tpl'), [
                        '$form_security_token' => self::getFormSecurityToken('settings_2fa'),
-                       '$title'               => L10n::t('Two-factor authentication'),
-                       '$help_label'          => L10n::t('Help'),
-                       '$status_title'        => L10n::t('Status'),
-                       '$message'             => L10n::t('<p>Use an application on a mobile device to get two-factor authentication codes when prompted on login.</p>'),
+                       '$title'               => DI::l10n()->t('Two-factor authentication'),
+                       '$help_label'          => DI::l10n()->t('Help'),
+                       '$status_title'        => DI::l10n()->t('Status'),
+                       '$message'             => DI::l10n()->t('<p>Use an application on a mobile device to get two-factor authentication codes when prompted on login.</p>'),
                        '$has_secret'          => $has_secret,
                        '$verified'            => $verified,
 
-                       '$auth_app_label'         => L10n::t('Authenticator app'),
-                       '$app_status'             => $has_secret ? $verified ? L10n::t('Configured') : L10n::t('Not Configured') : L10n::t('Disabled'),
-                       '$not_configured_message' => L10n::t('<p>You haven\'t finished configuring your authenticator app.</p>'),
-                       '$configured_message'     => L10n::t('<p>Your authenticator app is correctly configured.</p>'),
+                       '$auth_app_label'         => DI::l10n()->t('Authenticator app'),
+                       '$app_status'             => $has_secret ? $verified ? DI::l10n()->t('Configured') : DI::l10n()->t('Not Configured') : DI::l10n()->t('Disabled'),
+                       '$not_configured_message' => DI::l10n()->t('<p>You haven\'t finished configuring your authenticator app.</p>'),
+                       '$configured_message'     => DI::l10n()->t('<p>Your authenticator app is correctly configured.</p>'),
 
-                       '$recovery_codes_title'     => L10n::t('Recovery codes'),
-                       '$recovery_codes_remaining' => L10n::t('Remaining valid codes'),
+                       '$recovery_codes_title'     => DI::l10n()->t('Recovery codes'),
+                       '$recovery_codes_remaining' => DI::l10n()->t('Remaining valid codes'),
                        '$recovery_codes_count'     => RecoveryCode::countValidForUser(local_user()),
-                       '$recovery_codes_message'   => L10n::t('<p>These one-use codes can replace an authenticator app code in case you have lost access to it.</p>'),
+                       '$recovery_codes_message'   => DI::l10n()->t('<p>These one-use codes can replace an authenticator app code in case you have lost access to it.</p>'),
 
-                       '$app_specific_passwords_title'     => L10n::t('App-specific passwords'),
-                       '$app_specific_passwords_remaining' => L10n::t('Generated app-specific passwords'),
+                       '$app_specific_passwords_title'     => DI::l10n()->t('App-specific passwords'),
+                       '$app_specific_passwords_remaining' => DI::l10n()->t('Generated app-specific passwords'),
                        '$app_specific_passwords_count'     => AppSpecificPassword::countForUser(local_user()),
-                       '$app_specific_passwords_message'   => L10n::t('<p>These randomly generated passwords allow you to authenticate on apps not supporting two-factor authentication.</p>'),
-
-                       '$action_title'         => L10n::t('Actions'),
-                       '$password'             => ['password', L10n::t('Current password:'), '', L10n::t('You need to provide your current password to change two-factor authentication settings.'), 'required', 'autofocus'],
-                       '$enable_label'         => L10n::t('Enable two-factor authentication'),
-                       '$disable_label'        => L10n::t('Disable two-factor authentication'),
-                       '$recovery_codes_label' => L10n::t('Show recovery codes'),
-                       '$app_specific_passwords_label' => L10n::t('Manage app-specific passwords'),
-                       '$configure_label'      => L10n::t('Finish app configuration'),
+                       '$app_specific_passwords_message'   => DI::l10n()->t('<p>These randomly generated passwords allow you to authenticate on apps not supporting two-factor authentication.</p>'),
+
+                       '$action_title'         => DI::l10n()->t('Actions'),
+                       '$password'             => ['password', DI::l10n()->t('Current password:'), '', DI::l10n()->t('You need to provide your current password to change two-factor authentication settings.'), 'required', 'autofocus'],
+                       '$enable_label'         => DI::l10n()->t('Enable two-factor authentication'),
+                       '$disable_label'        => DI::l10n()->t('Disable two-factor authentication'),
+                       '$recovery_codes_label' => DI::l10n()->t('Show recovery codes'),
+                       '$app_specific_passwords_label' => DI::l10n()->t('Manage app-specific passwords'),
+                       '$configure_label'      => DI::l10n()->t('Finish app configuration'),
                ]);
        }
 }
index 604eca480274bc14acc8ade6a799afbab40a7aa6..fbfb0b183d11762fe4c486c693713a01b9fff4f1 100644 (file)
@@ -29,7 +29,7 @@ class Recovery extends BaseSettingsModule
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice(L10n::t('Please enter your password to access this page.'));
+                       notice(DI::l10n()->t('Please enter your password to access this page.'));
                        DI::baseUrl()->redirect('settings/2fa');
                }
        }
@@ -45,7 +45,7 @@ class Recovery extends BaseSettingsModule
 
                        if ($_POST['action'] == 'regenerate') {
                                RecoveryCode::regenerateForUser(local_user());
-                               notice(L10n::t('New recovery codes successfully generated.'));
+                               notice(DI::l10n()->t('New recovery codes successfully generated.'));
                                DI::baseUrl()->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
                        }
                }
@@ -71,14 +71,14 @@ class Recovery extends BaseSettingsModule
                        '$form_security_token'     => self::getFormSecurityToken('settings_2fa_recovery'),
                        '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
 
-                       '$title'              => L10n::t('Two-factor recovery codes'),
-                       '$help_label'         => L10n::t('Help'),
-                       '$message'            => L10n::t('<p>Recovery codes can be used to access your account in the event you lose access to your device and cannot receive two-factor authentication codes.</p><p><strong>Put these in a safe spot!</strong> If you lose your device and don’t have the recovery codes you will lose access to your account.</p>'),
+                       '$title'              => DI::l10n()->t('Two-factor recovery codes'),
+                       '$help_label'         => DI::l10n()->t('Help'),
+                       '$message'            => DI::l10n()->t('<p>Recovery codes can be used to access your account in the event you lose access to your device and cannot receive two-factor authentication codes.</p><p><strong>Put these in a safe spot!</strong> If you lose your device and don’t have the recovery codes you will lose access to your account.</p>'),
                        '$recovery_codes'     => $recoveryCodes,
-                       '$regenerate_message' => L10n::t('When you generate new recovery codes, you must copy the new codes. Your old codes won’t work anymore.'),
-                       '$regenerate_label'   => L10n::t('Generate new recovery codes'),
+                       '$regenerate_message' => DI::l10n()->t('When you generate new recovery codes, you must copy the new codes. Your old codes won’t work anymore.'),
+                       '$regenerate_label'   => DI::l10n()->t('Generate new recovery codes'),
                        '$verified'           => $verified,
-                       '$verify_label'       => L10n::t('Next: Verification'),
+                       '$verify_label'       => DI::l10n()->t('Next: Verification'),
                ]);
        }
 }
index 8371064c39ff230e6feea7619241b8bce37592fa..62867d82bff129ebcbccb2e1e8a7fceb05ad7b81 100644 (file)
@@ -35,7 +35,7 @@ class Verify extends BaseSettingsModule
                }
 
                if (!self::checkFormSecurityToken('settings_2fa_password', 't')) {
-                       notice(L10n::t('Please enter your password to access this page.'));
+                       notice(DI::l10n()->t('Please enter your password to access this page.'));
                        DI::baseUrl()->redirect('settings/2fa');
                }
        }
@@ -57,11 +57,11 @@ class Verify extends BaseSettingsModule
                                DI::pConfig()->set(local_user(), '2fa', 'verified', true);
                                Session::set('2fa', true);
 
-                               notice(L10n::t('Two-factor authentication successfully activated.'));
+                               notice(DI::l10n()->t('Two-factor authentication successfully activated.'));
 
                                DI::baseUrl()->redirect('settings/2fa');
                        } else {
-                               notice(L10n::t('Invalid code, please retry.'));
+                               notice(DI::l10n()->t('Invalid code, please retry.'));
                        }
                }
        }
@@ -90,7 +90,7 @@ class Verify extends BaseSettingsModule
 
                $shortOtpauthUrl = explode('?', $otpauthUrl)[0];
 
-               $manual_message = L10n::t('<p>Or you can submit the authentication settings manually:</p>
+               $manual_message = DI::l10n()->t('<p>Or you can submit the authentication settings manually:</p>
 <dl>
        <dt>Issuer</dt>
        <dd>%s</dd>
@@ -110,18 +110,18 @@ class Verify extends BaseSettingsModule
                        '$form_security_token'     => self::getFormSecurityToken('settings_2fa_verify'),
                        '$password_security_token' => self::getFormSecurityToken('settings_2fa_password'),
 
-                       '$title'              => L10n::t('Two-factor code verification'),
-                       '$help_label'         => L10n::t('Help'),
-                       '$message'            => L10n::t('<p>Please scan this QR Code with your authenticator app and submit the provided code.</p>'),
+                       '$title'              => DI::l10n()->t('Two-factor code verification'),
+                       '$help_label'         => DI::l10n()->t('Help'),
+                       '$message'            => DI::l10n()->t('<p>Please scan this QR Code with your authenticator app and submit the provided code.</p>'),
                        '$qrcode_image'       => $qrcode_image,
-                       '$qrcode_url_message' => L10n::t('<p>Or you can open the following URL in your mobile devicde:</p><p><a href="%s">%s</a></p>', $otpauthUrl, $shortOtpauthUrl),
+                       '$qrcode_url_message' => DI::l10n()->t('<p>Or you can open the following URL in your mobile devicde:</p><p><a href="%s">%s</a></p>', $otpauthUrl, $shortOtpauthUrl),
                        '$manual_message'     => $manual_message,
                        '$company'            => $company,
                        '$holder'             => $holder,
                        '$secret'             => $secret,
 
-                       '$verify_code'  => ['verify_code', L10n::t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"'],
-                       '$verify_label' => L10n::t('Verify code and enable two-factor authentication'),
+                       '$verify_code'  => ['verify_code', DI::l10n()->t('Please enter a code from your authentication app'), '', '', 'required', 'autofocus placeholder="000000"'],
+                       '$verify_label' => DI::l10n()->t('Verify code and enable two-factor authentication'),
                ]);
        }
 }
index 1b7c723a7277a8012af31b32d64cf50efefb0689..36ec0ca0c6c0c0c7a2e60f0f0efe772fd3459ded 100644 (file)
@@ -39,15 +39,15 @@ class UserExport extends BaseSettingsModule
                 * list of array( 'link url', 'link text', 'help text' )
                 */
                $options = [
-                       ['settings/userexport/account', L10n::t('Export account'), L10n::t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')],
-                       ['settings/userexport/backup', L10n::t('Export all'), L10n::t("Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account \x28photos are not exported\x29")],
-                       ['settings/userexport/contact', L10n::t('Export Contacts to CSV'), L10n::t("Export the list of the accounts you are following as CSV file. Compatible to e.g. Mastodon.")],
+                       ['settings/userexport/account', DI::l10n()->t('Export account'), DI::l10n()->t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')],
+                       ['settings/userexport/backup', DI::l10n()->t('Export all'), DI::l10n()->t("Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account \x28photos are not exported\x29")],
+                       ['settings/userexport/contact', DI::l10n()->t('Export Contacts to CSV'), DI::l10n()->t("Export the list of the accounts you are following as CSV file. Compatible to e.g. Mastodon.")],
                ];
                Hook::callAll('uexport_options', $options);
 
                $tpl = Renderer::getMarkupTemplate("settings/userexport.tpl");
                return Renderer::replaceMacros($tpl, [
-                       '$title' => L10n::t('Export personal data'),
+                       '$title' => DI::l10n()->t('Export personal data'),
                        '$options' => $options
                ]);
        }
index 36c770fba78d356493cdd809f2f4230d02c8c1c4..be71278faece666ae95db8c35f7c04b72ca0e329 100644 (file)
@@ -29,30 +29,30 @@ class HTTPException
 
                $titles = [
                        200 => 'OK',
-                       400 => L10n::t('Bad Request'),
-                       401 => L10n::t('Unauthorized'),
-                       403 => L10n::t('Forbidden'),
-                       404 => L10n::t('Not Found'),
-                       500 => L10n::t('Internal Server Error'),
-                       503 => L10n::t('Service Unavailable'),
+                       400 => DI::l10n()->t('Bad Request'),
+                       401 => DI::l10n()->t('Unauthorized'),
+                       403 => DI::l10n()->t('Forbidden'),
+                       404 => DI::l10n()->t('Not Found'),
+                       500 => DI::l10n()->t('Internal Server Error'),
+                       503 => DI::l10n()->t('Service Unavailable'),
                ];
                $title = ($titles[$e->getCode()] ?? '') ?: 'Error ' . $e->getCode();
 
                if (empty($message)) {
                        // Explanations are taken from https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
                        $explanation = [
-                               400 => L10n::t('The server cannot or will not process the request due to an apparent client error.'),
-                               401 => L10n::t('Authentication is required and has failed or has not yet been provided.'),
-                               403 => L10n::t('The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account.'),
-                               404 => L10n::t('The requested resource could not be found but may be available in the future.'),
-                               500 => L10n::t('An unexpected condition was encountered and no more specific message is suitable.'),
-                               503 => L10n::t('The server is currently unavailable (because it is overloaded or down for maintenance). Please try again later.'),
+                               400 => DI::l10n()->t('The server cannot or will not process the request due to an apparent client error.'),
+                               401 => DI::l10n()->t('Authentication is required and has failed or has not yet been provided.'),
+                               403 => DI::l10n()->t('The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account.'),
+                               404 => DI::l10n()->t('The requested resource could not be found but may be available in the future.'),
+                               500 => DI::l10n()->t('An unexpected condition was encountered and no more specific message is suitable.'),
+                               503 => DI::l10n()->t('The server is currently unavailable (because it is overloaded or down for maintenance). Please try again later.'),
                        ];
 
                        $message = $explanation[$e->getCode()] ?? '';
                }
 
-               return ['$title' => $title, '$message' => $message, '$back' => L10n::t('Go back')];
+               return ['$title' => $title, '$message' => $message, '$back' => DI::l10n()->t('Go back')];
        }
 
        /**
index 5442fdf45bfaacefa7fbabbc2f617ef11e21339f..7380488e072c2f95d3b6f12fc5ee67faede622f0 100644 (file)
@@ -32,12 +32,12 @@ class Tos extends BaseModule
         **/
        public function __construct()
        {
-               $this->privacy_operate = L10n::t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
-               $this->privacy_distribute = L10n::t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
-               $this->privacy_delete = L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl());
+               $this->privacy_operate = DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
+               $this->privacy_distribute = DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
+               $this->privacy_delete = DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl());
                // In some cases we don't need every single one of the above separate, but all in one block.
                // So here is an array to look over
-               $this->privacy_complete = [L10n::t('Privacy Statement'), $this->privacy_operate, $this->privacy_distribute, $this->privacy_delete];
+               $this->privacy_complete = [DI::l10n()->t('Privacy Statement'), $this->privacy_operate, $this->privacy_distribute, $this->privacy_delete];
        }
 
        /**
@@ -70,13 +70,13 @@ class Tos extends BaseModule
                $tpl = Renderer::getMarkupTemplate('tos.tpl');
                if (Config::get('system', 'tosdisplay')) {
                        return Renderer::replaceMacros($tpl, [
-                               '$title' => L10n::t('Terms of Service'),
+                               '$title' => DI::l10n()->t('Terms of Service'),
                                '$tostext' => BBCode::convert(Config::get('system', 'tostext')),
                                '$displayprivstatement' => Config::get('system', 'tosprivstatement'),
-                               '$privstatementtitle' => L10n::t('Privacy Statement'),
-                               '$privacy_operate' => L10n::t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
-                               '$privacy_distribute' => L10n::t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),
-                               '$privacy_delete' => L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl())
+                               '$privstatementtitle' => DI::l10n()->t('Privacy Statement'),
+                               '$privacy_operate' => DI::l10n()->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
+                               '$privacy_distribute' => DI::l10n()->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),
+                               '$privacy_delete' => DI::l10n()->t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseUrl())
                        ]);
                } else {
                        return;
index 6182146337ee44e617082304e916f5d70a844169..3e757e7cf51d1720e321fe2f7440ac3e2e0abaed 100644 (file)
@@ -23,48 +23,48 @@ class Welcome extends BaseModule
                $tpl = Renderer::getMarkupTemplate('welcome.tpl');
 
                return Renderer::replaceMacros($tpl, [
-                       '$welcome'     => L10n::t('Welcome to Friendica'),
-                       '$checklist'   => L10n::t('New Member Checklist'),
-                       '$description' => L10n::t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.'),
+                       '$welcome'     => DI::l10n()->t('Welcome to Friendica'),
+                       '$checklist'   => DI::l10n()->t('New Member Checklist'),
+                       '$description' => DI::l10n()->t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.'),
 
-                       '$started'         => L10n::t('Getting Started'),
-                       '$quickstart_link' => L10n::t('Friendica Walk-Through'),
-                       '$quickstart_txt'  => L10n::t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.'),
+                       '$started'         => DI::l10n()->t('Getting Started'),
+                       '$quickstart_link' => DI::l10n()->t('Friendica Walk-Through'),
+                       '$quickstart_txt'  => DI::l10n()->t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.'),
 
-                       '$settings'       => L10n::t('Settings'),
-                       '$settings_link'  => L10n::t('Go to Your Settings'),
-                       '$settings_txt'   => L10n::t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.'),
-                       '$settings_other' => L10n::t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.'),
+                       '$settings'       => DI::l10n()->t('Settings'),
+                       '$settings_link'  => DI::l10n()->t('Go to Your Settings'),
+                       '$settings_txt'   => DI::l10n()->t('On your <em>Settings</em> page -  change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.'),
+                       '$settings_other' => DI::l10n()->t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.'),
 
-                       '$profile'                => L10n::t('Profile'),
-                       '$profile_photo_link'     => L10n::t('Upload Profile Photo'),
-                       '$profile_photo_txt'      => L10n::t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.'),
-                       '$profiles_link'          => L10n::t('Edit Your Profile'),
-                       '$profiles_txt'           => L10n::t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.'),
-                       '$profiles_keywords_link' => L10n::t('Profile Keywords'),
-                       '$profiles_keywords_txt'  => L10n::t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.'),
+                       '$profile'                => DI::l10n()->t('Profile'),
+                       '$profile_photo_link'     => DI::l10n()->t('Upload Profile Photo'),
+                       '$profile_photo_txt'      => DI::l10n()->t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.'),
+                       '$profiles_link'          => DI::l10n()->t('Edit Your Profile'),
+                       '$profiles_txt'           => DI::l10n()->t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.'),
+                       '$profiles_keywords_link' => DI::l10n()->t('Profile Keywords'),
+                       '$profiles_keywords_txt'  => DI::l10n()->t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.'),
 
-                       '$connecting'       => L10n::t('Connecting'),
+                       '$connecting'       => DI::l10n()->t('Connecting'),
                        '$mail_disabled'    => $mail_disabled,
-                       '$import_mail_link' => L10n::t('Importing Emails'),
-                       '$import_mail_txt'  => L10n::t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX'),
-                       '$contact_link'     => L10n::t('Go to Your Contacts Page'),
-                       '$contact_txt'      => L10n::t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.'),
-                       '$directory_link'   => L10n::t('Go to Your Site\'s Directory'),
-                       '$directory_txt'    => L10n::t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.'),
-                       '$finding_link'     => L10n::t('Finding New People'),
-                       '$finding_txt'      => L10n::t('On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.'),
+                       '$import_mail_link' => DI::l10n()->t('Importing Emails'),
+                       '$import_mail_txt'  => DI::l10n()->t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX'),
+                       '$contact_link'     => DI::l10n()->t('Go to Your Contacts Page'),
+                       '$contact_txt'      => DI::l10n()->t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.'),
+                       '$directory_link'   => DI::l10n()->t('Go to Your Site\'s Directory'),
+                       '$directory_txt'    => DI::l10n()->t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.'),
+                       '$finding_link'     => DI::l10n()->t('Finding New People'),
+                       '$finding_txt'      => DI::l10n()->t('On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.'),
 
-                       '$groups'             => L10n::t('Groups'),
-                       '$group_contact_link' => L10n::t('Group Your Contacts'),
-                       '$group_contact_txt'  => L10n::t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.'),
+                       '$groups'             => DI::l10n()->t('Groups'),
+                       '$group_contact_link' => DI::l10n()->t('Group Your Contacts'),
+                       '$group_contact_txt'  => DI::l10n()->t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.'),
                        '$newuser_private'    => $newuser_private,
-                       '$private_link'       => L10n::t('Why Aren\'t My Posts Public?'),
-                       '$private_txt'        => L10n::t('Friendica respects your privacy. By default, your posts will only show up to people you\'ve added as friends. For more information, see the help section from the link above.'),
+                       '$private_link'       => DI::l10n()->t('Why Aren\'t My Posts Public?'),
+                       '$private_txt'        => DI::l10n()->t('Friendica respects your privacy. By default, your posts will only show up to people you\'ve added as friends. For more information, see the help section from the link above.'),
 
-                       '$help'      => L10n::t('Getting Help'),
-                       '$help_link' => L10n::t('Go to the Help Section'),
-                       '$help_txt'  => L10n::t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.'),
+                       '$help'      => DI::l10n()->t('Getting Help'),
+                       '$help_link' => DI::l10n()->t('Go to the Help Section'),
+                       '$help_txt'  => DI::l10n()->t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.'),
                ]);
        }
 }
index 2df5e9a36ac84290a2c4f068a3ff17d88971b9c6..efaa688199768f51c4f06093ff5e740f77a04da7 100644 (file)
@@ -130,7 +130,7 @@ class Post
                // only if the difference is more than 1 second.
                if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
                        $edited = [
-                               'label'    => L10n::t('This entry was edited'),
+                               'label'    => DI::l10n()->t('This entry was edited'),
                                'date'     => DateTimeFormat::local($item['edited'], 'r'),
                                'relative' => Temporal::getRelativeDate($item['edited'])
                        ];
@@ -153,7 +153,7 @@ class Post
 
                $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
                        || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
-                       ? L10n::t('Private Message')
+                       ? DI::l10n()->t('Private Message')
                        : false);
 
                $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
@@ -163,9 +163,9 @@ class Post
                if (local_user()) {
                        if (Strings::compareLink($a->contact['url'], $item['author-link'])) {
                                if ($item["event-id"] != 0) {
-                                       $edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
+                                       $edpost = ["events/event/" . $item['event-id'], DI::l10n()->t("Edit")];
                                } else {
-                                       $edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
+                                       $edpost = ["editpost/" . $item['id'], DI::l10n()->t("Edit")];
                                }
                        }
                        $dropping = in_array($item['uid'], [0, local_user()]);
@@ -192,21 +192,21 @@ class Post
                                $origin = $parent['origin'];
                        }
                } elseif ($item['pinned']) {
-                       $pinned = L10n::t('pinned item');
+                       $pinned = DI::l10n()->t('pinned item');
                }
 
                if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
                        // ActivityPub doesn't allow removal of remote comments
-                       $delete = L10n::t('Delete locally');
+                       $delete = DI::l10n()->t('Delete locally');
                } else {
                        // Showing the one or the other text, depending upon if we can only hide it or really delete it.
-                       $delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
+                       $delete = $origin ? DI::l10n()->t('Delete globally') : DI::l10n()->t('Remove locally');
                }
 
                $drop = [
                        'dropping' => $dropping,
                        'pagedrop' => $item['pagedrop'],
-                       'select'   => L10n::t('Select'),
+                       'select'   => DI::l10n()->t('Select'),
                        'delete'   => $delete,
                ];
 
@@ -214,7 +214,7 @@ class Post
                        $drop = false;
                }
 
-               $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
+               $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? DI::l10n()->t("save to folder") : false);
 
                $profile_name = $item['author-name'];
                if (!empty($item['author-link']) && empty($item['author-name'])) {
@@ -249,7 +249,7 @@ class Post
                        $response_verbs[] = 'attendmaybe';
                        if ($conv->isWritable()) {
                                $isevent = true;
-                               $attend = [L10n::t('I will attend'), L10n::t('I will not attend'), L10n::t('I might attend')];
+                               $attend = [DI::l10n()->t('I will attend'), DI::l10n()->t('I will not attend'), DI::l10n()->t('I might attend')];
                        }
                }
 
@@ -277,12 +277,12 @@ class Post
                                $thread = Item::selectFirstThreadForUser(local_user(), ['ignored'], ['iid' => $item['id']]);
                                if (DBA::isResult($thread)) {
                                        $ignore = [
-                                               'do'        => L10n::t("ignore thread"),
-                                               'undo'      => L10n::t("unignore thread"),
-                                               'toggle'    => L10n::t("toggle ignore status"),
+                                               'do'        => DI::l10n()->t("ignore thread"),
+                                               'undo'      => DI::l10n()->t("unignore thread"),
+                                               'toggle'    => DI::l10n()->t("toggle ignore status"),
                                                'classdo'   => $thread['ignored'] ? "hidden" : "",
                                                'classundo' => $thread['ignored'] ? "" : "hidden",
-                                               'ignored'   => L10n::t('ignored'),
+                                               'ignored'   => DI::l10n()->t('ignored'),
                                        ];
                                }
 
@@ -291,28 +291,28 @@ class Post
                                                $ispinned = ($item['pinned'] ? 'pinned' : 'unpinned');
 
                                                $pin = [
-                                                       'do'        => L10n::t('pin'),
-                                                       'undo'      => L10n::t('unpin'),
-                                                       'toggle'    => L10n::t('toggle pin status'),
+                                                       'do'        => DI::l10n()->t('pin'),
+                                                       'undo'      => DI::l10n()->t('unpin'),
+                                                       'toggle'    => DI::l10n()->t('toggle pin status'),
                                                        'classdo'   => $item['pinned'] ? 'hidden' : '',
                                                        'classundo' => $item['pinned'] ? '' : 'hidden',
-                                                       'pinned'   => L10n::t('pinned'),
+                                                       'pinned'   => DI::l10n()->t('pinned'),
                                                ];
                                        }
 
                                        $isstarred = (($item['starred']) ? "starred" : "unstarred");
 
                                        $star = [
-                                               'do'        => L10n::t("add star"),
-                                               'undo'      => L10n::t("remove star"),
-                                               'toggle'    => L10n::t("toggle star status"),
+                                               'do'        => DI::l10n()->t("add star"),
+                                               'undo'      => DI::l10n()->t("remove star"),
+                                               'toggle'    => DI::l10n()->t("toggle star status"),
                                                'classdo'   => $item['starred'] ? "hidden" : "",
                                                'classundo' => $item['starred'] ? "" : "hidden",
-                                               'starred'   => L10n::t('starred'),
+                                               'starred'   => DI::l10n()->t('starred'),
                                        ];
 
                                        $tagger = [
-                                               'add'   => L10n::t("add tag"),
+                                               'add'   => DI::l10n()->t("add tag"),
                                                'class' => "",
                                        ];
                                }
@@ -323,11 +323,11 @@ class Post
 
                if ($conv->isWritable()) {
                        $buttons = [
-                               'like'    => [L10n::t("I like this \x28toggle\x29"), L10n::t("like")],
-                               'dislike' => [L10n::t("I don't like this \x28toggle\x29"), L10n::t("dislike")],
+                               'like'    => [DI::l10n()->t("I like this \x28toggle\x29"), DI::l10n()->t("like")],
+                               'dislike' => [DI::l10n()->t("I don't like this \x28toggle\x29"), DI::l10n()->t("dislike")],
                        ];
                        if ($shareable) {
-                               $buttons['share'] = [L10n::t('Share this'), L10n::t('share')];
+                               $buttons['share'] = [DI::l10n()->t('Share this'), DI::l10n()->t('share')];
                        }
                }
 
@@ -376,7 +376,7 @@ class Post
                $ago = Temporal::getRelativeDate($item['created']);
                $ago_received = Temporal::getRelativeDate($item['received']);
                if (Config::get('system', 'show_received') && (abs(strtotime($item['created']) - strtotime($item['received'])) > Config::get('system', 'show_received_seconds')) && ($ago != $ago_received)) {
-                       $ago = L10n::t('%s (Received %s)', $ago, $ago_received);
+                       $ago = DI::l10n()->t('%s (Received %s)', $ago, $ago_received);
                }
 
                $tmp_item = [
@@ -387,8 +387,8 @@ class Post
                        'hashtags'        => $tags['hashtags'],
                        'mentions'        => $tags['mentions'],
                        'implicit_mentions' => $tags['implicit_mentions'],
-                       'txt_cats'        => L10n::t('Categories:'),
-                       'txt_folders'     => L10n::t('Filed under:'),
+                       'txt_cats'        => DI::l10n()->t('Categories:'),
+                       'txt_folders'     => DI::l10n()->t('Filed under:'),
                        'has_cats'        => ((count($categories)) ? 'true' : ''),
                        'has_folders'     => ((count($folders)) ? 'true' : ''),
                        'categories'      => $categories,
@@ -399,12 +399,12 @@ class Post
                        'guid'            => urlencode($item['guid']),
                        'isevent'         => $isevent,
                        'attend'          => $attend,
-                       'linktitle'       => L10n::t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
-                       'olinktitle'      => L10n::t('View %s\'s profile @ %s', $this->getOwnerName(), $item['owner-link']),
-                       'to'              => L10n::t('to'),
-                       'via'             => L10n::t('via'),
-                       'wall'            => L10n::t('Wall-to-Wall'),
-                       'vwall'           => L10n::t('via Wall-To-Wall:'),
+                       'linktitle'       => DI::l10n()->t('View %s\'s profile @ %s', $profile_name, $item['author-link']),
+                       'olinktitle'      => DI::l10n()->t('View %s\'s profile @ %s', $this->getOwnerName(), $item['owner-link']),
+                       'to'              => DI::l10n()->t('to'),
+                       'via'             => DI::l10n()->t('via'),
+                       'wall'            => DI::l10n()->t('Wall-to-Wall'),
+                       'vwall'           => DI::l10n()->t('via Wall-To-Wall:'),
                        'profile_url'     => $profile_link,
                        'item_photo_menu' => item_photo_menu($item),
                        'name'            => $name_e,
@@ -413,7 +413,7 @@ class Post
                        'sparkle'         => $sparkle,
                        'title'           => $title_e,
                        'localtime'       => DateTimeFormat::local($item['created'], 'r'),
-                       'ago'             => $item['app'] ? L10n::t('%s from %s', $ago, $item['app']) : $ago,
+                       'ago'             => $item['app'] ? DI::l10n()->t('%s from %s', $ago, $item['app']) : $ago,
                        'app'             => $item['app'],
                        'created'         => $ago,
                        'lock'            => $lock,
@@ -439,11 +439,11 @@ class Post
                        'like'            => $responses['like']['output'],
                        'dislike'         => $responses['dislike']['output'],
                        'responses'       => $responses,
-                       'switchcomment'   => L10n::t('Comment'),
-                       'reply_label'     => L10n::t('Reply to %s', $name_e),
+                       'switchcomment'   => DI::l10n()->t('Comment'),
+                       'reply_label'     => DI::l10n()->t('Reply to %s', $name_e),
                        'comment'         => $comment,
                        'previewing'      => $conv->isPreview() ? ' preview ' : '',
-                       'wait'            => L10n::t('Please wait'),
+                       'wait'            => DI::l10n()->t('Please wait'),
                        'thread_level'    => $thread_level,
                        'edited'          => $edited,
                        'network'         => $item["network"],
@@ -456,11 +456,11 @@ class Post
                        'delivery'        => [
                                'queue_count'       => $item['delivery_queue_count'],
                                'queue_done'        => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future
-                               'notifier_pending'  => L10n::t('Notifier task is pending'),
-                               'delivery_pending'  => L10n::t('Delivery to remote servers is pending'),
-                               'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
-                               'delivery_almost'   => L10n::t('Delivery to remote servers is mostly done'),
-                               'delivery_done'     => L10n::t('Delivery to remote servers is done'),
+                               'notifier_pending'  => DI::l10n()->t('Notifier task is pending'),
+                               'delivery_pending'  => DI::l10n()->t('Delivery to remote servers is pending'),
+                               'delivery_underway' => DI::l10n()->t('Delivery to remote servers is underway'),
+                               'delivery_almost'   => DI::l10n()->t('Delivery to remote servers is mostly done'),
+                               'delivery_done'     => DI::l10n()->t('Delivery to remote servers is done'),
                        ],
                ];
 
@@ -481,8 +481,8 @@ class Post
                        if (($nb_children > 2) || ($thread_level > 1)) {
                                $result['children'][0]['comment_firstcollapsed'] = true;
                                $result['children'][0]['num_comments'] = L10n::tt('%d comment', '%d comments', $total_children);
-                               $result['children'][0]['show_text'] = L10n::t('Show more');
-                               $result['children'][0]['hide_text'] = L10n::t('Show fewer');
+                               $result['children'][0]['show_text'] = DI::l10n()->t('Show more');
+                               $result['children'][0]['hide_text'] = DI::l10n()->t('Show fewer');
                                if ($thread_level > 1) {
                                        $result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
                                } else {
@@ -899,22 +899,22 @@ class Post
                                '$default'     => $default_text,
                                '$profile_uid' => $uid,
                                '$mylink'      => DI::baseUrl()->remove($a->contact['url']),
-                               '$mytitle'     => L10n::t('This is you'),
+                               '$mytitle'     => DI::l10n()->t('This is you'),
                                '$myphoto'     => DI::baseUrl()->remove($a->contact['thumb']),
-                               '$comment'     => L10n::t('Comment'),
-                               '$submit'      => L10n::t('Submit'),
-                               '$edbold'      => L10n::t('Bold'),
-                               '$editalic'    => L10n::t('Italic'),
-                               '$eduline'     => L10n::t('Underline'),
-                               '$edquote'     => L10n::t('Quote'),
-                               '$edcode'      => L10n::t('Code'),
-                               '$edimg'       => L10n::t('Image'),
-                               '$edurl'       => L10n::t('Link'),
-                               '$edattach'    => L10n::t('Link or Media'),
-                               '$prompttext'  => L10n::t('Please enter a image/video/audio/webpage URL:'),
-                               '$preview'     => L10n::t('Preview'),
+                               '$comment'     => DI::l10n()->t('Comment'),
+                               '$submit'      => DI::l10n()->t('Submit'),
+                               '$edbold'      => DI::l10n()->t('Bold'),
+                               '$editalic'    => DI::l10n()->t('Italic'),
+                               '$eduline'     => DI::l10n()->t('Underline'),
+                               '$edquote'     => DI::l10n()->t('Quote'),
+                               '$edcode'      => DI::l10n()->t('Code'),
+                               '$edimg'       => DI::l10n()->t('Image'),
+                               '$edurl'       => DI::l10n()->t('Link'),
+                               '$edattach'    => DI::l10n()->t('Link or Media'),
+                               '$prompttext'  => DI::l10n()->t('Please enter a image/video/audio/webpage URL:'),
+                               '$preview'     => DI::l10n()->t('Preview'),
                                '$indent'      => $indent,
-                               '$sourceapp'   => L10n::t($a->sourcename),
+                               '$sourceapp'   => DI::l10n()->t($a->sourcename),
                                '$ww'          => $conv->getMode() === 'network' ? $ww : '',
                                '$rand_num'    => Crypto::randomDigits(12)
                        ]);
index 8a940853733b5731d98557e6e9ba3570e7419373..e0780c78b51a85851ce53abba22595e65f26ca6a 100644 (file)
@@ -3574,7 +3574,7 @@ class Diaspora
                        if ($item["attach"]) {
                                $cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism', $item["attach"], $matches, PREG_SET_ORDER);
                                if ($cnt) {
-                                       $body .= "\n".L10n::t("Attachments:")."\n";
+                                       $body .= "\n".DI::l10n()->t("Attachments:")."\n";
                                        foreach ($matches as $mtch) {
                                                $body .= "[".$mtch[3]."](".$mtch[1].")\n";
                                        }
index a250d35bc7f9c3ad0f298a4cc192e0418be8d309..53eab49660f3839b37782f3ffa94890c696a2c5a 100644 (file)
@@ -1270,14 +1270,14 @@ class OStatus
                $selfUri = '/feed/' . $owner["nick"] . '/';
                switch ($filter) {
                        case 'activity':
-                               $title = L10n::t('%s\'s timeline', $owner['name']);
+                               $title = DI::l10n()->t('%s\'s timeline', $owner['name']);
                                $selfUri .= $filter;
                                break;
                        case 'posts':
-                               $title = L10n::t('%s\'s posts', $owner['name']);
+                               $title = DI::l10n()->t('%s\'s posts', $owner['name']);
                                break;
                        case 'comments':
-                               $title = L10n::t('%s\'s comments', $owner['name']);
+                               $title = DI::l10n()->t('%s\'s comments', $owner['name']);
                                $selfUri .= $filter;
                                break;
                }
@@ -1832,12 +1832,12 @@ class OStatus
                }
 
                if ($item['verb'] == Activity::FOLLOW) {
-                       $message = L10n::t('%s is now following %s.');
-                       $title = L10n::t('following');
+                       $message = DI::l10n()->t('%s is now following %s.');
+                       $title = DI::l10n()->t('following');
                        $action = "subscription";
                } else {
-                       $message = L10n::t('%s stopped following %s.');
-                       $title = L10n::t('stopped following');
+                       $message = DI::l10n()->t('%s stopped following %s.');
+                       $title = DI::l10n()->t('stopped following');
                        $action = "unfollow";
                }
 
index 729dc6e343a3eea7cf66243ed2e95fdab1b30dfd..75211a0927e8796572041a21bd0af7cbc277cbb2 100644 (file)
@@ -27,21 +27,21 @@ class Temporal
        private static function timezoneCompareCallback($a, $b)
        {
                if (strstr($a, '/') && strstr($b, '/')) {
-                       if (L10n::t($a) == L10n::t($b)) {
+                       if (DI::l10n()->t($a) == DI::l10n()->t($b)) {
                                return 0;
                        }
-                       return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
+                       return (DI::l10n()->t($a) < DI::l10n()->t($b)) ? -1 : 1;
                }
 
                if (strstr($a, '/')) {
                        return -1;
                } elseif (strstr($b, '/')) {
                        return 1;
-               } elseif (L10n::t($a) == L10n::t($b)) {
+               } elseif (DI::l10n()->t($a) == DI::l10n()->t($b)) {
                        return 0;
                }
 
-               return (L10n::t($a) < L10n::t($b)) ? -1 : 1;
+               return (DI::l10n()->t($a) < DI::l10n()->t($b)) ? -1 : 1;
        }
 
        /**
@@ -66,7 +66,7 @@ class Temporal
                                                $o .= '</optgroup>';
                                        }
                                        $continent = $ex[0];
-                                       $o .= '<optgroup label="' . L10n::t($continent) . '">';
+                                       $o .= '<optgroup label="' . DI::l10n()->t($continent) . '">';
                                }
                                if (count($ex) > 2) {
                                        $city = substr($value, strpos($value, '/') + 1);
@@ -75,13 +75,13 @@ class Temporal
                                }
                        } else {
                                $city = $ex[0];
-                               if ($continent != L10n::t('Miscellaneous')) {
+                               if ($continent != DI::l10n()->t('Miscellaneous')) {
                                        $o .= '</optgroup>';
-                                       $continent = L10n::t('Miscellaneous');
-                                       $o .= '<optgroup label="' . L10n::t($continent) . '">';
+                                       $continent = DI::l10n()->t('Miscellaneous');
+                                       $o .= '<optgroup label="' . DI::l10n()->t($continent) . '">';
                                }
                        }
-                       $city = str_replace('_', ' ', L10n::t($city));
+                       $city = str_replace('_', ' ', DI::l10n()->t($city));
                        $selected = (($value == $current) ? " selected=\"selected\" " : "");
                        $o .= "<option value=\"$value\" $selected >$city</option>";
                }
@@ -142,11 +142,11 @@ class Temporal
                        [
                        '$field' => [
                                'dob',
-                               L10n::t('Birthday:'),
+                               DI::l10n()->t('Birthday:'),
                                $value,
-                               intval($age) > 0 ? L10n::t('Age: ') . $age : "",
+                               intval($age) > 0 ? DI::l10n()->t('Age: ') . $age : "",
                                '',
-                               'placeholder="' . L10n::t('YYYY-MM-DD or MM-DD') . '"'
+                               'placeholder="' . DI::l10n()->t('YYYY-MM-DD or MM-DD') . '"'
                        ]
                ]);
 
@@ -293,14 +293,14 @@ class Temporal
                $abs = strtotime($localtime);
 
                if (is_null($posted_date) || $posted_date <= DBA::NULL_DATETIME || $abs === false) {
-                       return L10n::t('never');
+                       return DI::l10n()->t('never');
                }
 
                $isfuture = false;
                $etime = time() - $abs;
 
                if ($etime < 1 && $etime >= 0) {
-                       return L10n::t('less than a second ago');
+                       return DI::l10n()->t('less than a second ago');
                }
 
                if ($etime < 0){
@@ -308,13 +308,13 @@ class Temporal
                        $isfuture = true;
                }
 
-               $a = [12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
-                       30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
-                       7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
-                       24 * 60 * 60 => [L10n::t('day'), L10n::t('days')],
-                       60 * 60 => [L10n::t('hour'), L10n::t('hours')],
-                       60 => [L10n::t('minute'), L10n::t('minutes')],
-                       1 => [L10n::t('second'), L10n::t('seconds')]
+               $a = [12 * 30 * 24 * 60 * 60 => [DI::l10n()->t('year'), DI::l10n()->t('years')],
+                       30 * 24 * 60 * 60 => [DI::l10n()->t('month'), DI::l10n()->t('months')],
+                       7 * 24 * 60 * 60 => [DI::l10n()->t('week'), DI::l10n()->t('weeks')],
+                       24 * 60 * 60 => [DI::l10n()->t('day'), DI::l10n()->t('days')],
+                       60 * 60 => [DI::l10n()->t('hour'), DI::l10n()->t('hours')],
+                       60 => [DI::l10n()->t('minute'), DI::l10n()->t('minutes')],
+                       1 => [DI::l10n()->t('second'), DI::l10n()->t('seconds')]
                ];
 
                foreach ($a as $secs => $str) {
@@ -324,10 +324,10 @@ class Temporal
                                // translators - e.g. 22 hours ago, 1 minute ago
                                if (!$format) {
                                        if($isfuture){
-                                               $format = L10n::t('in %1$d %2$s');
+                                               $format = DI::l10n()->t('in %1$d %2$s');
                                        }
                                        else {
-                                               $format = L10n::t('%1$d %2$s ago');
+                                               $format = DI::l10n()->t('%1$d %2$s ago');
                                        }
                                }
 
index 5e44e940c504236435a1b42fffd3bbf9360dec66..8c3fbb8ba25375c4d521be5e632e96db6dd228d9 100644 (file)
@@ -537,7 +537,7 @@ class Delivery
                        $reply_to = $mailacct['reply_to'];
                }
 
-               $subject  = ($target_item['title'] ? Email::encodeHeader($target_item['title'], 'UTF-8') : L10n::t("\x28no subject\x29"));
+               $subject  = ($target_item['title'] ? Email::encodeHeader($target_item['title'], 'UTF-8') : DI::l10n()->t("\x28no subject\x29"));
 
                // only expose our real email address to true friends
 
index 370373850a54503a7250e7b34063a734c5d61b32..23212665ddd852b1c918b64217c1825297dffc73 100644 (file)
@@ -46,7 +46,7 @@ class InstallerTest extends MockedTest
        }
 
        /**
-        * Mocking the L10n::t() calls for the function checks
+        * Mocking the DI::l10n()->t() calls for the function checks
         */
        private function mockFunctionL10TCalls()
        {
index 6c902ab8512a31d27ebd84cacd6c4546122cb6d4..330e6da10d7fb3c1a7a934098e4b57933d43c4eb 100644 (file)
@@ -215,7 +215,7 @@ function update_1260()
        Config::set(
                'system',
                'maintenance_reason',
-               L10n::t(
+               DI::l10n()->t(
                        '%s: Updating author-id and owner-id in item and thread table. ',
                        DateTimeFormat::utcNow().' '.date('e')
                )
@@ -270,7 +270,7 @@ function update_1278()
        Config::set(
                'system',
                'maintenance_reason',
-               L10n::t(
+               DI::l10n()->t(
                        '%s: Updating post-type.',
                        DateTimeFormat::utcNow().' '.date('e')
                )
index 574e25648e560763375fc228daef997bb74721f2..68d005d31876b744408ce03f841a477e53a9f473 100644 (file)
@@ -51,13 +51,13 @@ function theme_admin_post(App $a)
 function clean_form(App $a, &$colorset, $user)
 {
        $colorset = [
-               'default'     => L10n::t('default'),
-               'greenzero'   => L10n::t('greenzero'),
-               'purplezero'  => L10n::t('purplezero'),
-               'easterbunny' => L10n::t('easterbunny'),
-               'darkzero'    => L10n::t('darkzero'),
-               'comix'       => L10n::t('comix'),
-               'slackr'      => L10n::t('slackr'),
+               'default'     => DI::l10n()->t('default'),
+               'greenzero'   => DI::l10n()->t('greenzero'),
+               'purplezero'  => DI::l10n()->t('purplezero'),
+               'easterbunny' => DI::l10n()->t('easterbunny'),
+               'darkzero'    => DI::l10n()->t('darkzero'),
+               'comix'       => DI::l10n()->t('comix'),
+               'slackr'      => DI::l10n()->t('slackr'),
        ];
 
        if ($user) {
@@ -68,9 +68,9 @@ function clean_form(App $a, &$colorset, $user)
 
        $t = Renderer::getMarkupTemplate("theme_settings.tpl");
        $o = Renderer::replaceMacros($t, [
-               '$submit'   => L10n::t('Submit'),
-               '$title'    => L10n::t("Theme settings"),
-               '$colorset' => ['duepuntozero_colorset', L10n::t('Variations'), $color, '', $colorset],
+               '$submit'   => DI::l10n()->t('Submit'),
+               '$title'    => DI::l10n()->t("Theme settings"),
+               '$colorset' => ['duepuntozero_colorset', DI::l10n()->t('Variations'), $color, '', $colorset],
        ]);
 
        return $o;
index 899cbfbc18d4f411c903c9488338924887fb8771..c7b016df9fd0028d1ae14ea7f32f6fc45d36f285 100644 (file)
@@ -107,7 +107,7 @@ function frio_form($arr)
        }
 
        $scheme_choices = [];
-       $scheme_choices['---'] = L10n::t('Custom');
+       $scheme_choices['---'] = DI::l10n()->t('Custom');
        $files = glob('view/theme/frio/scheme/*.php');
        if ($files) {
                foreach ($files as $file) {
@@ -119,31 +119,31 @@ function frio_form($arr)
                }
        }
 
-       $background_image_help = '<strong>' . L10n::t('Note') . ': </strong>' . L10n::t('Check image permissions if all users are allowed to see the image');
+       $background_image_help = '<strong>' . DI::l10n()->t('Note') . ': </strong>' . DI::l10n()->t('Check image permissions if all users are allowed to see the image');
 
        $t = Renderer::getMarkupTemplate('theme_settings.tpl');
        $ctx = [
-               '$submit'           => L10n::t('Submit'),
-               '$title'            => L10n::t('Theme settings'),
-               '$scheme'           => ['frio_scheme', L10n::t('Select color scheme'), $arr['scheme'], '', $scheme_choices],
-               '$share_string'     => ['frio_share_string', L10n::t('Copy or paste schemestring'), $arr['share_string'], L10n::t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false],
-               '$nav_bg'           => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', L10n::t('Navigation bar background color'), $arr['nav_bg'], '', false],
-               '$nav_icon_color'   => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', L10n::t('Navigation bar icon color '), $arr['nav_icon_color'], '', false],
-               '$link_color'       => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', L10n::t('Link color'), $arr['link_color'], '', false],
-               '$background_color' => array_key_exists('background_color', $disable) ? '' : ['frio_background_color', L10n::t('Set the background color'), $arr['background_color'], '', false],
-               '$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', L10n::t('Content background opacity'), ($arr['contentbg_transp'] ?? 0) ?: 100, ''],
-               '$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', L10n::t('Set the background image'), $arr['background_image'], $background_image_help, false],
-               '$bg_image_options_title' => L10n::t('Background image style'),
+               '$submit'           => DI::l10n()->t('Submit'),
+               '$title'            => DI::l10n()->t('Theme settings'),
+               '$scheme'           => ['frio_scheme', DI::l10n()->t('Select color scheme'), $arr['scheme'], '', $scheme_choices],
+               '$share_string'     => ['frio_share_string', DI::l10n()->t('Copy or paste schemestring'), $arr['share_string'], DI::l10n()->t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false],
+               '$nav_bg'           => array_key_exists('nav_bg', $disable) ? '' : ['frio_nav_bg', DI::l10n()->t('Navigation bar background color'), $arr['nav_bg'], '', false],
+               '$nav_icon_color'   => array_key_exists('nav_icon_color', $disable) ? '' : ['frio_nav_icon_color', DI::l10n()->t('Navigation bar icon color '), $arr['nav_icon_color'], '', false],
+               '$link_color'       => array_key_exists('link_color', $disable) ? '' : ['frio_link_color', DI::l10n()->t('Link color'), $arr['link_color'], '', false],
+               '$background_color' => array_key_exists('background_color', $disable) ? '' : ['frio_background_color', DI::l10n()->t('Set the background color'), $arr['background_color'], '', false],
+               '$contentbg_transp' => array_key_exists('contentbg_transp', $disable) ? '' : ['frio_contentbg_transp', DI::l10n()->t('Content background opacity'), ($arr['contentbg_transp'] ?? 0) ?: 100, ''],
+               '$background_image' => array_key_exists('background_image', $disable) ? '' : ['frio_background_image', DI::l10n()->t('Set the background image'), $arr['background_image'], $background_image_help, false],
+               '$bg_image_options_title' => DI::l10n()->t('Background image style'),
                '$bg_image_options' => Image::get_options($arr),
-               '$enable_compose'   => ['frio_enable_compose', L10n::t('Enable Compose page'), $arr['enable_compose'], L10n::t('This replaces the jot modal window for writing new posts with a link to <a href="compose">the new Compose page</a>.')],
+               '$enable_compose'   => ['frio_enable_compose', DI::l10n()->t('Enable Compose page'), $arr['enable_compose'], DI::l10n()->t('This replaces the jot modal window for writing new posts with a link to <a href="compose">the new Compose page</a>.')],
        ];
 
        if (array_key_exists('login_bg_image', $arr) && !array_key_exists('login_bg_image', $disable)) {
-               $ctx['$login_bg_image'] = ['frio_login_bg_image', L10n::t('Login page background image'), $arr['login_bg_image'], $background_image_help, false];
+               $ctx['$login_bg_image'] = ['frio_login_bg_image', DI::l10n()->t('Login page background image'), $arr['login_bg_image'], $background_image_help, false];
        }
 
        if (array_key_exists('login_bg_color', $arr) && !array_key_exists('login_bg_color', $disable)) {
-               $ctx['$login_bg_color'] = ['frio_login_bg_color', L10n::t('Login page background color'), $arr['login_bg_color'], L10n::t('Leave background image and color empty for theme defaults'), false];
+               $ctx['$login_bg_color'] = ['frio_login_bg_color', DI::l10n()->t('Login page background color'), $arr['login_bg_color'], DI::l10n()->t('Leave background image and color empty for theme defaults'), false];
        }
 
        $o = Renderer::replaceMacros($t, $ctx);
index 34e9fc210d9931ec8c3d77475eed2815dfa9bfaf..7d0c6092d3989f5c661229af49c1d8f468eea3a1 100644 (file)
@@ -21,10 +21,10 @@ class Image
        public static function get_options($arr)
        {
                $bg_image_options = [
-                       'stretch' => ['frio_bg_image_option', L10n::t('Top Banner'), 'stretch', L10n::t('Resize image to the width of the screen and show background color below on long pages.'), ($arr['bg_image_option'] == 'stretch')],
-                       'cover'   => ['frio_bg_image_option', L10n::t('Full screen'), 'cover', L10n::t('Resize image to fill entire screen, clipping either the right or the bottom.'), ($arr['bg_image_option'] == 'cover')],
-                       'contain' => ['frio_bg_image_option', L10n::t('Single row mosaic'), 'contain', L10n::t('Resize image to repeat it on a single row, either vertical or horizontal.'), ($arr['bg_image_option'] == 'contain')],
-                       'repeat'  => ['frio_bg_image_option', L10n::t('Mosaic'), 'repeat', L10n::t('Repeat image to fill the screen.'), ($arr['bg_image_option'] == 'repeat')],
+                       'stretch' => ['frio_bg_image_option', DI::l10n()->t('Top Banner'), 'stretch', DI::l10n()->t('Resize image to the width of the screen and show background color below on long pages.'), ($arr['bg_image_option'] == 'stretch')],
+                       'cover'   => ['frio_bg_image_option', DI::l10n()->t('Full screen'), 'cover', DI::l10n()->t('Resize image to fill entire screen, clipping either the right or the bottom.'), ($arr['bg_image_option'] == 'cover')],
+                       'contain' => ['frio_bg_image_option', DI::l10n()->t('Single row mosaic'), 'contain', DI::l10n()->t('Resize image to repeat it on a single row, either vertical or horizontal.'), ($arr['bg_image_option'] == 'contain')],
+                       'repeat'  => ['frio_bg_image_option', DI::l10n()->t('Mosaic'), 'repeat', DI::l10n()->t('Repeat image to fill the screen.'), ($arr['bg_image_option'] == 'repeat')],
                ];
 
                return $bg_image_options;
index 88e786ed76d046d58d9069c16873d74ff4214367..89f40a662cbbdababdd40c9f8f20f4014aa75edd 100644 (file)
@@ -244,12 +244,12 @@ function frio_remote_nav($a, &$nav)
                $r[0]['name'] = $a->user['username'];
        } elseif (!local_user() && remote_user()) {
                $r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
-               $nav['remote'] = L10n::t('Guest');
+               $nav['remote'] = DI::l10n()->t('Guest');
        } elseif (Model\Profile::getMyURL()) {
                $r = q("SELECT `name`, `nick`, `photo` FROM `gcontact`
                                WHERE `addr` = '%s' AND `network` = 'dfrn'",
                        DBA::escape($webbie));
-               $nav['remote'] = L10n::t('Visitor');
+               $nav['remote'] = DI::l10n()->t('Visitor');
        } else {
                $r = false;
        }
@@ -265,18 +265,18 @@ function frio_remote_nav($a, &$nav)
 
        if (!local_user() && !empty($server_url) && !is_null($remoteUser)) {
                // user menu
-               $nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], L10n::t('Status'), '', L10n::t('Your posts and conversations')];
-               $nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '?tab=profile', L10n::t('Profile'), '', L10n::t('Your profile page')];
-               $nav['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], L10n::t('Photos'), '', L10n::t('Your photos')];
-               $nav['usermenu'][] = [$server_url . '/videos/' . $remoteUser['nick'], L10n::t('Videos'), '', L10n::t('Your videos')];
-               $nav['usermenu'][] = [$server_url . '/events/', L10n::t('Events'), '', L10n::t('Your events')];
+               $nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'], DI::l10n()->t('Status'), '', DI::l10n()->t('Your posts and conversations')];
+               $nav['usermenu'][] = [$server_url . '/profile/' . $remoteUser['nick'] . '?tab=profile', DI::l10n()->t('Profile'), '', DI::l10n()->t('Your profile page')];
+               $nav['usermenu'][] = [$server_url . '/photos/' . $remoteUser['nick'], DI::l10n()->t('Photos'), '', DI::l10n()->t('Your photos')];
+               $nav['usermenu'][] = [$server_url . '/videos/' . $remoteUser['nick'], DI::l10n()->t('Videos'), '', DI::l10n()->t('Your videos')];
+               $nav['usermenu'][] = [$server_url . '/events/', DI::l10n()->t('Events'), '', DI::l10n()->t('Your events')];
 
                // navbar links
-               $nav['network'] = [$server_url . '/network', L10n::t('Network'), '', L10n::t('Conversations from your friends')];
-               $nav['events'] = [$server_url . '/events', L10n::t('Events'), '', L10n::t('Events and Calendar')];
-               $nav['messages'] = [$server_url . '/message', L10n::t('Messages'), '', L10n::t('Private mail')];
-               $nav['settings'] = [$server_url . '/settings', L10n::t('Settings'), '', L10n::t('Account settings')];
-               $nav['contacts'] = [$server_url . '/contact', L10n::t('Contacts'), '', L10n::t('Manage/edit friends and contacts')];
+               $nav['network'] = [$server_url . '/network', DI::l10n()->t('Network'), '', DI::l10n()->t('Conversations from your friends')];
+               $nav['events'] = [$server_url . '/events', DI::l10n()->t('Events'), '', DI::l10n()->t('Events and Calendar')];
+               $nav['messages'] = [$server_url . '/message', DI::l10n()->t('Messages'), '', DI::l10n()->t('Private mail')];
+               $nav['settings'] = [$server_url . '/settings', DI::l10n()->t('Settings'), '', DI::l10n()->t('Account settings')];
+               $nav['contacts'] = [$server_url . '/contact', DI::l10n()->t('Contacts'), '', DI::l10n()->t('Manage/edit friends and contacts')];
                $nav['sitename'] = Config::get('config', 'sitename');
        }
 }
@@ -361,7 +361,7 @@ function frio_display_item(App $a, &$arr)
        {
                $subthread = [
                        'menu'   => 'follow_thread',
-                       'title'  => L10n::t('Follow Thread'),
+                       'title'  => DI::l10n()->t('Follow Thread'),
                        'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
                        'href'   => '#'
                ];
index eb6c5d0aa3e009095f563696932dc08dbe453c4c..4dcb3e207635eebc765f99d00d8a61a70281064c 100644 (file)
@@ -70,12 +70,12 @@ function quattro_form(App $a, $align, $color, $tfs, $pfs) {
 
        $t = Renderer::getMarkupTemplate("theme_settings.tpl" );
        $o = Renderer::replaceMacros($t, [
-               '$submit'  => L10n::t('Submit'),
-               '$title'   => L10n::t("Theme settings"),
-               '$align'   => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]],
-               '$color'   => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors],
-               '$pfs'     => ['quattro_pfs', L10n::t('Posts font size'), $pfs],
-               '$tfs'     => ['quattro_tfs', L10n::t('Textareas font size'), $tfs],
+               '$submit'  => DI::l10n()->t('Submit'),
+               '$title'   => DI::l10n()->t("Theme settings"),
+               '$align'   => ['quattro_align', DI::l10n()->t('Alignment'), $align, '', ['left' => DI::l10n()->t('Left'), 'center' => DI::l10n()->t('Center')]],
+               '$color'   => ['quattro_color', DI::l10n()->t('Color scheme'), $color, '', $colors],
+               '$pfs'     => ['quattro_pfs', DI::l10n()->t('Posts font size'), $pfs],
+               '$tfs'     => ['quattro_tfs', DI::l10n()->t('Textareas font size'), $tfs],
        ]);
        return $o;
 }
index 9bcf4cffc218151fe6a69188444cb0d462371e8f..cc01687484535114ae2088a8f73d70159dc394fd 100644 (file)
@@ -74,7 +74,7 @@ function theme_admin(App $a) {
 
        $t = Renderer::getMarkupTemplate("theme_admin_settings.tpl");
        $o = Renderer::replaceMacros($t, [
-               '$helperlist' => ['vier_helperlist', L10n::t('Comma separated list of helper forums'), $helperlist, '', ''],
+               '$helperlist' => ['vier_helperlist', DI::l10n()->t('Comma separated list of helper forums'), $helperlist, '', ''],
                ]);
 
        $show_pages = get_vier_config('show_pages', true, true);
@@ -114,19 +114,19 @@ function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $
                "shadow"=>"Shadow"
        ];
 
-       $show_or_not = ['0' => L10n::t("don't show"), '1' => L10n::t("show"),];
+       $show_or_not = ['0' => DI::l10n()->t("don't show"), '1' => DI::l10n()->t("show"),];
 
        $t = Renderer::getMarkupTemplate("theme_settings.tpl");
        $o = Renderer::replaceMacros($t, [
-               '$submit' => L10n::t('Submit'),
-               '$title' => L10n::t("Theme settings"),
-               '$style' => ['vier_style', L10n::t('Set style'), $style, '', $styles],
-               '$show_pages' => ['vier_show_pages', L10n::t('Community Pages'), $show_pages, '', $show_or_not],
-               '$show_profiles' => ['vier_show_profiles', L10n::t('Community Profiles'), $show_profiles, '', $show_or_not],
-               '$show_helpers' => ['vier_show_helpers', L10n::t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
-               '$show_services' => ['vier_show_services', L10n::t('Connect Services'), $show_services, '', $show_or_not],
-               '$show_friends' => ['vier_show_friends', L10n::t('Find Friends'), $show_friends, '', $show_or_not],
-               '$show_lastusers' => ['vier_show_lastusers', L10n::t('Last users'), $show_lastusers, '', $show_or_not]
+               '$submit' => DI::l10n()->t('Submit'),
+               '$title' => DI::l10n()->t("Theme settings"),
+               '$style' => ['vier_style', DI::l10n()->t('Set style'), $style, '', $styles],
+               '$show_pages' => ['vier_show_pages', DI::l10n()->t('Community Pages'), $show_pages, '', $show_or_not],
+               '$show_profiles' => ['vier_show_profiles', DI::l10n()->t('Community Profiles'), $show_profiles, '', $show_or_not],
+               '$show_helpers' => ['vier_show_helpers', DI::l10n()->t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
+               '$show_services' => ['vier_show_services', DI::l10n()->t('Connect Services'), $show_services, '', $show_or_not],
+               '$show_friends' => ['vier_show_friends', DI::l10n()->t('Find Friends'), $show_friends, '', $show_or_not],
+               '$show_lastusers' => ['vier_show_lastusers', DI::l10n()->t('Last users'), $show_lastusers, '', $show_or_not]
        ]);
        return $o;
 }
index e7318902a623e7156f6ab264980a178768d048d3..aac2ec02dc8617cd7a35f698d4c3d2bb51c2b523 100644 (file)
@@ -125,7 +125,7 @@ function vier_community_info()
 
                $tpl = Renderer::getMarkupTemplate('ch_directory_item.tpl');
                if (DBA::isResult($r)) {
-                       $aside['$comunity_profiles_title'] = L10n::t('Community Profiles');
+                       $aside['$comunity_profiles_title'] = DI::l10n()->t('Community Profiles');
                        $aside['$comunity_profiles_items'] = [];
 
                        foreach ($r as $rr) {
@@ -155,7 +155,7 @@ function vier_community_info()
                );
 
                if (DBA::isResult($r)) {
-                       $aside['$lastusers_title'] = L10n::t('Last users');
+                       $aside['$lastusers_title'] = DI::l10n()->t('Last users');
                        $aside['$lastusers_items'] = [];
 
                        foreach ($r as $rr) {
@@ -173,18 +173,18 @@ function vier_community_info()
        //right_aside FIND FRIENDS
        if ($show_friends && local_user()) {
                $nv = [];
-               $nv['findpeople'] = L10n::t('Find People');
-               $nv['desc'] = L10n::t('Enter name or interest');
-               $nv['label'] = L10n::t('Connect/Follow');
-               $nv['hint'] = L10n::t('Examples: Robert Morgenstein, Fishing');
-               $nv['findthem'] = L10n::t('Find');
-               $nv['suggest'] = L10n::t('Friend Suggestions');
-               $nv['similar'] = L10n::t('Similar Interests');
-               $nv['random'] = L10n::t('Random Profile');
-               $nv['inv'] = L10n::t('Invite Friends');
-               $nv['directory'] = L10n::t('Global Directory');
+               $nv['findpeople'] = DI::l10n()->t('Find People');
+               $nv['desc'] = DI::l10n()->t('Enter name or interest');
+               $nv['label'] = DI::l10n()->t('Connect/Follow');
+               $nv['hint'] = DI::l10n()->t('Examples: Robert Morgenstein, Fishing');
+               $nv['findthem'] = DI::l10n()->t('Find');
+               $nv['suggest'] = DI::l10n()->t('Friend Suggestions');
+               $nv['similar'] = DI::l10n()->t('Similar Interests');
+               $nv['random'] = DI::l10n()->t('Random Profile');
+               $nv['inv'] = DI::l10n()->t('Invite Friends');
+               $nv['directory'] = DI::l10n()->t('Global Directory');
                $nv['global_dir'] = Search::getGlobalDirectory();
-               $nv['local_directory'] = L10n::t('Local Directory');
+               $nv['local_directory'] = DI::l10n()->t('Local Directory');
 
                $aside['$nv'] = $nv;
        }
@@ -224,12 +224,12 @@ function vier_community_info()
                        $page = Renderer::replaceMacros(
                                $tpl,
                                [
-                                       '$title'          => L10n::t('Forums'),
+                                       '$title'          => DI::l10n()->t('Forums'),
                                        '$forums'         => $entries,
-                                       '$link_desc'      => L10n::t('External link to forum'),
+                                       '$link_desc'      => DI::l10n()->t('External link to forum'),
                                        '$total'          => $total,
                                        '$visible_forums' => $visible_forums,
-                                       '$showmore'       => L10n::t('show more')]
+                                       '$showmore'       => DI::l10n()->t('show more')]
                        );
 
                        $aside['$page'] = $page;
@@ -262,13 +262,13 @@ function vier_community_info()
                        $r[$index]["url"] = Contact::magicLink($helper["url"]);
                }
 
-               $r[] = ["url" => "help/Quick-Start-guide", "name" => L10n::t("Quick Start")];
+               $r[] = ["url" => "help/Quick-Start-guide", "name" => DI::l10n()->t("Quick Start")];
 
                $tpl = Renderer::getMarkupTemplate('ch_helpers.tpl');
 
                if ($r) {
                        $helpers = [];
-                       $helpers['title'] = ["", L10n::t('Help'), "", ""];
+                       $helpers['title'] = ["", DI::l10n()->t('Help'), "", ""];
 
                        $aside['$helpers_items'] = [];
 
@@ -347,7 +347,7 @@ function vier_community_info()
 
                if (DBA::isResult($r)) {
                        $con_services = [];
-                       $con_services['title'] = ["", L10n::t('Connect Services'), "", ""];
+                       $con_services['title'] = ["", DI::l10n()->t('Connect Services'), "", ""];
                        $aside['$con_services'] = $con_services;
 
                        foreach ($r as $rr) {