qtranslate-xt
qtranslate-xt copied to clipboard
Yoast Title and description show both languages (admin)
Hello, not sure if this is the same with https://github.com/qtranslate/qtranslate-xt/issues/850 but I'm seeing this:
Since I upgrated to Yoast 14.8 (and the same remains on 14.8.1)
Is there a solution or should I downgrade until this is fixed? (will it be fixed?)
Thanks.
Hello,
I have same problem in Yoast 14.8.1.
it seems that Yoast 14.9 has somewhat improved the issue, title is good now and the language indicators {en}
don't show in the edit section, the only thing remaining is the preview that is still busted but it doesn't affect the SEO calculation so I guess this is much better now and we don't have to downgrade
See also discussions in #794.
function yoast_seo_qtrans() {
if(defined('WPSEO_VERSION')) {
add_filter('wpseo_metadesc', function($str) {
return __($str);
}, 10, 1);
add_filter('wpseo_opengraph_title', function($str) {
return __($str);
}, 10, 1);
add_filter('wpseo_opengraph_desc', function($str) {
return __($str);
}, 10, 1);
}
}
add_action('init', 'yoast_seo_qtrans', 1, 10);
function wpseo_breadcrumb_add_woo_shop_link($links) {
$newList = array();
foreach($links as $link) {
$link['text'] = __($link['text']);
$newList[] = $link;
}
return $newList;
}
add_filter('wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link');
what are those? do we need to edit the plugin files or these will go to next release?
@netgfx it's a hotfix for Yoast SEO for v14+
you can add it to functions.php
on your theme
I think developers should add it to the next release
@Tusko Thank you this fix my Problem!
It's a bit difficult for me to follow the Yoast topics, this fix seems to solve a few things but we should handle it better.
The first thing, we should not use __( xx )
, this is only meant for static translations of fixed string labels in WordPress (mo/po files). It turns out we have a qTranslate hook linked to this function so you will get a qTranslate call as a bonus, but this is quite an indirect effect. In qTranslate we should use the proper function directly which is qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage
(yes the name is very verbose but this might be renamed in the future).
Now in the Yoast module (which certainly requires a lot of work with the new API) we used to have such filters, but they were commented, certainly because they were obsolete or the names have changed. Please check this part: https://github.com/qtranslate/qtranslate-xt/blob/91c51acbf1e77e7eb818738fd771b867036b2e7d/modules/wp-seo/qwpseo-admin.php#L87-L96
It would be nice to fix this properly in this module. Is that enough to change the edit.php
section? I don't really know! Could someone take a better look and send a PR?
Let's also sync this with #947.
Indeed the admin part is behaving differently with the last versions of Yoast. The title is translated the first time the page is displayed but it changes as soon as the mouse hovers the text (!). This part requires more work with Javascript for sure, i don't know how to deal with this yet and i won't have time for this.
As a reminder the Yoast module is completely rewritten from scratch (#947) after removing the old one (#794). I don't think the old code would help for this part, but maybe. Currently the admin part is almost empty.
As a reminder the Yoast module is completely rewritten from scratch (#947) after removing the old one (#794). I don't think the old code would help for this part, but maybe. Currently the admin part is almost empty.
i've installed the last version with Yoast module, but i see the 2 language in the preview. it occur also in production or only in the admin part ? and also there is a little guide to setup yoast with qtranslate-xt ?
Thanks in advance.
On the latest Qtranslate-xt and latest yoast this is still happening.
On the latest Qtranslate-xt and latest yoast this is still happening.
I have same issue