Skip Navigation

[Resolved] How to translate post date shortcode inserted inside a Fields and text block

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

Problem: I have created a Fields and Text block and inserted some text, including a wpv-post-date shortcode. I would like to use a different date format in the secondary language site, but I cannot see the date shortcode in the translation editor so I cannot translate the format.

Solution: In this case the original date shortcode did not include a format attribute. If you want to translate the date format in a wpv-post-date shortcode, you must first include the format attribute in the original shortcode:

[wpv-post-date format="j F Y"]

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-date

This support ticket is created 2 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by dominiqueM-3 2 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#2121323
Capture d’écran 2021-07-21 184405.png

Tell us what you are trying to do?

Inside a Fields and Text block I've inserted the followed code:
<div class="news-meta">
<span>Publié le [wpv-post-date]</span> • <span class="tags">[wpv-post-taxonomy type="post_tag" separator=" "]</span>
</div>

In French it is rendered as for example: Publié le 5 juillet 2021 • Agenda

I would like to translate in English this string to: Published on July 8th, 2021 • Agenda

I'm using WPML as my translation tool.
In WPML translation editor I can't access the short code to modify it by adding for example format="F jS, Y".
(Please see screenshot)

What would be the right way to achieve my need?

Thank you

#2121527
Screen Shot 2021-07-21 at 4.54.51 PM.png
Screen Shot 2021-07-21 at 4.55.01 PM.png

In WPML translation editor I can't access the short code to modify it by adding for example format="F jS, Y".
Hi, if you want to translate into a different date format with the wpv-post-date shortcode, you should also include the format option in the original, default language. Then when you translate this content in the Classic Translation editor, a field to translate the date format setting should appear.

In the original French Fields and Text block:

[wpv-post-date format="j F Y"]

See the screenshots here for an example of the French content, and the Classic Translation editor with Date Format options. If you add the date format in the original content, are you able to translate it successfully in the translation editor?

#2121975

Hi Christian,

Yes, it works as you describe it. Great feature.

Thank you for your support

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.