Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

default laguage setting doesnt work


thejerk

Recommended Posts

I have 2 languages active in my shop, dutch and english. Have set default to dutch. DB contains tthis default value.

 

But if i call the default catalog page it will give me the english shop.

 

Can anyone give me hints??

 

Txs,

 

Ron

Link to comment
Share on other sites

Thank you for your reply,

 

I did try it, but was unsuccesfull, probably beacause i am not very knowledgable in php......and i can only follow exact descriptions, like replace this line with this one......and i probaly removed to much or to little......

 

If you can help, i would be very happy :D

 

txs

ron

Link to comment
Share on other sites

Basically as it says ... replace the get_browser_language function in "catalog/includes/classes/language.php":

 

    function get_browser_language() {

     $this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE'));



     $size = sizeof($this->browser_languages);

     for ($i=0; $i<$size; $i++) {

       reset($this->languages);

       while (list($key, $value) = each($this->languages)) {

         if ( (eregi('^(' . $value[0] . ')(;q=[0-9].[0-9])?$', $this->browser_languages[$i])) && ($this->catalog_languages[$key]) ) {

           $this->language = $this->catalog_languages[$key];

           break 2;

         }

       }

     }

   }

 

with:

 

function get_browser_language() { 

$this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE')); 



$languages_query = tep_db_query("select configuration_value from configuration where configuration_key='DEFAULT_LANGUAGE'");

$defLan = tep_db_fetch_array($languages_query);

$this->language = $this->catalog_languages[$defLan['configuration_value']]; 

   }

 

Take care!:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...