Is there any way to add product attribute with different store labels through Magento2 setup script?
If we pass 'label' it only assign default label of the attribute. I tried with frontend_label but that didn't worked.
$options = [
'type' => $type,
'backend' => $input == 'multiselect'? 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend' : '',
'frontend' => '',
'label' => $attributeLabel,
'frontend_label' => array(0=>$attributeLabel,1=>$attributeLabel.' test1',2=>"",3=>"",4=>"",5=>$attributeLabel.' test5',6=>"",7=>"",8=>""),
'input' => $input,
'class' => '',
'source' => in_array($input, ['text', 'textarea', 'multiselect'])
? '' :'Magento\Eav\Model\Entity\Attribute\Source\Table',
'global' => $is_Global ? \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL : \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'searchable' => true,
'filterable' => $isFilter,
'comparable' => true,
'visible_on_front' => $showOnProductPage,
'used_in_product_listing' => $usedInProductListing,
'unique' => false,
'group' => $group,
'apply_to' => '',
'wysiwyg_enabled' => $wysiwyg,
];
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
$attributeCode,
$options
);