• Resolved SirLouen

    (@sirlouen)


    I’ve tried creating an Icon Box and it works fine with WPML except for the URL box, that cannot be translated.

    Not sure why this happens. Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor motopress

    (@motopress)

    @sirlouen could you describe your issue. It’s simple input where you can add any link.

    Thread Starter SirLouen

    (@sirlouen)

    Check this:
    https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks

    To provide compatibility with WPML (and other language plugins that take advantage of the WPML configuration system like Polylang), all Gutenberg plugins shall be introducing a wpml-config.xml file in their root directory.

    Inside you shall be providing information about the specific blocks you have created and the fields that are subject to a possible translation (generally all URL are subject, just because users that have a multilanguage site, may have different urls for each language)

    This is a sample file content that covers just the icon-box (the one I was having issues with).

    As you see, you put a the xpath type as a link and then you search for this within the iconbox Gutenberg tag that is inside two “div” and the “a” tag + the href property within the “a” tag (Here is the xpath syntax: https://www.w3schools.com/xml/xpath_syntax.asp)

    <wpml-config>
        <gutenberg-blocks>
            <gutenberg-block type="getwid/icon-box" translate="1">
                <xpath type="link">//div/div/a/@href</xpath>
            </gutenberg-block>
        </gutenberg-blocks>
    </wpml-config>

    This may apply to other types of blocks like the single icon

    If you don’t have this it’s plain impossible to have a different URL for each multilang page…

    By the way, also be aware, that maybe other strings that could be translated (like alt texts in images) for custom blocks, won’t be translated if you don’t introduce these configs.

    Plugin Contributor motopress

    (@motopress)

    Thank you for your feedback. We will check this and notify you about the result.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Icon Box and WPML’ is closed to new replies.