Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deafult language in various browsers


gregy

Recommended Posts

Hi!

 

i don't find myself newbie in OScommerce anymore (in signature all contributions are working :) ) but default language gives me headache.

 

First what i found out ... When i installed Firefox (Mozillla) and point it to my shop, it shows shop in English language ... when i look the same shop in IE it shows Slovenian language, which is set to deafult in configuration.

 

Now some users (Firefox) claim that they see slovenian language on first visit, some claim that they see english language on first visit. What to do ...

 

Configuration is definitely set to Slovenian as default language. Now i'm not sure about cookie things .. even if i delete all cookies, and history, and temporary files in IE, i receive site in slovenian, when i do the same with firefox, i receive site in English .. could be some kind of browser error .. did you experienced this.

 

Please visit www.vstopnice.com and tell me which language have you received and what browser do you use .. i'm stucked .. don't know what to do anymore.

 

thank you very much in advance for your cooperation and help.

Link to comment
Share on other sites

Greetings:

 

Using...

 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

 

I'm seeing the nav bar, box titles, "What's New Here?", and breadcrumbs in English. The date and center text block are in Slovensko. Polls and testimonials are in Slovensko. Categories, E-News, Information, and Affiliate Program are in English.

 

Also, for Wishlist I'm seeing the string "BOX_WISHLIST_EMPTY".

"Buy the ticket, take the ride..." -HST

Link to comment
Share on other sites

Greetings:

 

Using...

 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

 

I'm seeing the nav bar, box titles, "What's New Here?", and breadcrumbs in English. The date and center text block are in Slovensko. Polls and testimonials are in Slovensko. Categories, E-News, Information, and Affiliate Program are in English.

 

Also, for Wishlist I'm seeing the string "BOX_WISHLIST_EMPTY".

 

thenx a lot for your reply ... now i'm sure . default language is not working ... in which database is this information stored? .. or where else can i check?

 

thanx

Link to comment
Share on other sites

thenx a lot for your reply ... now i'm sure . default language is not working ... in which database is this information stored? .. or where else can i check?

 

thanx

 

 

hmm .. if there is no other way i'll just put some popup for first time visitors and tell them to select language .. :(

Link to comment
Share on other sites

  • 2 weeks later...
any idea here?

 

Yes, but you won't like it. The default language your shop is starting with is also dependant on the client browser settings for language.

With Firefox (I suppose Mozilla is the same) go to Tools-Options-Languages and make your preferred language the number one in the list (the same goes for IE x.x).

Depending on that setting in your browser your shop will start in English, Dutch or whatever you have available and defined as main language in your browser.

Link to comment
Share on other sites

Yes, but you won't like it. The default language your shop is starting with is also dependant on the client browser settings for language.

With Firefox (I suppose Mozilla is the same) go to Tools-Options-Languages and make your preferred language the number one in the list (the same goes for IE x.x).

Depending on that setting in your browser your shop will start in English, Dutch or whatever you have available and defined as main language in your browser.

 

 

hmm .. that's what i wanna hear .. if it is possible that it picks language depends on browsers settings ...

 

some friends told me it is not possible ..

Link to comment
Share on other sites

is it possible to put in some code, that wqould prevent form checking browsers setting, i mean, that is why we have default language right? :)

 

many users might have just default instalation of browers .. not set up to local settings ... but they also had to see default language, that's why it is called deafult language :) (again)

Link to comment
Share on other sites

is it possible to put in some code, that wqould prevent form checking browsers setting, i mean, that is why we have default language right? :)

 

many users might have just default instalation of browers .. not set up to local settings ... but they also had to see default language, that's why it is called deafult language :) (again)

 

the default language is there incase the browser does not forward their language settings, like spiders for instance.

So the system checks the language setting of the browser, if not defined it defaults to your default language. Couldn't be more beautiful.

Treasurer MFC

Link to comment
Share on other sites

the default language is there incase the browser does not forward their language settings, like spiders for instance.

So the system checks the language setting of the browser, if not defined it defaults to your default language. Couldn't be more beautiful.

 

i'm not quite sure, but i think that developers of OSc should play a bit around with Firefox.

 

I have Firefox in slovenian language, with only slovenian language under Languages in settings, cause i deleted others (en-gb, en) and still i receive english language.

 

I have clean install of Firefox 1.0 (winxp) installed only because of this problem .. to test, since some frineds told me about problem in Firefox.

 

Since i am no programer, it's up to me to believe what you wrote ... ;)

Link to comment
Share on other sites

i'm not quite sure, but i think that developers of OSc should play a bit around with Firefox.

 

I have Firefox in slovenian language, with only slovenian language under Languages in settings, cause i deleted others (en-gb, en) and still i receive english language.

 

I have clean install of Firefox 1.0 (winxp) installed only because of this problem .. to test, since some frineds told me about problem in Firefox.

 

Since i am no programer, it's up to me to believe what you wrote ... ;)

 

you don't have to believe me, test me.

 

set your firefox language to dutch or french or whatever.

 

go to www.crystallight.com.tw and you will receive english (my default).

 

then set your language to traditional chinese

 

visit again (after closing firefox first) and thou shall receive traditional chinese.

Treasurer MFC

Link to comment
Share on other sites

i'm not quite sure, but i think that developers of OSc should play a bit around with Firefox.

 

I have Firefox in slovenian language, with only slovenian language under Languages in settings, cause i deleted others (en-gb, en) and still i receive english language.

 

I have clean install of Firefox 1.0 (winxp) installed only because of this problem .. to test, since some frineds told me about problem in Firefox.

 

Since i am no programer, it's up to me to believe what you wrote ... ;)

 

What's your localization settings within osCommerce ?

Mine is Dutch (standard) and English. My Firefox installation is English and my XP OS is English also. I really have to make the Dutch language on top of all others within Firefox to get my shop opening in the Dutch language as default.

 

I am aware that someone who is also Dutch but also likes to work in English as default for almost everything has to have the language setting within Firefox changed to be able to view my shop standard in Dutch. If he/she hasn't taken that last step within Firefox my shop will open in English because of the US-English OS.

Nothing to prevent that I am afraid but it will only be a minority and they can change quickly within the shop to the correct language :)

Link to comment
Share on other sites

you don't have to believe me, test me.

 

set your firefox language to dutch or french or whatever.

 

go to www.crystallight.com.tw and you will receive english (my default).

 

then set your language to traditional chinese

 

visit again (after closing firefox first) and thou shall receive traditional chinese.

 

even more,

 

based on your browser language I predict your country on the create account page.

Not all countries, just the few most likely.

Treasurer MFC

Link to comment
Share on other sites

So the system checks the language setting of the browser, if not defined it defaults to your default language. Couldn't be more beautiful.
It would be, if everybody would set their preferred languages in their browser. But noy many people do, most don't even know it's possible :(

 

I "solved" (between quotes because it probably depends on your needs wheater it is a real improvement or not) this by disabling the browser language detection, and adding a cookie. Now the shop defaults to Dutch for all new visitors, but if a user selects a language this will be stored into the cookie, so that when the customer returns, his/her last language setting will be used.

 

To achieve the above I editted includes/application_top.php (approx line 270? done several mods to this file so the line number may differ). Look for the part that says "// set the language" (select the lines up to "// include the language translations" code) and replace it by:

 

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
     tep_setcookie('language', $HTTP_GET_VARS['language'], time()+365*24*3600, $cookie_path, $cookie_domain); // store choosen language into cookie (for a year) 
   } else {
    // $lng->get_browser_language(); // disabled browserlanguage detection (= default)
     
     if (isset($_COOKIE['language']) && tep_not_null($_COOKIE['language'])) {
       $lng->set_language($_COOKIE['language']); // set language to cookie language value   
     } else { 
       $lng->set_language(DEFAULT_LANGUAGE);
     }  
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

This is the first cookie code I ever wrote, and it seems to work fine, but please check carefully and post improvements if you think it's needed.

Link to comment
Share on other sites

It would be, if everybody would set their preferred languages in their browser. But noy many people do, most don't even know it's possible :(

 

I "solved" (between quotes because it probably depends on your needs wheater it is a real improvement or not) this by disabling the browser language detection, and adding a cookie. Now the shop defaults to Dutch for all new visitors, but if a user selects a language this will be stored into the cookie, so that when the customer returns, his/her last language setting will be used.

 

To achieve the above I editted includes/application_top.php (approx line 270? done several mods to this file so the line number may differ). Look for the part that says "// set the language" (select the lines up to "// include the language translations" code) and replace it by:

 

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
     tep_setcookie('language', $HTTP_GET_VARS['language'], time()+365*24*3600, $cookie_path, $cookie_domain); // store choosen language into cookie (for a year) 
   } else {
    // $lng->get_browser_language(); // disabled browserlanguage detection (= default)
     
     if (isset($_COOKIE['language']) && tep_not_null($_COOKIE['language'])) {
       $lng->set_language($_COOKIE['language']); // set language to cookie language value   
     } else { 
       $lng->set_language(DEFAULT_LANGUAGE);
     }  
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

This is the first cookie code I ever wrote, and it seems to work fine, but please check carefully and post improvements if you think it's needed.

 

very elegant !

Treasurer MFC

Link to comment
Share on other sites

very elegant !

 

the only problem you have by not checking the browser language is that everybody now first gets your site in dutch. So I would check the browser settings first and if they are not set, default it to dutch and set your cookie.

about 99% of your potential customers missed dutch in highschool i'm afraid.

Treasurer MFC

Link to comment
Share on other sites

the only problem you have by not checking the browser language is that everybody now first gets your site in dutch.  So I would check the browser settings first and if they are not set, default it to dutch and set your cookie.

about 99% of your potential customers missed dutch in highschool i'm afraid.

I've tried to reach those potential customers for a while (a.o. by letting the browser decide which language to show). But after some months I decided to focus on real customers (allthough far less than 1% of the potential), and it seems to help :)

 

The problem is that the default browser language isn't usually set by the user, but by the browserprogrammer/manufacturer.

 

Of course it can easyly be changed to use the browser's default if the cookie isn't set (the other way around would be totally useless), but that wasn't the question I think (and certainly wasn't my goal).

Link to comment
Share on other sites

I've tried to reach those potential customers for a while (a.o. by letting the browser decide which language to show). But after some months I decided to focus on real customers (allthough far less than 1% of the potential), and it seems to help :)

 

The problem is that the default browser language isn't usually set by the user, but by the browserprogrammer/manufacturer.

 

Of course it can easyly be changed to use the browser's default if the cookie isn't set (the other way around would be totally useless), but that wasn't the question I think (and certainly wasn't my goal).

 

well, other option is IP to location :

 

check where the ip is from and set language to that country if it differs from their browser settings.

Treasurer MFC

Link to comment
Share on other sites

the only problem you have by not checking the browser language is that everybody now first gets your site in dutch.  So I would check the browser settings first and if they are not set, default it to dutch and set your cookie.

about 99% of your potential customers missed dutch in highschool i'm afraid.

I've given this some more thought. But in countries where English is not the native language there are still a lot of users having English set as default (because they didn't set it themselves). So in these cases we don't want to default to English. This means that the default browser language setting doesnt work very well for those countries.

 

So maybe it would be better to check the default browser language, and if the cookie isn't set:

1) if the default browser language is the same as the default in admin just show that language

2) if the default browser language is different than the default set in admin give special attention to the language switch using a popup

 

Does that make any sense?

 

@boxtel: just noticed your post about ip location, a little late, maybe that's an option too (only problem is that the ip location is a long ever changing list :()

Link to comment
Share on other sites

I've given this some more thought. But in countries where English is not the native language there are still a lot of users having English set as default (because they didn't set it themselves). So in these cases we don't want to default to English. This means that the default browser language setting doesnt work very well for those countries.

 

So maybe it would be better to check the default browser language, and if the cookie isn't set:

1) if the default browser language is the same as the default in admin just show that language

2) if the default browser language is different than the default set in admin give special attention to the language switch using a popup

 

Does that make any sense?

 

@boxtel: just noticed your post about ip location, a little late, maybe that's an option too (only problem is that the ip location is a long ever changing list :()

 

 

true.

 

but if dutch users have set their language to english or it was set without them knowing about it, they get all websites in english anyway so they are used to it.

If you give them the option to switch to dutch and when they do, set your cookie, then they will get dutch in the future.

 

Those who choose not to switch your site to dutch will continue to receive the english version or whatever their setting was.

 

Just make sure you make it very clear that and how they can switch to dutch.

Treasurer MFC

Link to comment
Share on other sites

if dutch users have set their language to english or it was set without them knowing about it, they get all websites in english anyway

Only on multi-langual sites that detect this setting, so I'm not sure if they are really used to it (and/or aware of it).

 

Just make sure you make it very clear that and how they can switch to dutch.

Good point. But I find that not so easy, that's why I'm considering some kind of popup or something (only showing in the case mentioned before). And show a less intruding language switch in all other cases.
Link to comment
Share on other sites

Only on multi-langual sites that detect this setting, so I'm not sure if they are really used to it (and/or aware of it).

 

Good point. But I find that not so easy, that's why I'm considering some kind of popup or something (only showing in the case mentioned before). And show a less intruding language switch in all other cases.

 

well, some sites use this front page where you have to select a language first.

Personally I find that kind of overkill but if you use your cookie with that and thus subsequently no longer show that page, you might have a hit.

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...