Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Default language set, but still no result.


Hyrvao

Recommended Posts

My problem is that I set swedish language as default, but when I come into the site.. it's still english, no idea why.

I've changed the swedish and it works fine so I don't really see where the problem is.

 

Is there any other place I must change also? I've set currencies to swedish as default.

 

Thanks

Hyrvao

Link to comment
Share on other sites

My problem is that I set swedish language as default, but when I come into the site.. it's still english, no idea why.

I've changed the swedish and it works fine so I don't really see where the problem is.

 

Is there any other place I must change also? I've set currencies to swedish as default.

 

Thanks

Hyrvao

 

Hi Hyrvao

 

Do one thing.. clode the window/browser refresh the session and try again.. i think it will work then.. cos the language is stored in the session variables i think you will need to recreate the session for the default language to chip in.

 

Hari

Link to comment
Share on other sites

  • 1 month later...

Ive been trying to find the same solution for days

 

Im not really sure what the default language setting is for because application_top.php tells it to get the browser language

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
  $lng->set_language($HTTP_GET_VARS['language']);
} else {
  $lng->get_browser_language();
}

 

So oyu need to change that code so it doesnt use the browser language but instead use the default language

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
  $lng->set_language($HTTP_GET_VARS['language']);
} else {
  //$lng->get_browser_language();
  $languages_query = tep_db_query("select configuration_value from configuration where configuration_key='DEFAULT_LANGUAGE'");
  $defLan = tep_db_fetch_array($languages_query);
  $lng->set_language("$defLan");
}

 

Worked for me,

Hope it helps you out.

Link to comment
Share on other sites

  • 2 months later...
Ive been trying to find the same solution for days

 

Im not really sure what the default language setting is for because application_top.php tells it to get the browser language

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
   $lng->set_language($HTTP_GET_VARS['language']);
 } else {
   $lng->get_browser_language();
 }

 

So oyu need to change that code so it doesnt use the browser language but instead use the default language

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
   $lng->set_language($HTTP_GET_VARS['language']);
 } else {
   //$lng->get_browser_language();
   $languages_query = tep_db_query("select configuration_value from configuration where configuration_key='DEFAULT_LANGUAGE'");
   $defLan = tep_db_fetch_array($languages_query);
   $lng->set_language("$defLan");
 }

 

Worked for me,

Hope it helps you out.

 

Yep, I had the same problem, and this solution works for me. Thanks birddogsgarage!

Link to comment
Share on other sites

  • 4 weeks later...

This worked for me so well it sped up my server 3x. It is amazing how much faster it is now. I only realized this because I went through my /var/logs/httpd/error_log looking for other things.

 

Nice fix,

 

Mevdev

Link to comment
Share on other sites

  • 8 months later...
  • 2 weeks later...
  • 9 years later...

You do not need to retrieve the configuration constant "DEFAULT_LANGUAGE" by sql query. It is directly available and defined at this point in application_top.php.

Just do this:

    if (isset($_GET['language']) && tep_not_null($_GET['language'])) {
      $lng->set_language($_GET['language']);
    } else {
      $lng->DEFAULT_LANGUAGE;
    }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...