This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:

Posts are shown in their language when the site is viewed in desktop browsers, but when in mobile, the posts are shown in Spanish no matter what language I select.

Solution:

Since your theme uses ajax to load the content, the problem was the following. The option 'Store a language cookie to support language filtering for AJAX' was not enabled in WPML -> Languages -> Language filtering for AJAX operations. I've now enabled it, and the English posts are showing on the desktop as well as the mobile view of your site.

Relevant Documentation:

https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Enrique Fornes 1 month, 2 weeks ago.

Assigned support staff: Itamar.

Author Posts
August 20, 2019 at 8:50 am

Enrique Fornes

Hi.

My site is working as expected except for posts shown in mobile. My site is both english and spanish. Posts are shown in their language when the site is viewed in desktop browsers (see attachment1), but when in mobile, the posts are shown in spanish no matter what language I select. (see attachment2). Page title is correctly shown in english, if that helps you.

I have cleared cache, so that's not the problem.

Any help?

thanks a lot!

August 20, 2019 at 10:27 am
August 22, 2019 at 9:06 am #4437717

Enrique Fornes

Hi. I received an answer by email. I can't see it here (why?). Shall I follow this topic to further assistance?

thanks

August 22, 2019 at 9:20 am #4437873

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Yes, since there was no reply from you or maybe something happened with an internet connection, I moved the chat to be a regular ticket. You should be able to see all of our chat correspondence in the private message here above. Please follow my suggestions and reply here if you need more help.

Regards,
Itamar.

August 22, 2019 at 9:53 am #4438179

Enrique Fornes

Hi Itamar. I have to say this support ticket is being a bit mess... I couldn't find it ion my control panel and your answer is not included in the private message....

Anyways, I appreciate your help a lot!.

First of all: I don't want to update to WP 5.2. I have done it in the past and all I got was more troubles: php updates, mysql updates, theme updates (not always availabkle, etc).

So, I hope wp is not the issue.

Secondly... I have installed translation manager, but I don't get why. Another way to translate? Can I disable that?

Third: I have increased wp memory as you explained: nothing changes.

Fourth. There might be a simple reason why englishs posts (my default is spanish) are not shown: Not all the posts has a translation. I remember seeing a setting where I can set not translated post to be ignored (I prefer not to show nothing rather than showing something in spanish to english audience)... but I can't find this setting anymore. IN all the tutorials I hjave seen, the setting is supposedly located under languages, but not ion my wpml. So, I would start from this point!. Maybe my customer is taking too long to translate posts and he is blaming on me, while actually, as I am showing the latest 6, those latest 6 do not exist in english... I have looked into posts and it seems the latest 6 are not translated.. yet.

So, where's that setting?!

Thanks a lot

August 24, 2019 at 7:14 pm #4452187

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

I think that the settings that you are looking for are on WPML -> Settings -> Post Types Translation. Look for the settings for 'Posts'. It needs to be set to 'Translatable - only show translated items'. But when I look at your site, I think that 'Posts' are already set to 'Translatable - only show translated items'. Please see the attached screenshot entradas-translate-only.jpg.

Since the issue only happens on mobile view, I suspect that we might be looking here on a cache issue. You are using the 'W3 Total Cache' plugin. Please clear all the cache from your site and deactivate any cache plugin or method.

If the above does not help, please try the minimum environment procedure. I suspect that there is a collision with the theme or another plugin that might cause this problem. Minimum environment means switching to a default WordPress theme like TwentyNineteen and no plugins activated except WPML. You will need first to check if the problem persists when just the theme is switched to TwentyNineteen (for example). If it persists then deactivate all plugins except the WPML and its add-ons. Then please check if the problem persists. If it does not persist, so start by activating the plugins one by one and check when the problem comes back, then report to me which was the culprit plugin.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****


*** If your site is a live site you might want first to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***

Also, you wrote: "Secondly... I have installed translation manager, but I don't get why. Another way to translate? Can I disable that?"
If you didn't use the Translation Management add-on on your site before, you don't need to use it.

I'm sorry for the inconvenience that you had with this thread. For your information, while on chat, the correspondence between us is private. But when the chat is turned into a regular ticket, the replies are public. When it is needed to share private or sensitive information, I, as a supporter, can enable a private message.

Regards,
Itamar.

August 29, 2019 at 6:15 pm #4482971

Enrique Fornes

Hi Itamar.

Sorry for my late response. I'm back from holidays and I have a pile of tasks to be done...

so, back to this: I mentioned the issue was on mobile, since it worked on my desktop, but your colleague said he could not see english post either in desktop, which is now the situation as I am not able either to see the post in english in my desktop... very weird!. So, I should change the ticket title (to help others)

re post setting.. thanks! I found it and it was set as it should, so that's not the problem...

I'm replicating the site in my local server, which has nothing to do with the hoster I use: I use a newer php version, newer mysql, etc.. let's see how it affects. I'll keep you posted!

Thanks a lot...

PS. I have noticed posts are shown correctly in english when I'm on desktop and inside worpress control panel... just in case it gives you a hint of what's going on.

September 1, 2019 at 6:04 pm #4492925

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi and thanks for trying my suggestions.

I'll wait for your reply here.

September 1, 2019 at 9:51 pm #4493387

Enrique Fornes

Hi Itamar.

on local server, the issue is also there...

I have btw talked to the hoster and I have updated site's php from 5.6 to 7.2. The issue is not gone.

You have to know what the issue can be... before I change to wordpress 5.2, can you please have a look at my site.. I think you still have access

thanks

September 2, 2019 at 11:51 am #4496647

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

Since your theme uses ajax to load the content the problem was the following. The option 'Store a language cookie to support language filtering for AJAX' was not enabled in WPML -> Languages -> Language filtering for AJAX operations. Please see the attached screenshot option-ajax-not-enab.jpg. I've now enabled it and the English posts are showing on the desktop as well as the mobile view of your site. Please see the attached screenshots.

Can you please confirm that the issue is solved now?

Thanks,
Itamar.

September 2, 2019 at 2:49 pm #4497955

Enrique Fornes

My issue is resolved now. For those with similar problem, please check AJAX behavior settings!

Thank you!