Skip Navigation

[Resolved] How to translate [wpv-post-status] with WPML?

This support ticket is created 2 years, 7 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Dido 2 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#2345515
status.JPG

Hi,

in a view I can show published items and drafts.
I want to show this in the frontend, but I see the words pulish and draft.
Since my site is in Dutch I want to translate these words.
I can't find these strings in WPML. What to do with this?

#2345833

Hi,

Thank you for contacting us and I'd be happy to assist.

Have you tried adding this shortcode, inside the "wpml-string" shortcode?
( ref: https://wpml.org/documentation/support/wpml-coding-api/shortcodes/#wpml-string )

Example:


[wpml-string context="wpv-views"][wpv-post-status][/wpml-string]

Any text/string included within this shortcode is made available for translation, but, you'll have to make sure to visit the front-end page, at least once, after including this shortcode.

regards,
Waqar

#2345883
transl.JPG

Hi Waqar,

I tried this, but it is not working yet.
I visite the front page several times.

#2347167

I've performed some tests on my website and I was able to show the translated text for each post status, using individual conditional statements, for example:
( ref: https://toolset.com/documentation/legacy-features/views-plugin/using-shortcodes-in-conditions/ )


[wpv-conditional if="( '[wpv-post-status]' eq 'draft' )"]
[wpml-string context="wpv-views"]Draft[/wpml-string]
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-status]' eq 'publish' )"]
[wpml-string context="wpv-views"]Published[/wpml-string]
[/wpv-conditional]

You can add the translatable text strings for each post status and then they will start showing in the WPML's string translation section.

#2348481

My issue is resolved now. Thank you!