Thank you for contacting us here in the Support Forum
Unfortunately, the CRED AddOn that did this, is deprecated due to low usage.
Anyway, I happen to have implemented sort of a front end Translation with CRED + WPML.
1. Create your CRED forms to submit the Content (default language)
2. Use WPML Core and Translation management (active on your install)
3. Add a CRED form that EDIT's the Post type
4. Use WPML API to submit the Form and trigger this API with a CRED API as below instructed:
To apply to the CRED CREATE POST FORM:
/**
*Duplicate Content on submit of Original to all secondary langs (for translation)
*/
function quick_duplicate_save_data_action( $post_id, $form_data ){
// Change your CRED Form "ID" accordingly below
if ($form_data['id']==ID){
// Use new WPML API
do_action( 'wpml_admin_make_post_duplicates', $post_id ) ;
}
}
add_action( 'cred_save_data', 'quick_duplicate_save_data_action', 10, 2 );
- All taxonomies must be translated in the backend
- The Post Type must be marked as "Translatable"
- Copy taxonomy to translations in WPML > Translation Management must be set
- After you submit a Content with the CREATE Form the custom code above will DUPLICATE it to all secondary languages.
Then, with the Edit form, you can Edit those duplications (actually, translate :))
To avoid edition of default language content, you can check in a view as example (where you display the content + CRED forms) if the current language viewed is NOT your default language.
You can use this Custom ShortCode to return the current WPML language:
/**
*Add ICL_LANGUAGE_CODE shortcode
*/
function wpml_language_code_value_func() {
$return = ICL_LANGUAGE_CODE;
return $return;
}
add_shortcode('wpml_language_code_value', 'wpml_language_code_value_func');
Use it in a wpv-conditional to evaluate the current language viewed.
This below is how the translation works for your logged in user on the front end:
1. Content must exist in your default language
2. Otherwise create it first in that language
3. Creating new Content in default language will duplicate the Original Post into all secondary langauges
4. You can then head to your preferred language (secondary), locate the duplicated Post and edit it (translate it)
5. If the Post already exists in default language, you can proceed the same way
6. Submitting the "edition" (translation) will automatically remove the duplicate_flag for ALL translations, so your content will NOT be overwrtitten if a translation is edited 🙂
7. All Taxonomies are automatically siynced for you, no worries. Only bare transaltion of Text is needed.
(this is why you need to translate taxonomies first in the WP Backend as a Admin)
I hope I could help with this custom approach.
Please let me know if you need further infos about this.
Thank you for your patience.