Jump to content

[SOLVED] "If" code depending on langage


Recommended Posts

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 swedish

Else

menu in English

/IF


I need help with the first simple if code, it can check country or language

I searched but have not found it anywhere,

Thanks

Link to comment
Share on other sites

  • 10 months later...

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

  • 4 weeks later...
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 paypal-{$language.iso_code}.jpg.
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

  • 11 months later...
×
×
  • Create New...