Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 23 replies, has 4 voices.

Last updated by usahello 9 months, 2 weeks ago.

Assigned support staff: Raja Mohammed.

Author Posts
September 24, 2019 at 1:04 am #4626961

heidiS-4

This has not been resolved yet.

September 24, 2019 at 5:10 am #4628061

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The issue is still in our developer's queue. Marking the ticket as escalated to developers for an internal purpose.

October 23, 2019 at 9:33 pm #4814835

usahello

@raja-m is there any news on this ticket? Have the developers begun work on a fix? Thanks.

October 24, 2019 at 4:59 am #4816195

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for reaching out.

The issue has been handled in various escalated tickets for several use-cases.
It seems like the latest version of WPML 4.3.0 has the fix already bundled into.

Please verify if the issue still persists in the latest version of WPML 4.3.0.

You can update to the latest version of WPML from Plugins > Add New > commercial tab. Click on "Check updates" this will make sure the latest version if fetched from the repository.

I hope this helps resolve the issue.

Kind regards
Raja

October 24, 2019 at 4:55 pm #4822417

usahello

I have updated to WPML 4.3.1, but the issue still exists for my dynamic block.

October 24, 2019 at 9:23 pm #4823377

usahello

Actually, it does seem like my dynamic block is getting picked up by WPML translation editor now. I saw in a different support thread that the custom block was defined in the wpml-config.xml in a different manner because it's a dynamic block. Originally I defined the custom block like this:

<gutenberg-block type="hello-tools/newsletter-signup" translate="1">
   <xpath>//div[@class="newsletter-signup__headline"]/span</xpath>
   <xpath>//div[@class="newsletter-signup__blurb"]/span</xpath>
</gutenberg-block>

but it looks like I'm supposed to use <key> instead of <xpath>

<gutenberg-block type="hello-tools/newsletter-signup" translate="1">
   <key name="headline"></key>
   <key name="blurb"></key>
</gutenberg-block>
October 24, 2019 at 10:12 pm #4823469

usahello

Maybe I spoke too soon. My previous post is true, the translation works, but only if a unique value is entered into the fields. In other words, if you keep the default value that is defined in the block registration (e.g. "Subscribe to our newsletter") nothing will show up in the post_content and thus no field shows up in the translation editor.

<!-- wp:hello-tools/newsletter-signup /-->

But, if you modify edit the field for the block in the Gutenberg editor, say just adding an exclamation point so it says "Subscribe to our newsletter!" it'll show up as an attribute in the post_content and be available for translation.

<!-- wp:hello-tools/newsletter-signup {"headline":"Subscribe to our newsletter!"} /-->

Is there any way to get default attribute values to show up for translation?

October 25, 2019 at 3:34 am #4823779

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please try this config, let me know if that helps


<gutenberg-block type="hello-tools/newsletter-signup" translate="1">
    <attrs>
        <key name="headline"></key> 
    </attrs>
</gutenberg-block>

Kind regards
Raja

October 25, 2019 at 7:33 pm #4829787

usahello

That didn't make a difference for me. I think the problem was that the attribute was not getting saved in HTML comment for the dynamic block in the post_content. This seems to be a known issue discussed on Github (hidden link). I was able to find a workaround to mimic a default value without actually declaring it in the custom block's attributes.

The topic ‘[Closed] Dynamic block translation’ is closed to new replies.