Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hyrvao

Default language set, but still no result.

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

me too.. i got same problem with that

 

i hope this working in my site

 

by the way

 

thanks for this

Share this post


Link to post
Share on other sites

here can you suggest me the full code in php to be implented for the language translater in the site

 

:rolleyes:

monika


Monika

Share this post


Link to post
Share on other sites

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;
    }

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×