Home › Forums › Lite Version › Qtranslate multi-language not working
- This topic has 7 replies, 2 voices, and was last updated 5 years, 9 months ago by
Paul.
- AuthorPosts
petri
GuestHi,
I’m using (m)qtranslate for multi-language websites.
I translated the posts and the excerpts as well. However the posts in the Masonry aren’t displayed in the other languages (only in the first language).Do you have a solution?
Thanks!Masonry Guy
KeymasterHi Petri,
Can you please send me your wp-admin details at info (@) masonrylayout (d0t) com with this thread url ?
Thanks
Paul
GuestAny solution to this?
Masonry Guy
KeymasterHi Paul,
Petri didn’t replied back so i didn’t have any chance to check on this.
Can you please kindly send me your wp-admin details at info (@) masonrylayout (d0t) com with this thread url ?
Thanks
Paul
GuestI am sorry but I am not authorized to share the details. However, I’ve noticed that it has something to do with the ajax loading. Pages/posts loaded don’t get the ?lang=en suffix.
Paul
GuestI’ve just found the solution. Maybe you can implement it in the next update.
In /wp-masonry-layout/includes/client/wml_container.php there is a variable $link = admin_url(‘admin-ajax.php?action=wml_load_posts&shortcodeId=’.$shortcodeId), which always calls default language of admin-ajax.php instead of admin-ajax.php?lang=<current qtranslate> lanaguage.
My Solution:
global $q_config;
$currentWebsiteLanguage = $q_config[‘language’];
$link = admin_url(‘admin-ajax.php?lang=’.$currentWebsiteLanguage.’&action=wml_load_posts&shortcodeId=’.$shortcodeId);Hope it helps.
Masonry Guy
KeymasterHi Paul,
Glad you have fixed it and thank you so much for sharing it here. I will work on this and use it in next release.
Thanks 🙂
Paul
GuestHello again,
I’ve just found another missing component regarding qTranslate, which I fixed. When you change the language the permalinks to posts do not change. The solution:in /wp-masonry-layout/themes/default/layout.php
<?php
global $q_config;
$currentWebsiteLanguage = $q_config[‘language’];
?>And after that modify the links like ?lang=<?php echo $currentWebsiteLanguage; ?>”><?php the_post_thumbnail($shortcodeData[‘wmlo_image_size’]); ?>
- AuthorPosts