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
557 stars 106 forks source link

Translation fails in popular posts widget #768

Open Masikasipa opened 4 years ago

Masikasipa commented 4 years ago

Hi,

I'm experiencing a new problem with the latest version of qTranslate-XT. On one of my pages I use the WP Popular Posts widget in the sidebar. It worked fine until the last WP PP Plugin update – but since then it shows both languages, German and English, side by side in the title.

Example: German title correctly displayed: Anatomie English title correctly displayed: Anatomy Currently displayed title: [:de]Anatomie[:en]Anatomy[:]

It never was a problem with qTranslateX or the older qTranslateXT versions before. The plugin author cannot/does not want to provide any ideas of the problem source. So, any input to solve the issue is really appreciated, thank you.

herrvigg commented 4 years ago

This looks like a regression due to a change in Popular Posts, but maybe there was some good reason behind it.

Is that in the admin section or on the front-end? Is that a read-only or an editable text? Admin and read-only i suppose.

There is no special handling for Popular Posts, so i suppose it was just caught through a generic filter such as translate_text or something like that. Would be good to understand what changed. In any case, it's certainly not worth creating a module, but you will probably have to add a filter somewhere. Then call qtranxf_useCurrentLanguageIfNotFoundShowAvailable for example.

Masikasipa commented 4 years ago

It's appearing on the front-end. You can find it directly in the sidebar when navigating to one of the articles, e.g. https://www.madcham.de/de/lokalform-nosy-hara/ . It's a read-only link, no editable text.

Masikasipa commented 4 years ago

There's a solution to that problem now and it's working perfectly: https://github.com/cabrerahector/wordpress-popular-posts/commit/f6f771a6b68e5440efa96dfccad87dea0fa68550#diff-942af277bbff94fc9cbc374857cddaa5