Skip Navigation

[Resolved] Ajax pagination not showing the current WPML language after pagination action

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

Problem:
The problem is that when you are at the site in french, without being logged in as a user, and you click on any element of the pagination (any number or arrow) the content changes to english language while it should remain in french. If you do the same being logged in it works just fine.

The "Next" word thing I told you was just for you to see that the language is changing to english. The word appears in french at the first time, but when you paginate it turns into english while it should not do this. The same thing happens with the content.

Solution:
you will need to enable the option of WPML setting:
Dashboard-> WPML-> Languages
enable option "Language filtering for AJAX operations", and test again.

Relevant Documentation:

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.58 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by toniL 6 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#595671
Captura de pantalla 2017-12-04 a les 16.23.25.png
Captura de pantalla 2017-12-04 a les 16.23.37.png

I am trying to: Paginate content in a secondary language, I'm using WPML, without language being changed to default one when any page number or prev or next button is clicked.

Link to a page where the issue can be seen:hidden link and hidden link

I expected to see: The content in the same language, french, after paginating.

Instead, I got: The content in the default language, english.

#595807

Dear toniL,

I can login your website with the credentials you provided, you mentioned two problem URL, let's handle them one by one:
1) hidden link
There are pagination links at the bottom of this page, click one of them, I see it outputs items in french version, could you point out which is not in French language, see screenshot fr2.JPG
But some of the post has not been translated completed, for example this one:
hidden link
It is a French version post, but the post excerpt is still in English.

2) hidden link
There are three views in it, same as above 1) it does output the french version results, for example you can edit any one of those three view, in section "Loop Output Editor", output the post link [wpv-post-link] directly, you will see the result is something like this:

<a href="<em><u>hidden link</u></em>">Official Statement by Mr. Fathallah Sijilmassi, UfM Secretary General – 22nd session of the Conference of the Parties (COP 22) to the UNFCCC</a>

It is a French version post, but you did not translate it into French:
hidden link

#596070

Hello Luo,

I made a two videos for you, so you can understand the problem:
hidden link
hidden link

You'll see even the word "Suivant" at the end of the pagination becomes a "Next" when you paginate.

Do you have any doubt on what is happenning?

Thanks!,

#596125

Thanks for the details, I can see the problem in your website, in case it is other compatibility problem in your website, please try this:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, I need to test and debug it in my localhost, thanks

#596282
#596564

As I mentioned above we need to check if it is a compatibility problem, so it is needed to deactivate other plugins and switch to wordpress default theme.

And I checked again in your website, in the active plugin page:
hidden link
You are using some outdated plugins, especially Views plugin and WPML plugins, I suggest you try to update those plugins to the latest version, and test again.

And if the problem still persists, please provide a copy of your website, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
You can put the duplicator package into your own google drive disk, and share the link in the private detail box.

#597652
#597919

Thanks for the details, here are what I found in your website:
1) in the problem page
hidden link

There are three view in it, we use the third one "Publications-Speeches-List" as the example:
hidden link

2) in the view "Publications-Speeches-List", section "Filter Editor", change the codes from:

[wpv-pagination][wpv-pager-next-page][wpml-string context="wpv-views"]Next <i class="elg-arrow_carrot-2right"></i> [/wpml-string][/wpv-pager-next-page][wpv-pager-nav-links][wpv-pager-prev-page][wpml-string context="wpv-views"]<i class="elg-arrow_carrot-2left"></i> Previous[/wpml-string][/wpv-pager-prev-page][/wpv-pagination]

To:

[wpv-pagination][wpv-pager-next-page][wpml-string context="wpv-views"]Next[/wpml-string] <i class="elg-arrow_carrot-2right"></i> [/wpv-pager-next-page][wpv-pager-nav-links][wpv-pager-prev-page]<i class="elg-arrow_carrot-2left"></i> [wpml-string context="wpv-views"]Previous[/wpml-string][/wpv-pager-prev-page][/wpv-pagination]

To simplify the problem, we move the HTML tag <i ...>... outside the [wpml-string ...] shortcode

3) Dashboard-> WPML-> String translation:
option "domain" choose "wpv-views", and search text "Next", you will be able to translate text "Next"
hidden link
Same above you can translate text "Previous" here:
hidden link

Then test it in front-end:
hidden link

You can see it has been translated both text of third view have been translated.

#598001

Hello,

I think you are not understanding the problem. We already know how to translate everything, the problem is that when you are at the site in french, without being logged in as a user, and you click on any element of the pagination (any number or arrow) the content changes to english language while it should remain in french. If you do the same being logged in it works just fine.

The "Next" word thing I told you was just for you to see that the language is changing to english. The word appears in french at the first time, but when you paginate it turns into english while it should not do this. The same thing happens with the content.

Please re-read my previous messages if you still don't understand the problem or ask me anything you want and I'll try to explain myself better.

Thanks

#598025

Thanks for the details, I can duplicate same problem in my localhost, and escalated this thread to our 2nd tier supporters, I will feedback if there is anything news

#598055

Here is the feedback, you will need to enable the option of WPML setting:
Dashboard-> WPML-> Languages
enable option "Language filtering for AJAX operations", and test again.

I just tested it in your test site, it works fine, please try again.

#598607

Great!
We really didn't think it would be a disabled option problem this time, but you guys have options for everything! 🙂
Thanks!