Merge "Fix variable descriptions showing raw "($1)""

This commit is contained in:
jenkins-bot 2024-06-20 15:46:12 +00:00 committed by Gerrit Code Review
commit 8dd15bac76

View file

@ -56,12 +56,15 @@ class VariablesFormatter {
$varMsgKey = $this->keywordsManager->getMessageKeyForVar( $key );
if ( $varMsgKey ) {
$keyDisplay = $this->messageLocalizer->msg( $varMsgKey )->parse() . ' ' .
Html::element(
'code',
[],
$this->messageLocalizer->msg( 'parentheses' )->rawParams( $key )->text()
);
$varMsg = $this->messageLocalizer->msg( $varMsgKey );
$arg = Html::element( 'code', [], $key );
if ( str_contains( $varMsg->plain(), '$1' ) ) {
$keyDisplay = $varMsg->params( $arg )->parse();
} else {
// workaround due to 1904cf8 (temporary?)
$keyDisplay = $varMsg->parse() . ' '
. $this->messageLocalizer->msg( 'parentheses' )->rawParams( $arg )->escaped();
}
} else {
$keyDisplay = Html::element( 'code', [], $key );
}