Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

multilingual graphics :: language specific


Recommended Posts

Hi there I'm really confused about this because Brian gave two answers in september to this, but they appear to be quite different.

I need to add graphic buttons of my own that change according to language.

Can someone update on this please !!! I'm desperate here..

So ok--it's to do with $langid.

But this is what Brian said in 1 answer and I followed these instructions to no avail...



STS supports the default OSC language settings, and you can further control how your template displays images by using the $langid variable in your file names.


For example, if you want a button that says "Shopping Cart" in various languages, in your template file where you would normally have


<img src="images/cart_button.gif"> (or whatever you call it)


change it to be


<img src="images/cart_button-$langid.gif">


and then create the graphics $cart_button-1.gif for English, $cart_button-2.gif for German, $cart_button-3.gif for French, etc. The numbers should match the LANGID variables in your database.


Hope this helps.


- Brian


But this is what Brian said in 2 answer...


You could do this, just have the graphics in the menu as button1-$langid.gif", button2-$langid.gif etc.


The graphics would then appear in whatever language you want, and they would go to the same URL/links regardless of the language, since OSC is multi-language by default.


Of course, if you really want a different language for each page, just make your links like <a href="thispage-$langid.html"> or <a href="thatspage-$langid.php"> or whatever you want.


- Brian



So, can someone please boil this down and simplify this?

which one is correct---I can't get either working. Why? has something changed?The first explanation on how to do this does not work.


is it :'(



and wher should the graphics go?


thanks for your help on this.

Link to comment
Share on other sites


How to change custom made images according to language in STS::language specific graphics...


ok----it took a while but I found the answer, so if anyone needs I hope they find this.


1. add the following code somewhere at the top in sts_user_code.php


$template['langid'] = $languages_id;


2 .Then in your sts_template.html file, each button's HTML IMAGE tag must go something like this:


<img src="mytemplate/mybutton$langid.gif">


Then you could create mybutton1.gif, mybutton2.gif and mybutton3.gif, one for each language...put them in your template file.



1 is for english

2 is for spanish

3 is for, etc.

these numbers at the end are the language id numbers, you can find them in your database, or just look closely in the urls when editing in admin/localisation/languages for instance....



this is just a breakdown of another post I found.

it's getting hard to find some things in these forums these days !!

Edited by flood
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...