Skip Navigation

[Resolved] How to input text in several languages in same CRED form?

This support ticket is created 6 years, 4 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Bruno Simon 6 years, 4 months ago.

Assisted by: Luo Yang.

Author
Posts
#597459

Tell us what you are trying to do? Make content fields in different languages available to the author in the same CRED form accessed in his default language.

Is there any documentation that you are following? https://wpml.org/wpml-hook/wpml_set_element_language_details/

Hello,

Although most of my CP fields are automatically translated, I'd like the free text fields to be available for manual translation by the author in the front-end via CRED. Should the author not enter a translation, then the translated post should either display the text in the original language or nothing (or perhaps an automatic google translation)
I checked the wpml documentation above but am not sure that is the easiest or only solution available and even less sure about how to implement it.

Thanks.

#597594

Dear Bruno,

There isn't such a built-in feature within CRED form, one CRED form can only create/edit only one post, but in WPML translated posts, each language version of post is a different post, so you can not use one single CRED form to edit multiple posts (several languages).

You can translate the CRED form into different language, and display the CRED form in different language pages, for the author to edit the text fields. See our document:
Translating Content Templates, WordPress Archives, Views, and CRED forms
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-content-templates-wordpress-archives-views-cred-forms/

#597650

Dear Yang,
Thanks for your reply.
Based on that, I imagine the following scenario: create a second CRED form pointing to the post in the second language, but only containing the text fields to be translated; said form would be accessed via a link in the post layout. Would this work, meaning would this form pickup all the other elements (automatically translated from the original form or post? How to?
Thanks again.

#597904

When user submit the CRED form for creating post, you can use CRED action cred_save_data to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
in this PHP function, trigger WPML action hook "wpml_make_post_duplicates", duplicate the post into other languages:
https://wpml.org/wpml-hook/wpml_make_post_duplicates/

Then setup CRED form for editing post, and for your user to edit the post in other languages:
https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/

#597965

Hello Yang,
Thanks for all the tips; I'll find my way from there and, the case being, open a more specific ticket.
Cheers.

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