Support » Plugin: Genesis Custom Blocks » Translation of blocks with WPML

  • Resolved rpb1001

    (@rpb1001)


    Greetings,
    Congratulations on a very clever plugin.
    I am trying to use it on a site with translations, using the WPML plugin.
    The block does not appear in their translation editor.
    Apparently a configuration file is required.
    If you are interested to read about that, please check here:
    https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks
    I am trying to build a config file now for a test block and it seems to be quite easy at least for a simple text field.
    Perhaps you could consider generating this file on save if WPML is present.
    Thank you for your great work.

    <wpml-config>
        <gutenberg-blocks>
            <gutenberg-block type="genesis-custom-blocks/race-subtitle" translate="1">
                <key name="race-sub-title"></key>
            </gutenberg-block>
        </gutenberg-blocks>
    </wpml-config>

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Luke Carbis

    (@lukecarbis)

    @rpb1001 Thanks for reaching out here! That wpml-config looks right to me, too. WPML support is a great idea – not sure whether it’s better built into GCB (would we need to also support other translation plugins?) or as a separate “add-on”.

    My suggestion is to add it as a “Feature Request” issue here: https://github.com/studiopress/genesis-custom-blocks/issues/new?template=feature_request.md

    Thread Starter rpb1001

    (@rpb1001)

    Good to hear.
    I will add to github now.
    I think a good first phase result would be to talk with WPML and automate the generation of the XML for the Genesis Custom Blocks plugin, which could then easily be cut paste into the correct place.
    Many thanks

    Hi, we are trying to achieve something similar and translate our Guttenberg custom blocks. We can’t quite get it to work though after many attempts…

    In our wpml.xml config file we have used Xpaths, however in @rpb1001 ‘s example, keys are used instead. Can keys be used as a direct replacement for XPaths? And how do we set up the leys so that they correspond to our block’s attributes?

    Thread Starter rpb1001

    (@rpb1001)

    rpb1001 here, I moved to Advanced Custom Fields (ACF) block. Very similar to this, very easy to set up, and it works (95%) with WPML. I am finding that translating in general is more complex that you would imaging, and there are always some bugs along the way. Good luck!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.