Attribute notes on the admin product view are untranslatable (and my fix)

localization
bug-fix
(Dmitry Fedyuk) #1

This is a long term bug from Magento 1.x, and still is in Magento 2.
A value of an atrrivbute’s note property is untranslatable while it is shown to an administrator on the admin product view.
For example, let see the product «Meta Description» («meta_description») attribute.
It has a note:

But it is untranslatable:

The problem line is:

To fix the bug replace the problem line with new ones:

/** @var string|null $noteOriginal */
$noteOriginal = $element->getNote();
/** @var string $noteTranslated */
$noteTranslated = !$noteOriginal ? '' : __($noteOriginal);
/** @var string $note */
$note = !$noteTranslated ? '' : '<div class="note">' . $noteTranslated . '</div>';

GitHub issue: 1954

0 Likes