mirror of
https://github.com/getgrav/grav.git
synced 2026-07-04 11:19:12 +02:00
Added language_codes to Twig init to allow for easy language name/code/native-name lookup
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# v1.2.0-rc.3
|
||||
## 03/xx/2017
|
||||
|
||||
1. [](#new)
|
||||
* Added `language_codes` to Twig init to allow for easy language name/code/native-name lookup
|
||||
1. [](#bugfix)
|
||||
* Simplified modular/twig processing logic and fixed an issue with system process config [#1351](https://github.com/getgrav/grav/issues/1351)
|
||||
* Fix for page-level debugger override changing the option site-wide
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Grav\Common\Twig;
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Common\Config\Config;
|
||||
use Grav\Common\Language\Language;
|
||||
use Grav\Common\Language\LanguageCodes;
|
||||
use Grav\Common\Page\Page;
|
||||
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
use RocketTheme\Toolbox\Event\Event;
|
||||
@@ -173,7 +174,7 @@ class Twig
|
||||
'theme_dir' => $locator->findResource('theme://'),
|
||||
'theme_url' => $this->grav['base_url'] . '/' . $locator->findResource('theme://', false),
|
||||
'html_lang' => $this->grav['language']->getActive() ?: $config->get('site.default_lang', 'en'),
|
||||
|
||||
'language_codes' => new LanguageCodes,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user