*

Wiz

  • ****
  • 148 posts
Restricting search keywords in the set preferred language
« on: August 28, 2022, 01:31:46 PM »
Hello,

I noticed that search keywords entered in languages other than English (site lang preference set to Arabic, Russian, etc.) are appearing under English while search keywords entered in Chinese do not appear in English or other set site languages.

I believe search keywords entered in different languages should only appear under the respective set languages of the site as having keywords from different languages appearing under another totally different language pollutes the frequently searched keywords list.

How can this be fixed?

Cheers
Wiz

*

MB Themes

Re: Restricting search keywords in the set preferred language
« Reply #1 on: August 29, 2022, 02:49:27 PM »
That is kind of issue, latest searches does not store locale of user.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Wiz

  • ****
  • 148 posts
Re: Restricting search keywords in the set preferred language
« Reply #2 on: August 29, 2022, 03:10:08 PM »
We don’t need to store locale of user.

Instead, filter the array of displayed latest searches using any language detection script and active site locale which can be derived in several ways (ie. osc locale functions - osc_current_user_locale / osc_current_user_locale_is_rtl) without linking it to a user or active session.

This is only required on the homepage, can be cached and won’t impact paint or page load times

Edited: removed meta reference and added actual functions
« Last Edit: August 29, 2022, 04:30:52 PM by Wiz »