What’s happening is when you are logged into the website, the language code comes back with the correct language. When logged out of the website, it seems to only come back with the default language (en) when making an AJAX call through WordPress.
AJAX should be detecting the current language even if logged out.
The language parameters are not getting passed to the AJAX request when logged out.
Is there any documentation that you are following?
Documentation for this issue is unclear.
Is there a similar example that we can see?
Visit the link below and click on "Graine" and you will see English results populate. But when logged into the site, French results appear.
We are moving towards enabling this setting by default in future versions of WPML. It was disabled by default due to issues with some caching plugins a while back.
Please do let us know if you have any further issues!