How to translate attribute labels on admin category pages

localization

(Dmitry Fedyuk) #1

Due to Magento limitations the attributes on an admin category pages are untranslatable.
It is a long time issue lasting from Magento 1.x.
You can fix it with a custom plugin:

di.xml:

<type name='\Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend'>
	<plugin
		name='Df\Eav\Model\Entity\Attribute\Frontend\AbstractFrontendPlugin'
		type='Df\Eav\Model\Entity\Attribute\Frontend\AbstractFrontendPlugin'
		sortOrder='100'
	/>
</type>

Plugin code:

<?php
namespace Df\Eav\Model\Entity\Attribute\Frontend;
use Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend;
class AbstractFrontendPlugin {
	/**
	 * @param AbstractFrontend $subject
	 * @param string $result
	 * @return string
	 */
	public function afterGetLabel(AbstractFrontend $subject, $result) {
        return __($result);
    }
}

GitHub issue: 1909


Product attribute labels in admin attribute grid and admin attribute view are not translatable (and my fix)
(Dmitry Fedyuk) #2

A similar bug: Product attribute labels are not translatable in admnin interface (and my fix)