Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Browsers and default language


Guest

Recommended Posts

I have noticed this:

 

If my browser language is English i have my shop displayed in English not in default language - Latvian

 

If i have my browser in Latvian my shop is displayed in Latvian.

 

 

Is there any solution to open my shop in default language?

Link to comment
Share on other sites

I have noticed this:

 

If my browser language is English i have my shop displayed in English not in default language - Latvian

 

If i have my browser in Latvian my shop is displayed in Latvian.

 

 

Is there any solution to open my shop in default language?

 

 

Remove all others. wink.gif

 

 

The behaviour you've noted is logical, why do you want non-Latvian speakers to see Latvian when they only speak say english huh.gif

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Remove all others. wink.gif

 

 

The behaviour you've noted is logical, why do you want non-Latvian speakers to see Latvian when they only speak say english huh.gif

 

 

Actually i have my shop in 3 languages but i want to be the firs language to Latvian, because most of my clients will be Latvian speaking costumers!

Link to comment
Share on other sites

Actually i have my shop in 3 languages but i want to be the firs language to Latvian, because most of my clients will be Latvian speaking costumers!

 

I guess that in this case they'll have their browsers also in latvian, so no problem, not?

Link to comment
Share on other sites

I guess that in this case they'll have their browsers also in latvian, so no problem, not?

 

 

found a solution in forum:

 

 

need to comment out this line:

 

$lng->get_browser_language();

 

in cataloge/include/aplication_top.php

 

 

only question is it correct to do this?

Link to comment
Share on other sites

osC does try to find out the browser's language setting, and use that as the preferred language. I've only glanced at the code, but in application_top.php, it looks like it first sets the preferred language as your default (Latvian, in the language constructor), and then sees if the browser has indicated a preferred language (English, in get_browser_language()). If so, it looks like it overrides the default setting.

 

If your customers have their browsers set to use Latvian, rather than English, then Latvian should be used. If their browsers are English, it will override your store setting. I suppose that if you want to force Latvian (ignore the browser setting), you could just

$lng = new 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();
   }
*/

in the application_top.php files.

Link to comment
Share on other sites

osC does try to find out the browser's language setting, and use that as the preferred language. I've only glanced at the code, but in application_top.php, it looks like it first sets the preferred language as your default (Latvian, in the language constructor), and then sees if the browser has indicated a preferred language (English, in get_browser_language()). If so, it looks like it overrides the default setting.

 

If your customers have their browsers set to use Latvian, rather than English, then Latvian should be used. If their browsers are English, it will override your store setting. I suppose that if you want to force Latvian (ignore the browser setting), you could just

$lng = new 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();
   }
*/

in the application_top.php files.

 

Thanks!

Link to comment
Share on other sites

 

$lng = new 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();
   }
*/

 

The only trouble with that change is though you'll force visitors to your default language, your also stopping them selecting another in the store, it will stay permanently on default!! ($HTTP_GET_VARS['language']) is reading the visitor selected lang

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Would this be better?

$lng = new 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();
*/
   }

Presumably that should ignore the browser's language setting.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...