Added language_codes to Twig init to allow for easy language name/code/native-name lookup

This commit is contained in:
Andy Miller
2017-03-20 10:36:26 -06:00
parent 5c34556246
commit 330a90b0ab
2 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -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,
];
}
}