mirror of
https://github.com/getgrav/grav.git
synced 2026-07-10 11:12:17 +02:00
set baseRoute with activelang if available
This commit is contained in:
@@ -95,6 +95,8 @@ class Pages
|
||||
|
||||
protected $initialized = false;
|
||||
|
||||
protected $active_lang;
|
||||
|
||||
/**
|
||||
* @var Types
|
||||
*/
|
||||
@@ -143,7 +145,7 @@ class Pages
|
||||
*/
|
||||
public function baseRoute($lang = null)
|
||||
{
|
||||
$key = $lang ?: 'default';
|
||||
$key = $lang ?: $this->active_lang ?: 'default';
|
||||
|
||||
if (!isset($this->baseRoute[$key])) {
|
||||
/** @var Language $language */
|
||||
@@ -968,6 +970,9 @@ class Pages
|
||||
|
||||
$pages_dir = $locator->findResource('page://');
|
||||
|
||||
// Set active language
|
||||
$this->active_lang = $language->getActive();
|
||||
|
||||
if ($config->get('system.cache.enabled')) {
|
||||
/** @var Cache $cache */
|
||||
$cache = $this->grav['cache'];
|
||||
|
||||
Reference in New Issue
Block a user