Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are using the Timeline Block For Gutenberg to present timelines on your site. When translating the page, everything including dates can be translated, but the dates still appear in French on the English page. This issue arises because the date is not from the core blocks and is not supported for string translation.
Solution:
We recommend using a custom XML configuration code to register the date for translation. After translating, the date should display correctly in the frontend. Here is an example code:


<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="cp-timeline/content-timeline-block-child" translate="1">
      <xpath label="Timeline block date">//div/div/div/div/div/p</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

For more details, refer to our documentation on making custom Gutenberg blocks translatable: https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at our support forum.

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 6 replies, has 2 voices.

Last updated by Long Nguyen 5 months ago.

Assisted by: Long Nguyen.

Author Posts
June 17, 2024 at 1:20 pm #15745746

Mary

Background of the issue:
I'm using the Timeline Block For Gutenberg to present timelines on our site hidden link. When I translate the page, I can translate everything, including the dates, but on the front-end, the dates still appear in French on the English page. I contacted the plugin authors, and they said: 'We are using core blocks for the heading and description in WordPress, which is why the page content is being translated. However, the date is not from the core blocks, so it is not supported for string translation.' The admin_texts_date_format have already been included in the string translations and are translated, so this doesn't seem to be the issue.

Symptoms:
Dates in the Timeline Block For Gutenberg appear in French on the English page despite being translated.

Questions:
Is there a way around this to translate these dates?

June 18, 2024 at 2:19 am #15746988

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Mary,

Thank you for contacting WPML support, I’m happy to help you with this issue.

I use the free version of the plugin Timeline Block https://wordpress.org/plugins/timeline-block/
and I can register the date for translation with a custom XML configuration code, after translating it the translation date displays correctly in the frontend. Here is an example code:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="cp-timeline/content-timeline-block-child" translate="1">
      <xpath label="Timeline block date">//div/div/div/div/div/p</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Refer documentation https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/

The plugin Timeline Block is not available in our list of compatible plugins (https://wpml.org/plugin/), I also suggest you contact the plugin author and ask them to join our Go Global program where our Compatibility developers will help them to make their product compatible with WPML.
https://wpml.org/documentation/support/go-global-program/

Looking forward to your reply.
Thanks

WPML test post en - WPML 2024-06-18 09-15-34.jpg
June 18, 2024 at 4:04 pm #15750052

Mary

Hi Long,

So this works, but it does not only affect the date field. It seems some of the other content in the timeline - as well as lists in the page (but not in the timeline) - which were already translated using the WPML editor were also sent to string translation and I had to translate them again. Is there a way for this to only apply to the dates?

June 19, 2024 at 4:18 am #15752248

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Please let me know the page where you add the Timeline block and translate it.
Then I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/

Looking forward to your reply.
Thanks

June 20, 2024 at 1:43 am #15759346

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

If the sentences are translated in the Advanced Translation Editor (ATE), the translation will be saved to the translation memory and you won't need to re-translate them.
I just edit the page in the French language > Make a small change to the page title > Save and update the translation in the ATE. Now you can see the translation content displayed in the frontend as well. Please check the attached screenshot.

Refer documentation https://wpml.org/documentation/translating-your-contents/how-wpml-keeps-track-of-your-translations/

Looking forward to your reply.
Thanks

Zoning amendment for Zone HM-3 (5471 Westminster) - City of Côte Saint-Luc 2024-06-20 08-42-09.png
June 20, 2024 at 11:21 am #15763244

Mary

Ok, but in the image your posted, the first item in the list ("Projet de règlement...") is still in French and it was already translated in the ATE (see screen capture) when you made the change in the title of the French page. Why didn't work for that one?

Screenshot 2024-06-20 072045.png
June 21, 2024 at 3:40 am #15769987

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I just make a small change to the text "Projet de règlement 2217-III-P11" > Save > And re-update the translation, the translation text is displayed correctly in the frontend. Please check the attached screenshot.

Looking forward to your reply.
Thanks

Zoning amendment for Zone HM-3 (5471 Westminster) - City of Côte Saint-Luc 2024-06-21 10-35-30.png