Integrate with wp all export
-
Hi,
We tried to integrate a translated woocommerce feed, we translated all fields with custom code but the code for product description only works if there is only one paragraph. If more html elements ore paragraphs is in description, translation doesn’t work anymore. Can you help? This is the code:function translate_content($value){ $orgvalue = $value; $trp_instance = TRP_Translate_Press::get_trp_instance(); $translator = $trp_instance->get_component('translation_render'); $content = ''; $value = str_replace('<ul>', '', $value); $value = str_replace('</ul>', '', $value); $value = str_replace('<li>', '<p>', $value); $value = str_replace('</li>', '</p>', $value); $value = str_replace('<span>', '<p>', $value); $value = str_replace('</span>', '</p>', $value); $pieces = explode("</p>", $value); foreach ($pieces as $key => $val) { $translation = $translator->process_strings(array(strip_tags(trim($val))),'ro_RO'); // $content .= "#" . $val . "#"; if ($translation){ $content .= " " . $translation[0];} } //return $orgvalue; if(empty($content)){ return $orgvalue;} return $content; }
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Integrate with wp all export’ is closed to new replies.