how to have a lang. drop down!

Discussion in 'User interface' started by b4uindia, May 3, 2007.

  1. b4uindia

    b4uindia Paid Customer

    How we can have lang. drop down box in the footer where a user comes and choose his/her preferred lang. and the site goes to converted to all according to the selected lang. file


    please help me asap
  2. John Turner

    John Turner New Member

    Hi b4uindia,

    Here modification for you.
    Open '../templates/{YOUR TEMPLATE}/header.tpl'
    find following code
    Code:
    		{foreach from=$languages item=language name=select_lang}
    		<li {if $smarty.foreach.select_lang.last}style="border-right: none;"{/if}>
    			{if $language.lang eq $config.lang}
    				&nbsp;{$language.lang}</li>
    			{else}
    				&nbsp;<a href="{$smarty.server.REQUEST_URI|add_url_param:'language':$language.lang}">{$language.lang}</a></li>
    			{/if}			
    		{/foreach}
    
    replace with following code
    Code:
    	<form method="get" action="{$smarty.server.REQUEST_URI}">
    		Choose language:
    		<select name="language" class="what" onChange="this.form.submit()">
    		{foreach from=$languages item=language}
    		<option value="{$language.lang}" {if $language.lang eq $config.lang}selected{/if}>{$language.lang}</option>
    		{/foreach}
    		</select>
    	</form>
    
    *** save and close it.

    It might helps.

Share This Page