mqtranslate: line breaks get turned into paragraphs in visual editor

UPDATE: This seems to not work anymore. See Comments…

As the qtranslate plugin doesn’t seem to be updated anymore, i switched to mqtranslate, which is a fork of qtranslate but compatible to newer versions of WordPress.

Unfortunately, with WordPress Version 4, mqtranslate seems to have some problems with the visual editor. One particularly bizarre one encountered to me yesterday:

Working in the visual editor, single line breaks (<br />) are turned into paragraphs (<p>). Looking into the mqtranslate_javascript.php file, i found a (for now) working fix:

Step 1: Open the mqtranslate_javascript.php file in a text-editor.
Step 2: Find Line 292, which should read like this:
jQuery('#qtrans_textarea_content').val(switchEditors.wpautop(jQuery('#qtrans_textarea_content').val()))
Step 3: Comment this line out with 2 slashes (/), so that it reads like this:
//jQuery('#qtrans_textarea_content').val(switchEditors.wpautop(jQuery('#qtrans_textarea_content').val()))
Step 4: Save the file and upload it again to your mqtranslate plugin folder
Step 5: Done! The visual editor should work correctly again.

Please let me know if i could help you or if other problems occur after you applied the fix.

Happy Coding,
Kuchenundkakao

2 Gedanken zu „mqtranslate: line breaks get turned into paragraphs in visual editor

  1. Hallo! Nachdem ich die Zeile auskommentiert habe, sehe ich überhaupt keine Zeilenumbrüche mehr, also auch keine … Das Problem ist nur im englischen visuellen Editor, im deutschen passt es mit den Umbrüchen… Danke und herzliche Grüße!

    • Hmm… vielleicht passierte es nur mit einer konkreten Version von mqtranslate…Hab ein Update eingefügt.
      Das was du beschreibst, scheint aber ein anderes problem zu sein…

Hinterlasse einen Kommentar