MRMRacing Posted March 6, 2010 Share Posted March 6, 2010 I need help with a simple if code for checking if the user has English or Swedish as language!If code here menu here in swedishElsemenu in English/IFI need help with the first simple if code, it can check country or languageI searched but have not found it anywhere,Thanks Link to comment Share on other sites More sharing options...
rocky Posted March 6, 2010 Share Posted March 6, 2010 You could put code like the following in a TPL file: {if $cookie->id_lang == 2} Swedish {else} English {/if} Change 2 to the ID of the Swedish language. Link to comment Share on other sites More sharing options...
MRMRacing Posted March 6, 2010 Author Share Posted March 6, 2010 Thank you very much! I tried most things without cookie.It work fine now. Link to comment Share on other sites More sharing options...
evolution.x Posted January 12, 2011 Share Posted January 12, 2011 Hi,This is the code i was looking for alos but i need to implement it so the image swaps for more than 2 langs.I have 4 langs set up on my site and need to change the image to the relevant lang.Any help would be appreciated.RegardsAdam Link to comment Share on other sites More sharing options...
rocky Posted January 12, 2011 Share Posted January 12, 2011 You can use code like the following: <img src="{$img_dir}image_{$lang_iso}.jpg" alt="alt" /> This will look for image_en.jpg, image_fr.jpg, etc in the img directory inside your theme's directory, depending on the current language. Link to comment Share on other sites More sharing options...
evolution.x Posted January 12, 2011 Share Posted January 12, 2011 Your a lifesaver ROCKY!!!Thank you so much! You can use code like the following: <img src="{$img_dir}image_{$lang_iso}.jpg" alt="alt" /> This will look for image_en.jpg, image_fr.jpg, etc in the img directory inside your theme's directory, depending on the current language. Link to comment Share on other sites More sharing options...
mrplow Posted February 4, 2011 Share Posted February 4, 2011 You can use code like the following: <img src="{$img_dir}image_{$lang_iso}.jpg" alt="alt" /> This will look for image_en.jpg, image_fr.jpg, etc in the img directory inside your theme's directory, depending on the current language. I came to this conclusion myself and assumed it would work. I have engliah and turkish on my shop, id 1 and id 9, with correct iso codes en and tr.I put an image on the checkout page giving some instructions about paypal. Named them paypal-en.jpg and paypal-tr.jpg.I call the image with .It seems so logical. And yet in both languages, it uses the tr file?!Any idea why this is happening?TIA --EDIT!!!paypal-{$lang_iso}.jpg works!paypal-{$language.iso_code} chooses tr for some reason!Thanks Rocky I'll read the details of your posts more closely in future Link to comment Share on other sites More sharing options...
aiteampl Posted January 23, 2012 Share Posted January 23, 2012 Rocky, how would you do it in a product.tpl so we could have different images for different languages? $link->getImageLink($product->link_rewrite, $cover.id_image, 'original') ? i have no idea how to break up this . thanks Link to comment Share on other sites More sharing options...
Recommended Posts