Overview of the Issue
When using WP Configurator Pro with WPML, you might experience the following issues: on a translated WooCommerce product linked to a configurator, the configurator’s title replaces the product title and the configurator description stays in English, and the PDF texts cannot be translated.
Workaround
Add the following code to the functions.php file of your child theme:
PHP
add_filter( 'the_title', function ( $title, $id = 0 ) {
if ( ( is_admin() && ! wp_doing_ajax() ) || ! $id || 'product' !== get_post_type( $id ) ) {
return $title;
}
$post = get_post( $id );
return $post ? $post->post_title : $title;
}, 11, 2 );
add_filter( 'do_shortcode_tag', function ( $out, $tag, $attr ) {
if ( 'wpc_config_description' !== $tag || empty( $attr['id'] ) ) {
return $out;
}
$id = absint( $attr['id'] );
return wp_kses_post( apply_filters( 'wpc_single_product_description', get_post_meta( $id, '_wpc_description', true ), $id ) );
}, 10, 3 );Go to WPMLSettings and add the following to the Custom XML Configuration:
XML
<wpml-config>
<admin-texts>
<key name="wpc_pdf_document_heading" />
<key name="wpc_pdf_download_btn_text" />
</admin-texts>
</wpml-config>Then translate the texts in WPMLString Translation.