Jump to content

[SOLVED] Language conditionals


Recommended Posts

Hello,

I have created an horizontal bar menu with some fixed links. It works ok, but as my shop has two languages, how could I make the link texts changing depending upon the language choosen?

Is there anyway of making a conditional like if we are in this language do this?

Or it's better another way of doing it? I have tried {l s='Home'} but it says always 'Home' and doesn't change 'Home' if we are not in English language.

Thank you in advance for your help.

Link to comment
Share on other sites

Hi Ann,

I didn't thought about detecting the IP for selecting the language. I don't know how it could be done by now.

Regarding when I'm using my solution, everytime I have a fixed link like:

{if $lang_iso == ‘en’}Home{/if}{if $lang_iso == ‘es’}Inicio{/if}



or even bigger ones like

{if $lang_iso == ‘en’}
 Some code goes here
{/if}



I don't know if this is the most efficent way of doing it, but It's the only one I have found and it works.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...