Resolved by author
Overview of the issue
Within the Uncode theme, when using the Posts (uncode_index) shortcode, two issues have been identified:
- Unexpected base64 encoded content is send to our Advanced Translation Editor.
- Inability to translate the “Read More” text within the Posts shortcode.
Workaround
Please, make sure of having a full backup of your site before proceeding.
You need to apply 2 fixes:
Part I
- Go to WPML > Configuration > Custom XML Configuration page.
- Add the following XML:
<wpml-config> <shortcodes> <shortcode> <tag>uncode_index</tag> </shortcode> </shortcodes> </wpml-config>
Part II
- Open …/wp-content/themes/uncode/vc_templates/uncode_index.php file.
- Look for line 2558.
- Replace:
if (isset($item_prop['read_more_text'])) { $block_data['read_more_text'] = $item_prop['read_more_text']; }
- With:
if (isset($item_prop['read_more_text'])) { $block_data['read_more_text'] = $item_prop['read_more_text']; // WPML Workaround for compsupp-7136 if ( class_exists('Sitepress') ) { $string = $block_data['read_more_text']; $textdomain = 'WordPress'; $string_name = 'WPML Workaround : '.substr($string, 0, 20); $wpml_default_lang = apply_filters('wpml_default_language', NULL ); $wpml_current_lang = apply_filters( 'wpml_current_language', NULL ); if ($wpml_default_lang == $wpml_current_lang ) { do_action( 'wpml_register_single_string', $textdomain, $string_name, $string ); } // Apply the translation to the string $block_data['read_more_text'] = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name); } }