qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
554 stars 105 forks source link

Content area not translating with WP 5.6 #931

Closed gab1982 closed 3 years ago

gab1982 commented 3 years ago

I really enjoy using this plugin, and have used it on many sites, however am having an issue with a fresh install of wordpress (5.6) and also qtranslate xt (3.9.1) and found the content area isn't translating, only the title, i have tried removing qtranslate and re-installing but no luck, all other plugins are de-activated but still no luck is anyone else having the same issue? I also installed 'Enable jQuery Migrate Helper' but that didn't help in anyway. There are also no errors or reports in the console.

nalato commented 3 years ago

I have the same problem. I downgraded with previous Wordpress version. Thanks.

gab1982 commented 3 years ago

I have the same problem. I downgraded with previous Wordpress version. Thanks.

Thanks Nalato, I downgraded to 5.5.3 but still am getting the same issue.

herrvigg commented 3 years ago

You mean the content area of a post/page in the admin section?

I use WP5.6, no problem. If you downgraded to 5.5.3 and still see the same problem that's a good indication it doesn't come from the WP version. @nalato does it work after downgrading? To which version?

If you have disabled all plugins and see no error in the console it's really hard to understand. What browser are you using?

gab1982 commented 3 years ago

You mean the content area of a post/page in the admin section?

I use WP5.6, no problem. If you downgraded to 5.5.3 and still see the same problem that's a good indication it doesn't come from the WP version. @nalato does it work after downgrading? To which version?

If you have disabled all plugins and see no error in the console it's really hard to understand. What browser are you using?

so i managed to get it working, i disabled all my plugins again only keeping qtranslate-xt, i am unsure why this seemed to resolve the issue but for now its ok using 5.5.3

herrvigg commented 3 years ago

Is this about the admin section or the frontend? Note for the frontend there is no Javascript involved.

I use WP 5.6 on a production website and local installation, with other plugins, no problem at all.

Could you send me the info you have in languages / troubleshooting?

nalato commented 3 years ago

Hello, I confirm that @gab1982 says: Wordpress 5.6 with Twenty Twenty theme and Classic Editor plugin enabled, doesn't translate post content in the admin section. The frontend works fine. Screenshot_2020-12-30 Edit Page ‹ Sinton — WordPress(1) { "PHP_VERSION": "7.4.10", "WP_VERSION": "5.6", "QTX_VERSION": "3.9.1", "Plugins": [ "Classic Editor 1.6", "qTranslate-XT 3.9.1" ] } { "default_language": "en", "enabled_languages": [ "en", "it" ], "flag_location": "plugins/qtranslate-xt/flags/", "language_name": { "en": "English", "it": "Italiano" }, "locale": { "en": "en_US", "it": "it_IT" }, "locale_html": { "en": "", "it": "" }, "not_available": { "en": "Sorry, this entry is only available in %LANG:, : and %.", "it": "Ci spiace, ma questo articolo è disponibile soltanto in %LANG:, : e %." }, "date_format": { "en": "%A %B %e%q, %Y", "it": "%e %B %Y" }, "time_format": { "en": "%I:%M %p", "it": "%H:%M" }, "flag": { "en": "gb.png", "it": "it.png" }, "url_mode": 2, "use_strftime": 3, "filter_options_mode": 0, "language_name_case": 0, "detect_browser_language": true, "hide_untranslated": false, "show_displayed_language_prefix": true, "show_alternative_content": false, "hide_default_language": true, "use_secure_cookie": false, "header_css_on": true, "header_css": ".qtranxs_flag_en {background-image: url(https://www.nalato.com/beta2/wp-content/plugins/qtranslate-xt/flags/gb.png); background-repeat: no-repeat;}\n.qtranxs_flag_it {background-image: url(https://www.nalato.com/beta2/wp-content/plugins/qtranslate-xt/flags/it.png); background-repeat: no-repeat;}\n", "text_field_filters": [], "term_name": [], "disable_client_cookies": false, "ignore_file_types": [ "gif", "jpg", "jpeg", "png", "svg", "pdf", "swf", "tif", "rar", "zip", "7z", "mpg", "divx", "mpeg", "avi", "css", "js", "mp3", "mp4", "apk" ], "url_info": { "cookie_lang_front": "it", "cookie_lang_admin": "en", "cookie_front_or_admin_found": true, "scheme": "https", "host": "www.nalato.com", "path": "/beta2/wp-admin/admin-ajax.php", "query": "action=admin_debug_info", "path-base": "/beta2", "wp-path": "/wp-admin/admin-ajax.php", "language_neutral_path": true, "http_referer": "https://www.nalato.com/beta2/wp-admin/options-general.php?page=qtranslate-xt", "referer_admin": true, "doing_front_end": false, "lang_cookie_admin": "en", "lang_admin": "en", "language": "en", "set_cookie": false }, "language": "en", "editor_mode": 0, "highlight_mode": 1, "auto_update_mo": true, "hide_lsb_copy_content": false, "lsb_style": "Simple_Buttons.css", "config_files": [ "./i18n-config.json" ], "custom_i18n_config": [], "custom_fields": [], "custom_field_classes": [], "post_type_excluded": [], "translator": {}, "qtrans_compatibility": false }

{ "cookies": [], "navigator": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" }

@herrvigg , if you want, i give you a test website access.

gab1982 commented 3 years ago

Is this about the admin section or the frontend? Note for the frontend there is no Javascript involved.

I use WP 5.6 on a production website and local installation, with other plugins, no problem at all.

Could you send me the info you have in languages / troubleshooting?

it was from the admin in the content area, i enabled only english and spanish for languages, the troubleshooting i did was disabled all plugins, installed 'Enable jQuery Migrate Helper' which didn't help, then later disabled it when you responded, the front-end is totally fine. Not sure how i can give you a report as the above comment did?

herrvigg commented 3 years ago

@nalato thanks, your config looks pretty much standard, except path-base = /beta2 but this should work the same. Also the set_cookie = false which i don't think works so well, but this should not explain this issue. The test website could help, but let's see first with the other config here, we may find a pattern.

@gab1982 you can find it in settings / languages (qTranslate-XT configuration) / troubleshooting, it would be interesting to compare. Are you using a theme like Twenty Twenty?

gab1982 commented 3 years ago

@nalato thanks, your config looks pretty much standard, except path-base = /beta2 but this should work the same. Also the set_cookie = false which i don't think works so well, but this should not explain this issue. The test website could help, but let's see first with the other config here, we may find a pattern.

@gab1982 you can find it in settings / languages (qTranslate-XT configuration) / troubleshooting, it would be interesting to compare. Are you using a theme like Twenty Twenty?

OK, yes im using a theme like twenty twenty which i know is old but i did try and change to the latest default theme and there was no change.

here is my output:

{ "PHP_VERSION": "7.3.20", "WP_VERSION": "5.5.3", "QTX_VERSION": "3.9.1", "Plugins": [ "Advanced Custom Fields: Font Awesome 3.1.1", "Advanced Custom Fields PRO 5.9.3", "Coming Soon Page, Maintenance Mode & Landing Pages by SeedProd 6.0.9.0", "GDPR Cookie Consent 1.9.5", "Formidable Geolocation 1.4.2", "Formidable MailChimp 2.05", "Formidable Forms Pro 4.09.02", "Formidable Forms 4.09.02", "WPBakery Page Builder 6.5.0", "qTranslate-XT 3.9.1" ] }

{ "default_language": "en", "enabled_languages": { "0": "en", "2": "es" }, "flag_location": "plugins/qtranslate-xt-master/flags/", "language_name": { "en": "EN", "es": "ES" }, "locale": { "en": "en_US", "es": "es_ES" }, "locale_html": { "en": "", "es": "" }, "not_available": { "en": "Sorry, this entry is only available in %LANG:, : and %.", "es": "Disculpa, pero esta entrada está disponible sólo en %LANG:, : y %." }, "date_format": { "en": "%A %B %e%q, %Y", "es": "%d \d\e %B \d\e %Y" }, "time_format": { "en": "%I:%M %p", "es": "%H:%M hrs." }, "flag": { "en": "gb.png", "es": "es.png" }, "url_mode": 2, "use_strftime": 3, "filter_options_mode": 0, "language_name_case": 0, "detect_browser_language": false, "hide_untranslated": false, "show_displayed_language_prefix": true, "show_alternative_content": false, "hide_default_language": true, "use_secure_cookie": false, "header_css_on": true, "header_css": ".qtranxs_flag_en {background-image: url(https://www.gandtestates.com/wp-content/plugins/qtranslate-xt-master/flags/gb.png); background-repeat: no-repeat;}\n.qtranxs_flag_es {background-image: url(https://www.gandtestates.com/wp-content/plugins/qtranslate-xt-master/flags/es.png); background-repeat: no-repeat;}\n", "text_field_filters": [], "term_name": { "London": { "en": "London", "es": "London", "fr": "London", "de": "London", "nl": "London", "ru": "London", "pl": "London", "sv": "London", "da": "London", "no": "London" }, "Florida": { "en": "Florida", "es": "Florida", "fr": "Florida", "de": "Florida", "nl": "Florida", "ru": "Florida", "pl": "Florida", "sv": "Florida", "da": "Florida", "no": "Florida" }, "Rome": { "en": "Rome", "es": "Rome", "fr": "Rome", "de": "Rome", "nl": "Rome", "ru": "Rome", "pl": "Rome", "sv": "Rome", "da": "Rome", "no": "Rome" }, "Bangkok": { "en": "Bangkok", "es": "Bangkok", "fr": "Bangkok", "de": "Bangkok", "nl": "Bangkok", "ru": "Bangkok", "pl": "Bangkok", "sv": "Bangkok", "da": "Bangkok", "no": "Bangkok" }, "Paris": { "en": "Paris", "es": "Paris", "fr": "Paris", "de": "Paris", "nl": "Paris", "ru": "Paris", "pl": "Paris", "sv": "Paris", "da": "Paris", "no": "Paris" }, "Berlin": { "en": "Berlin", "es": "Berlin", "fr": "Berlin", "de": "Berlin", "nl": "Berlin", "ru": "Berlin", "pl": "Berlin", "sv": "Berlin", "da": "Berlin", "no": "Berlin" }, "Sydney": { "en": "Sydney", "es": "Sydney", "fr": "Sydney", "de": "Sydney", "nl": "Sydney", "ru": "Sydney", "pl": "Sydney", "sv": "Sydney", "da": "Sydney", "no": "Sydney" }, "Marbella": { "en": "Marbella", "es": "Marbella" }, "Featured": { "en": "Featured", "es": "Featured" }, "Is Development": { "en": "Is Development", "es": "Is Development" }, "USA": { "en": "USA", "es": "USA" }, "Barcelona": { "en": "Barcelona", "fr": "Barcelona", "es": "Barcelona", "de": "Barcelona", "nl": "Barcelona", "ru": "Barcelona", "pl": "Barcelona", "sv": "Barcelona", "da": "Barcelona", "no": "Barcelona" }, "new": { "en": "new", "fr": "", "es": "", "de": "", "nl": "", "ru": "", "pl": "", "sv": "", "da": "", "no": "" }, "Spain": { "en": "Spain", "fr": "Spain", "es": "Spain", "de": "Spain", "nl": "Spain", "ru": "Spain", "pl": "Spain", "sv": "Spain", "da": "Spain", "no": "Spain" }, "Thailand": { "en": "Thailand", "fr": "Thailand", "es": "Thailand", "de": "Thailand", "nl": "Thailand", "ru": "Thailand", "pl": "Thailand", "sv": "Thailand", "da": "Thailand", "no": "Thailand" }, "Page": { "en": "Page", "fr": "", "es": "", "de": "", "nl": "", "ru": "", "pl": "", "sv": "", "da": "", "no": "" }, "Apartment": { "en": "Apartment", "es": "Apartamento" }, "Townhouse": { "en": "Townhouse", "es": "Adosada" }, "Finca/Country House": { "en": "Finca/Country House", "es": "Finca / Casa de campo" }, "Sale": { "en": "Sale", "es": "Sale" } }, "disable_client_cookies": false, "ignore_file_types": [ "gif", "jpg", "jpeg", "png", "svg", "pdf", "swf", "tif", "rar", "zip", "7z", "mpg", "divx", "mpeg", "avi", "css", "js", "mp3", "mp4", "apk" ], "url_info": { "cookie_lang_front": "en", "cookie_lang_admin": "en", "cookie_front_or_admin_found": true, "scheme": "https", "host": "www.gandtestates.com", "path": "/wp-admin/admin-ajax.php", "query": "action=admin_debug_info", "path-base": "", "wp-path": "/wp-admin/admin-ajax.php", "language_neutral_path": true, "http_referer": "https://www.gandtestates.com/wp-admin/options-general.php?page=qtranslate-xt", "referer_admin": true, "doing_front_end": false, "lang_cookie_admin": "en", "lang_admin": "en", "language": "en", "set_cookie": false }, "language": "en", "editor_mode": 0, "highlight_mode": 1, "auto_update_mo": true, "hide_lsb_copy_content": false, "lsb_style": "Simple_Buttons.css", "config_files": [ "./i18n-config.json", "plugins/wp-seo-qtranslate-x/i18n-config.json" ], "custom_i18n_config": [], "custom_fields": [], "custom_field_classes": [], "post_type_excluded": [], "translator": {}, "qtrans_compatibility": false }

{ "cookies": [], "navigator": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:84.0) Gecko/20100101 Firefox/84.0" }

herrvigg commented 3 years ago

I tried with a Firefox and Theme Twenty Twenty, no problem...

Ignore what i wrote about set_cookie = false, i made a confusion with disable_client_cookies which is false everywhere (also for me).

I can only spot an error with react-dom (i have some dev tools installed) but this doesn't affect the functionality of qTranslate.

So i don't really see. @nalato the test website could help indeed. You can send the credentials to herrvigg (at) gmail.com.

nalato commented 3 years ago

@herrvigg I sended you the credentials by Wordpress. Thanks

herrvigg commented 3 years ago

@nalato thanks, i managed to reproduce it on your website but it was not straightforward:

Quite weird, but if i switch to Text mode, it works again. Also, the problem does not happen with Chrome...

herrvigg commented 3 years ago

I manage to reproduce on my localhost as well. It happens only in Visual Mode + Firefox.

As workaround you can try this but if you switch to Text mode or Chrome the problem should disappear. I can't explain it yet.

nalato commented 3 years ago

Ok I try it. Thanks @herrvigg

herrvigg commented 3 years ago

I'm starting to nail the problem down. The issue occurs when the load event is not triggered on the window, preventing setEditorHooks to be called and initializing TinyMCE properly.

It could be a bug with Firefox but it seems to be also related to WP 5.6. I found this ticket in WP: https://wordpress.org/support/topic/edit-post-page-broken-after-update-to-wp-5-6/

herrvigg commented 3 years ago

New issue created on WP / Classic Editor: https://wordpress.org/support/topic/edit-post-page-broken-after-update-to-wp-5-6-2/

It doesn't move much...

herrvigg commented 3 years ago

It seems there are many other related issues that are in WP trac:

A fix is apparently on the way, but i don't know if this solves our issue yet. Seems quite related but not entirely sure. Let's hope so.

herrvigg commented 3 years ago

It's possible this is going to be fixed in WP 5.6.1 https://core.trac.wordpress.org/ticket/52111#comment:15 Or maybe 5.7 (not sure about the release versions here): https://wordpress.org/support/topic/edit-post-page-broken-after-update-to-wp-5-6-2/#post-13878107

If some people are able to validate that fix, it could surely help them to push this forward.

herrvigg commented 3 years ago

Apparently the fix is postponed to WP 5.6.2 😕 https://core.trac.wordpress.org/ticket/52111#comment:17

simon418 commented 3 years ago

I have exactly the same problem :( I am using Classic Editor and the newest WordPress 5.6.2. If i click "Update" after editing a post, and the "visual" mode in Classic editor is active, the [en:] language brackets appear. It only works if i click update while i am in "text" mode.

Anyways, thank you very much for keeping qtranslate alive!

Edit: I am using Chrome, so i think its not an Firefox issue

gab1982 commented 3 years ago

Is there anything I can do in regards to getting the editor to work as expected because one of my projects which uses your plugin is awaiting this issue to be fixed (what version of wordpress and qtranslate do i need to downgrade to in order to resolve this issue)?

herrvigg commented 3 years ago

I don't think this is a problem in qTranslate, so there's no much we can do here. You can help the WP team by providing more information on their tickets and helping to validate the fixes. They have been asking for people.

I believe this regression came with WP 5.6. So you can try to downgrade WP 5.5.x, maybe that solves the problem temporarily.

herrvigg commented 3 years ago

Did someone else encounter the problem on a browser other than Firefox?

The issue is still present in WP 5.6.2: https://core.trac.wordpress.org/ticket/52111#comment:23

From that thread, it seems the jQuery Migration Helper could be a temporary solution: https://wordpress.org/plugins/enable-jquery-migrate-helper/

Could someone else try this?

herrvigg commented 3 years ago

I pushed a patch after discussions in #946. It may solve most of the cases with the editor in Text mode or if you switch from Text to Visual Mode. However it seems there's still a problem if the editor is opened in Visual Mode when the page loads.

herrvigg commented 3 years ago

The patch on master should solve most of the problems. What is left seems to happen only in very specific situations. A big thank you to @MK-RD who helped a lot to understand the problem and find a solution. I encourage everyone here to try with the current version from master, I'd like to release this soon.

herrvigg commented 3 years ago

Please can some of you retry with the last version on master? I pushed new fixes (#946) and done some refactoring (#978). The new code is expected to be much more stable now.

herrvigg commented 3 years ago

Released in 3.9.3.