### Plural
-- `Friendica\Core\L10n::tt('Label', 'Labels', 1)` => `Label`
-- `Friendica\Core\L10n::tt('Label', 'Labels', 3)` => `Labels`
-- `Friendica\Core\L10n::tt('%d Label', '%d Labels', 1)` => `1 Label`
-- `Friendica\Core\L10n::tt('%d Label', '%d Labels', 3)` => `3 Labels`
-- `Friendica\Core\L10n::tt('%d Label', 'Labels %2%s %3%s', 1, 'test', 'test2')` => `Label test test2`
-- `Friendica\Core\L10n::tt('%d Label', 'Labels %2%s %3%s', 3, 'test', 'test2')` => `Labels test test2`
+- `Friendica\Core\DI::l10n()->tt('Label', 'Labels', 1)` => `Label`
+- `Friendica\Core\DI::l10n()->tt('Label', 'Labels', 3)` => `Labels`
+- `Friendica\Core\DI::l10n()->tt('%d Label', '%d Labels', 1)` => `1 Label`
+- `Friendica\Core\DI::l10n()->tt('%d Label', '%d Labels', 3)` => `3 Labels`
+- `Friendica\Core\DI::l10n()->tt('%d Label', 'Labels %2%s %3%s', 1, 'test', 'test2')` => `Label test test2`
+- `Friendica\Core\DI::l10n()->tt('%d Label', 'Labels %2%s %3%s', 3, 'test', 'test2')` => `Labels test test2`
if ($posts_day > $throttle_day) {
Logger::log('Daily posting limit reached for user '.api_user(), Logger::DEBUG);
// 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));
+ throw new TooManyRequestsException(DI::l10n()->tt("Daily posting limit of %d post reached. The post was rejected.", "Daily posting limit of %d posts reached. The post was rejected.", $throttle_day));
}
}
if ($posts_week > $throttle_week) {
Logger::log('Weekly posting limit reached for user '.api_user(), Logger::DEBUG);
// 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));
+ throw new TooManyRequestsException(DI::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));
}
}
$return = '';
switch ($v) {
case 'like':
- $return = L10n::tt('Like', 'Likes', $count);
+ $return = DI::l10n()->tt('Like', 'Likes', $count);
break;
case 'dislike':
- $return = L10n::tt('Dislike', 'Dislikes', $count);
+ $return = DI::l10n()->tt('Dislike', 'Dislikes', $count);
break;
case 'attendyes':
- $return = L10n::tt('Attending', 'Attending', $count);
+ $return = DI::l10n()->tt('Attending', 'Attending', $count);
break;
case 'attendno':
- $return = L10n::tt('Not Attending', 'Not Attending', $count);
+ $return = DI::l10n()->tt('Not Attending', 'Not Attending', $count);
break;
case 'attendmaybe':
- $return = L10n::tt('Undecided', 'Undecided', $count);
+ $return = DI::l10n()->tt('Undecided', 'Undecided', $count);
break;
}
}
$invalid = Probe::validDfrn($parms);
if ($invalid) {
- notice(L10n::tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
+ notice(DI::l10n()->tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
return;
}
}
}
$invalid = Probe::validDfrn($parms);
if ($invalid) {
- notice(L10n::tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
+ notice(DI::l10n()->tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
return;
}
'$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']),
+ '$count' => DI::l10n()->tt('%d message', '%d messages', $rr['count']),
]);
}
$o .= $tabs;
if ($gid && ($t = Contact::getOStatusCountByGroupId($gid)) && !DI::pConfig()->get(local_user(), 'system', 'nowarn_insecure')) {
- notice(L10n::tt("Warning: This group contains %s member from a network that doesn't allow non public messages.",
+ notice(DI::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(DI::l10n()->t("Messages in this group won't be send to these receivers.").EOL);
$x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining'));
if ($x || is_site_admin()) {
DI::page()['aside'] .= '<div class="side-link widget" id="side-invite-remain">'
- . L10n::tt('%d invitation available', '%d invitations available', $x)
+ . DI::l10n()->tt('%d invitation available', '%d invitations available', $x)
. '</div>';
}
}
$tpl = Renderer::getMarkupTemplate('widget/remote_friends_common.tpl');
return Renderer::replaceMacros($tpl, [
- '$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
+ '$desc' => DI::l10n()->tt("%d contact in common", "%d contacts in common", $t),
'$base' => DI::baseUrl(),
'$uid' => $profile_uid,
'$cid' => (($cid) ? $cid : '0'),
$contacts_stmt = DBA::select('contact', ['id', 'uid', 'addr', 'url', 'name', 'thumb', 'network'], ['id' => $contact_ids]);
if (DBA::isResult($contacts_stmt)) {
- $contacts_title = L10n::tt('%d Contact', '%d Contacts', $total);
+ $contacts_title = DI::l10n()->tt('%d Contact', '%d Contacts', $total);
$micropro = [];
while ($contact = DBA::fetch($contacts_stmt)) {
$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),
+ '$title' => DI::l10n()->tt('Trending Tags (last %d hour)', 'Trending Tags (last %d hours)', $period),
'$more' => DI::l10n()->t('More Trending Tags'),
'$tags' => $tags,
]);
* is performed using the count as parameter.
*
* Usages:
- * - L10n::tt('Like', 'Likes', $count)
- * - L10n::tt("%s user deleted", "%s users deleted", count($users))
+ * - DI::l10n()->tt('Like', 'Likes', $count)
+ * - DI::l10n()->tt("%s user deleted", "%s users deleted", count($users))
*
* @param string $singular
* @param string $plural
* is performed using the count as parameter.
*
* Usages:
- * - L10n::tt('Like', 'Likes', $count)
- * - L10n::tt("%s user deleted", "%s users deleted", count($users))
+ * - DI::l10n()->tt('Like', 'Likes', $count)
+ * - DI::l10n()->tt("%s user deleted", "%s users deleted", count($users))
*
* @param string $singular
* @param string $plural
}
}
if ($errorcount > 0) {
- notice(L10n::tt("%d contact not imported", "%d contacts not imported", $errorcount));
+ notice(DI::l10n()->tt("%d contact not imported", "%d contacts not imported", $errorcount));
}
foreach ($account['group'] as &$group) {
}
if (mb_strlen($username) < $username_min_length) {
- throw new Exception(L10n::tt('Username should be at least %s character.', 'Username should be at least %s characters.', $username_min_length));
+ throw new Exception(DI::l10n()->tt('Username should be at least %s character.', 'Username should be at least %s characters.', $username_min_length));
}
if (mb_strlen($username) > $username_max_length) {
- throw new Exception(L10n::tt('Username should be at most %s character.', 'Username should be at most %s characters.', $username_max_length));
+ throw new Exception(DI::l10n()->tt('Username should be at most %s character.', 'Username should be at most %s characters.', $username_max_length));
}
// So now we are just looking for a space in the full name.
foreach ($contacts as $uid) {
Model\Contact::unblock($uid);
}
- notice(L10n::tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
+ notice(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
}
DI::baseUrl()->redirect('admin/blocklist/contact');
'$baseurl' => DI::baseUrl()->get(true),
'$contacts' => $contacts,
- '$total_contacts' => L10n::tt('%s total blocked contact', '%s total blocked contacts', $total),
+ '$total_contacts' => DI::l10n()->tt('%s total blocked contact', '%s total blocked contacts', $total),
'$paginate' => $pager->renderFull($total),
'$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')],
if (!empty($_POST['page_users_block'])) {
// @TODO Move this to Model\User:block($users);
DBA::update('user', ['blocked' => 1], ['uid' => $users]);
- notice(L10n::tt('%s user blocked', '%s users blocked', count($users)));
+ notice(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
}
if (!empty($_POST['page_users_unblock'])) {
// @TODO Move this to Model\User:unblock($users);
DBA::update('user', ['blocked' => 0], ['uid' => $users]);
- notice(L10n::tt('%s user unblocked', '%s users unblocked', count($users)));
+ notice(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
}
if (!empty($_POST['page_users_delete'])) {
}
}
- notice(L10n::tt('%s user deleted', '%s users deleted', count($users)));
+ notice(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
}
if (!empty($_POST['page_users_approve'])) {
}
}
if ($count_actions > 0) {
- info(L10n::tt('%d contact edited.', '%d contacts edited.', $count_actions));
+ info(DI::l10n()->tt('%d contact edited.', '%d contacts edited.', $count_actions));
}
DI::baseUrl()->redirect('contact');
}
}
- notice(L10n::tt('%d message sent.', '%d messages sent.', $total) . EOL);
+ notice(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total) . EOL);
}
public static function content(array $parameters = [])
DBA::close($contacts_stmt);
switch ($type) {
- case 'followers': $title = L10n::tt('Follower (%s)', 'Followers (%s)', $total); break;
- case 'following': $title = L10n::tt('Following (%s)', 'Following (%s)', $total); break;
- case 'mutuals': $title = L10n::tt('Mutual friend (%s)', 'Mutual friends (%s)', $total); break;
+ case 'followers': $title = DI::l10n()->tt('Follower (%s)', 'Followers (%s)', $total); break;
+ case 'following': $title = DI::l10n()->tt('Following (%s)', 'Following (%s)', $total); break;
+ case 'mutuals': $title = DI::l10n()->tt('Mutual friend (%s)', 'Mutual friends (%s)', $total); break;
- case 'all': default: $title = L10n::tt('Contact (%s)', 'Contacts (%s)', $total); break;
+ case 'all': default: $title = DI::l10n()->tt('Contact (%s)', 'Contacts (%s)', $total); break;
}
$tpl = Renderer::getMarkupTemplate('profile/contacts.tpl');
'$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_label' => DI::l10n()->tt('Error', 'Errors', count(self::$errors)),
'$errors' => self::$errors,
'$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'],
// Collapse
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]['num_comments'] = DI::l10n()->tt('%d comment', '%d comments', $total_children);
$result['children'][0]['show_text'] = DI::l10n()->t('Show more');
$result['children'][0]['hide_text'] = DI::l10n()->t('Show fewer');
if ($thread_level > 1) {
if ($this->isToplevel()) {
$result['total_comments_num'] = "$total_children";
- $result['total_comments_text'] = L10n::tt('comment', 'comments', $total_children);
+ $result['total_comments_text'] = DI::l10n()->tt('comment', 'comments', $total_children);
}
$result['private'] = $item['private'];