Magento 2.2 – Attribute ‘translate’ Not Allowed

checkoutlayoutmagento2.2

I was created simple custom module in magento 2.1. And it's working fine in magento 2.1.9.

But today I tried to installe in magento 2.2 and it's shows this error:

1 exception(s): Exception #0
(Magento\Framework\Config\Dom\ValidationException): Element 'item',
attribute 'translate': The attribute 'translate' is not allowed. Line:
1920

Exception #0 (Magento\Framework\Config\Dom\ValidationException):
Element 'item', attribute 'translate': The attribute 'translate' is
not allowed. Line: 1920

Here is file where generate this error

<referenceBlock name="checkout.root">
    <arguments>
        ...
        ...
            <item name="fee" xsi:type="array">
                <item name="component"  xsi:type="string">Vendor_Module/js/view/checkout/cart/totals/myfile</item>
                <item name="config" xsi:type="array">
                    <item name="title" xsi:type="helper" translate="true" helper="Vendor\Module\Helper\Data::getCustomText"/>
                </item>
            </item>
        ...
        ...                    
    </arguments>
</referenceBlock>

Best Answer

You are not allowed to use translate attributes for <item> nodes that have xsi:type anything else other than string.
Just remove translate="true" from this line

<item name="title" xsi:type="helper" translate="true" helper="Vendor\Module\Helper\Data::getCustomText"/>
Related Topic