Skip to content

Commit

Permalink
Fix document title translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nearata committed Aug 27, 2022
1 parent 334b0e6 commit 4e5c7a4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Frontend/AnniversariesRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
use Flarum\Frontend\Document;
use Flarum\Http\Exception\RouteNotFoundException;
use Flarum\Http\RequestUtil;
use Flarum\Locale\Translator;
use Psr\Http\Message\ServerRequestInterface;

class AnniversariesRoute
{
protected $translator;

public function __construct(Translator $translator)
{
$this->translator = $translator;
}

public function __invoke(Document $document, ServerRequestInterface $request)
{
$actor = RequestUtil::getActor($request);
Expand All @@ -17,6 +25,6 @@ public function __invoke(Document $document, ServerRequestInterface $request)
throw new RouteNotFoundException();
}

$document->title = 'Anniversaries';
$document->title = $this->translator->get("nearata-cakeday.forum.page.title");
}
}

0 comments on commit 4e5c7a4

Please sign in to comment.