Skip Navigation

[Resolved] Automatically translate posted posttype in combination with WPML

This support ticket is created 4 years, 12 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)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 4 years, 12 months ago.

Assisted by: Waqar.

Author
Posts
#1484589

Tell us what you are trying to do?
Dear,

I would like to have a post type automatically posted and translated in two different languages when published.
I created a post type in NL language with a template and custom field values.
The images should be copied automatically in the languages English and German.
The field values should be copied to or the translation of these field values should be shown automatically in english or german.

So what I trying to create is a front end form for this custom post type in Dutch with field values and three post description text boxes so that a user can enter text in dutch german and english.
When the user filled in the field values and clicked on publish the post should be published.
The post should be after publishing automatically translated in the languages english and german.
Only the description text box values will not be copied but it has to be shown when the user entered an english description in the english language on the post layout.

Is there any documentation that you are following?
Yes toolset tranlsting documentation.

Look forward to your answer.

Best regards

#1486359

Hi,

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

I'm afraid, neither WPML nor Toolset offer any built-in feature to automatically create translated copies of posts from one language.

The WPML's automatic translation feature can translate already existing post copies but won't create them on its own, either:
https://wpml.org/documentation/automatic-translation/how-to-use-automatic-translation/

You're welcome to submit this as a feature request at:
https://wpml.org/suggest-a-new-feature-for-wpml/

For now, if you're comfortable with PHP and WordPress functions, you can use Toolset Form's "cred_save_data" hook to execute a custom function, that creates a duplicate of posts in other languages.

Here are links to some useful functions and APIs:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://developer.wordpress.org/reference/functions/wp_insert_post/
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference

For more personalized assistance around customization, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar