mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:50:15 +00:00
Move L10n::t() calls to DI::l10n()->t() calls
This commit is contained in:
parent
af88c2daa3
commit
5dfee31108
175 changed files with 2841 additions and 2841 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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'), [
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue