Skip Navigation

Open

Reported for: WPML Multilingual CMS 4.5.14

Topic Tags: Bug, Known issue

Overview of the issue

When you save a translation of a multiline element using Classic Translation Editor, the line breaks are removed and the translation appears as a single line.

Workaround

Be sure to create a full backup of your site before proceeding.

  1. Go to: wp-content/plugins/wpml-string-translation/classes/class-wpml-st-string.php
  2. After the code:
    			if ( ! empty( $translation_data ) ) {
    

    Add this code:

                    if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "wpml_save_job_ajax" && preg_match('/[nr]/', $translation_data["value"])) {
                        $translation_data["value"] = wpautop($translation_data["value"]);
                    }
    

2 Responses to “Classic Translation Editor removes line breaks”

  1. Hi we tried it…It works, but it also puts things on other elementor sites, like videos get hidden because it saves it as text.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>