Skip to content

Commit

Permalink
Add back defaults for language and direction attributes (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin authored and franzliedke committed Sep 5, 2019
1 parent ba73c59 commit e88a939
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Frontend/Content/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,30 @@
namespace Flarum\Frontend\Content;

use Flarum\Frontend\Document;
use Flarum\Locale\LocaleManager;
use Illuminate\Support\Arr;
use Psr\Http\Message\ServerRequestInterface as Request;

class Meta
{
/**
* @var LocaleManager
*/
private $locales;

/**
* @param LocaleManager $locales
*/
public function __construct(LocaleManager $locales)
{
$this->locales = $locales;
}

public function __invoke(Document $document, Request $request)
{
$document->language = $this->locales->getLocale();
$document->direction = 'ltr';

$document->meta = array_merge($document->meta, $this->buildMeta($document));
$document->head = array_merge($document->head, $this->buildHead($document));
}
Expand Down

0 comments on commit e88a939

Please sign in to comment.