«Admin» store title is untranslatable on admin attribute edit page neither by a dictionary nor manually (and my fix)

localization
bug-fix

(Dmitry Fedyuk) #1

Github Issue: 1998


(Dmitry Fedyuk) #2

I fixed the problem with a plugin:

<type name='\Magento\Store\Model\Store'>
	<plugin
		name='Df\Store\Model\StorePlugin'
		type='Df\Store\Model\StorePlugin'
		sortOrder='100'
	/>
</type>
<?php
namespace Df\Store\Model;
use Magento\Store\Model\Store;
class StorePlugin {
	/**
	 * 2015-10-01
	 * «Admin» store title is untranslatable on admin attribute edit page
	 * neither by a dictionary nor manually.
	 * @link https://mage2.pro/t/99
	 * @see AbstractFrontend::getName()
	 * @param Store $subject
	 * @param string $result
	 * @return string
	 */
	public function afterGetName(Store $subject, $result) {
		return 'Admin' === $result ? __($result) : $result;
	}
}