Skip to content

Commit

Permalink
LatteExtension: added option 'locale'
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed May 26, 2024
1 parent 1e86896 commit f487f4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Bridges/ApplicationDI/LatteExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function getConfigSchema(): Nette\Schema\Schema
'strictTypes' => Expect::bool(false),
'strictParsing' => Expect::bool(false),
'phpLinter' => Expect::string(),
'locale' => Expect::string(),
]);
}

Expand All @@ -59,6 +60,9 @@ public function loadConfiguration(): void
->addSetup('setTempDirectory', [$this->tempDir])
->addSetup('setAutoRefresh', [$this->debugMode])
->addSetup('setStrictTypes', [$config->strictTypes]);
if ($config->locale) {
$latteFactory->addSetup('setLocale', [$config->locale]);
}

if (version_compare(Latte\Engine::VERSION, '3', '<')) {
foreach ($config->macros as $macro) {
Expand Down

0 comments on commit f487f4b

Please sign in to comment.