fastmichaels Posted July 13, 2010 Posted July 13, 2010 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.
Guest Posted July 13, 2010 Posted July 13, 2010 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">');
fastmichaels Posted July 13, 2010 Author Posted July 13, 2010 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
Guest Posted July 13, 2010 Posted July 13, 2010 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">');
fastmichaels Posted July 13, 2010 Author Posted July 13, 2010 Currently the images are defined in header.php so I have no idea why they don't show up. thanks for your help anyway, I appreciate it
Guest Posted July 13, 2010 Posted July 13, 2010 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.
fastmichaels Posted July 13, 2010 Author Posted July 13, 2010 Cool, take a look at my test site http://www.doncasterdesign.com/client/pneu/testsite/index.php. When you land on the page it will be in english, from the dropdown select french, the two banners lower down will then disappear, click the homepage button "Page d'accueil de" and the banners should reappear! Thanks for your time.
Guest Posted July 13, 2010 Posted July 13, 2010 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.
fastmichaels Posted July 13, 2010 Author Posted July 13, 2010 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?
Guest Posted July 13, 2010 Posted July 13, 2010 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.
fastmichaels Posted July 14, 2010 Author Posted July 14, 2010 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.