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 1 reply, has 2 voices.

Last updated by Dražen 7 months ago.

Assisted by: Dražen.

Author Posts
July 28, 2024 at 1:45 pm #16012136

ronnyK-4

<b>Background of the issue: </b>
I am preparing an Elements Template for a Custom Posttype. When using the Generate Blocks Headline Block, I can either translate the content of the Block or the Dynamic Before Text using the following code I found on another post in your Forum. Here is the code:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="generateblocks/headline" translate="1">
      <key name="gpDynamicTextBefore" />
      <key name="gpDynamicUpdatedDateBefore" />
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Markup of a Headline Block in the DB:
<!-- wp:generateblocks/headline {"uniqueId":"2d5b779f","blockVersion":3,"display":"inline-block","spacing":{"marginBottom":"1em","marginTop":"1em"},"dynamicContentType":"post-meta","dynamicLinkType":"term-archives","termTaxonomy":"countries","termSeparator":",","className":"dynamic-term-class","gpDynamicTextType":"terms","gpDynamicLinkType":"term-archives","gpDynamicTextReplace":"Terms","gpDynamicTextTaxonomy":"countries","gpDynamicTextTaxonomySeparator":"","gpDynamicTextCustomField":"title","gpDynamicTextBefore":"Marine Species in "} -->
<h2 class="gb-headline gb-headline-2d5b779f gb-headline-text dynamic-term-class">Terms</h2>
<!-- /wp:generateblocks/headline -->

Link to a page where the issue can be seen: hidden link

<b>Symptoms: </b>
When the code is active, the 'before text' is not seen in the Advanced Editor. When the code is inactive, only the 'normal' headline content shows up. The same issue occurs on the frontend; only one of the two is being translated. I expected to see 'Marine Arten in Südkorea' but got 'Marine Species in Südkorea' instead.

<b>Questions: </b>
Why is the 'before text' not visible in the Advanced Editor when the code is active?
Why is only one of the two (either the content or the 'before text') being translated on the frontend?

July 29, 2024 at 9:11 am #16014782

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks for contacting us.

Can you please install the mentioned addon plugin on the next test website and share with me the test page and what parts need to be translated but are not? Then I will check and try to create the correct XML code so you can translate them.

- hidden link

Regards,
Drazen

July 29, 2024 at 8:02 pm #16017874

ronnyK-4

I could set it up correctly now. Strangely in my Installation i can choose between 3 modes in ACF which i can not in your sandbox.

I choose Expert Mode which i thought was already chosen before. And now it works as it should.