Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The module was introduced because Magesuite workflow minifies our JS code before Magento searches for wordings and it could not find them. An additional regexp was added, that allows Magento to find Magesuite MageSuite strings. Basically Magento searches (among others) for $.mage.__() or jQuery.mage.__(), but after minification the result is x.mage.__() where x can be anything. The new regexp skips the prefix and searches only for .mage.__().

https://github.com/magesuite/js-translation-fix/blob/1.x/etc/di.xml

Code Block
languagexml
<type name="Magento\Translation\Model\Js\Config">
    <arguments>
        <argument name="patterns" xsi:type="array">
            <item name="cs_translation_widget" xsi:type="string"><![CDATA[~\.mage\.__\((?s)[^'"]*?(['"])(.+?)(?<!\\)\1(?s).*?\)~]]></item>
        </argument>
    </arguments>
</type>

...