Skip to content

Commit

Permalink
move language debug to debugger - fixes #3752
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 2, 2023
1 parent 65aeb82 commit 79f9640
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Add the ability to programtically set a page's `modified` timestamp via a `modified:` frontmatter entry
2. [](#improved)
* Include `phar` in the list of `security.uploads_dangerous_extensions`
* When enabled `system.languages.debug` now dumps **Key -> Value** to debugger [#3752](https://github.com/getgrav/grav/issues/3752)

# v1.7.42.3
## 07/18/2023
Expand Down
7 changes: 4 additions & 3 deletions system/src/Grav/Common/Twig/Extension/GravExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -916,10 +916,11 @@ public function translate(Environment $twig, ...$args)
$translation = $this->grav['language']->translate($args);

if ($this->config->get('system.languages.debug', false)) {
return new Markup("<span class=\"translate-debug\" data-toggle=\"tooltip\" title=\"" . $args[0] . "\">$translation</span>", 'UTF-8');
} else {
return $translation;
$debugger = $this->grav['debugger'];
$debugger->addMessage("$args[0] -> $translation", 'debug');
}

return $translation;
}

/**
Expand Down

0 comments on commit 79f9640

Please sign in to comment.