Skip to content

Commit

Permalink
Merge pull request #34 from a-leurs/bugfix/fix-translation-bug-for-co…
Browse files Browse the repository at this point in the history
…nfig-comments

fix translation bug for config comments
Thanks @sebastian-ehrling @schmengler and @a-leurs!
  • Loading branch information
avstudnitz authored Apr 6, 2023
2 parents 597240e + 48fa03c commit 71a1362
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Plugin/ConfigFieldPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,16 @@ public function afterGetTooltip(Subject $subject, $result)
*/
public function afterGetComment(Subject $subject, $result)
{
$resultIsPhrase = $result instanceof Phrase;
if ($resultIsPhrase) {
$phrase = $result;
$result = $phrase->getText();
$arguments = $phrase->getArguments();

if ($result instanceof Phrase) {
$result = (string) $result;
}

if (strlen(trim($result))) {
$result .= '<br />';
}
$result .= __('Path: <code>%1</code>', $this->getPath($subject));

if ($resultIsPhrase) {
$result = new Phrase($result, $arguments);
}
$result .= __('Path: <code>%1</code>', $this->getPath($subject));

return $result;
}
Expand Down

0 comments on commit 71a1362

Please sign in to comment.