*

servatics

  • **
  • 9 posts
osc_locale_code()
« on: February 06, 2024, 11:35:50 PM »
Hello, please help, for some reason on some pages does not correctly output the current locale function osc_locale_code(), for example, on the page of ads always outputs En locale, although installed another, on other pages all works correctly. If in the file oc-includes/osclass/controller/item.php remove this code
    $locales = OSCLocale::newInstance()->listAllEnabled();
    $this->_exportVariableToView('locales', $locales);
Then the osc_locale_code() function starts working correctly. Question, what could be the problem and why does this code affect this function? How to fix it? Thank you very much!

*

MB Themes

Re: osc_locale_code()
« Reply #1 on: February 07, 2024, 08:39:41 AM »
it usually means that 'locales' session variable was dropped or replaced by different content.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

servatics

  • **
  • 9 posts
Re: osc_locale_code()
« Reply #2 on: February 07, 2024, 06:09:10 PM »
Thanks, but if I delete that piece of code from item.php, what is the risk to me?

*

MB Themes

Re: osc_locale_code()
« Reply #3 on: February 07, 2024, 07:19:01 PM »
There is no risk to keep it, it's correct and sometimes you need to re-assign values to session.
You might also use osc_get_locales() that is stored in session as well and does not require extra DB call.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots