Move L10n::t() calls to DI::l10n()->t() calls

This commit is contained in:
nupplaPhil 2020-01-18 20:52:34 +01:00
parent af88c2daa3
commit 5dfee31108
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
175 changed files with 2841 additions and 2841 deletions

View 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'), [