Skip to content Skip to sidebar

Resolved

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"]);
                    }
    

4 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.

  2. Hi, same issue here, i think. For some fields of text paragraph using Elementor.
    I’m watching this topic for updates 🙂

    • Hello Heikki,
      In the meantime, don’t hesitate to use the workaround here provided.
      We will keep this page updated.