diff --git a/src/Lexique/CompileHelpers.php b/src/Lexique/CompileHelpers.php index 302fff3..bf060f2 100644 --- a/src/Lexique/CompileHelpers.php +++ b/src/Lexique/CompileHelpers.php @@ -131,7 +131,7 @@ protected function compileLang(string $expression): string * @param string $expression * @return string */ - protected function compileTrans(string $expression): string + protected function compileapp_trans(string $expression): string { return $this->compileHelpersStatement($expression, '%trans'); } diff --git a/src/StackManager.php b/src/StackManager.php index 6543b7f..059e1fb 100644 --- a/src/StackManager.php +++ b/src/StackManager.php @@ -146,6 +146,9 @@ public function endStack() public function getStack(string $name, ?string $default = null) { if (array_key_exists($name, $this->pushes)) { + if (is_null($this->pushes[$name])) { + $this->pushes[$name] = $default ?? ''; + } return $this->tintin->renderString( $this->pushes[$name], ['__tintin' => $this->tintin] diff --git a/tests/CompileHelpersTest.php b/tests/CompileHelpersTest.php index e31ea60..2f4a6bf 100644 --- a/tests/CompileHelpersTest.php +++ b/tests/CompileHelpersTest.php @@ -115,7 +115,7 @@ public function testCompileTransStatement() { $compileService = $this->makeReflectionFor('compileTrans'); - $render = $compileService->invoke($this->compiler, '%trans("user.service")'); + $render = $compileService->invoke($this->compiler, '%app_trans("user.service")'); $this->assertEquals($render, ''); }