Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Language relevant image


fastmichaels

Recommended Posts

Posted

Hi,

 

I am working with a french/english shop and would like to know how to have an information banner that changes depending on the language the user is viewing the site in. I have two .jpg versions of the same banner, one in french and one in english.

 

It would be great if anyone can help.

 

Thanks in advance.

 

I am using the latest version of oscommerce.

Posted

This is fairly easy to accomplish.

 

Place this wherever you want the image to appear:

 

<?php echo MY_BANNER_IMAGE; ?>

 

Then the following into your language files:

 

catalog/includes/languages/english.php

 

define('MY_BANNER_IMAGE', '<img src="images/english_banner.gif">');

 

catalog/includes/languages/french.php

 

define('MY_BANNER_IMAGE', '<img src="images/french_banner.gif">');

Posted

This is fairly easy to accomplish.

 

Place this wherever you want the image to appear:

 

<?php echo MY_BANNER_IMAGE; ?>

 

Then the following into your language files:

 

catalog/includes/languages/english.php

 

define('MY_BANNER_IMAGE', '<img src="images/english_banner.gif">');

 

catalog/includes/languages/french.php

 

define('MY_BANNER_IMAGE', '<img src="images/french_banner.gif">');

 

Brill, thanks for that, it was defining the image path in the language files that I had wrong. It works now. thanks for your help.

 

I have noticed however that when I select french as my language on the homepage the banners do not appear, but when I click on the homepage link, which should effectively refresh the page, the banners appear. Everything works fine in english mode. It's just when i select frech as the language the banners do not apear on the homepage untill I click the homepage link. Any ideas why?

 

Thanks

Posted

Not really sure, but perhaps if you define the image in catalog/includes/languages/french/index.php

 

define('MY_BANNER_IMAGE', '<img src="images/french_banner.gif">');

Posted

I see. Well, being a very curious person, I decided to test it on my testing site and it is working. Take a look http://www.mrwebdomain.com/catalog/ The red E and S images at the top of the page change when the english or spanish is selected.

Posted

I think I have discovered the problem with your site. When I first arrive at your site, it is in english but the language select is already set at French as if it were the default. If I switch to English, the page simply refreshes, but the languge drop down changes to English, then if I switch to French, the banners do not show. Switch back to English and all is right unless I click on your logo, then the drop down changes to French again. It is definately the reason you are having a problem.

Posted

I think I have discovered the problem with your site. When I first arrive at your site, it is in english but the language select is already set at French as if it were the default. If I switch to English, the page simply refreshes, but the languge drop down changes to English, then if I switch to French, the banners do not show. Switch back to English and all is right unless I click on your logo, then the drop down changes to French again. It is definately the reason you are having a problem.

 

You are correct. In my admin section I have set the default language to French, but somehow English remains the language when you first drop on the site. I have no idea why!!

 

Can anyone shead light on this?

Posted

Just for the heck of it, I changed my default language to Spanish to see what would happen and the same problem occurs. The web site still defaults to English. I don't know why and I have no clue as to how to fix it, but I know for sure that there are plently of oscommerce sites out there using multiple languages and not using English as the default, so there must be a way. You might want to post that issue as a separate subject, maybe someone knows how to fix it. All of my sites are strictly Engish so it doesn't really effect me, but I am curious.

Posted

Just for the heck of it, I changed my default language to Spanish to see what would happen and the same problem occurs. The web site still defaults to English. I don't know why and I have no clue as to how to fix it, but I know for sure that there are plently of oscommerce sites out there using multiple languages and not using English as the default, so there must be a way. You might want to post that issue as a separate subject, maybe someone knows how to fix it. All of my sites are strictly Engish so it doesn't really effect me, but I am curious.

 

Thanks for your help. Just another oddity of the OS I guess!

 

All the best

Archived

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

×
×
  • Create New...