Jump to content

(Solved) Change iso code for flags


Recommended Posts

It highly depends on how the theme handles the language blocks. Since it probably overrides it, go to your theme fodler, modules, blocklanguages and open blocklanguages.tpl.

 

Find the string related to the iso code, it's hard to tell where it is, but it should be something referring to $language.iso_code

 

Change the content of the link to

<img src="{$img_lang_dir}{$language.id_lang}.jpg" alt="{$language.iso_code}" width="16" height="11" />

 

Of course, the image size will depend on your flags icons :)

Link to comment
Share on other sites

That file already is wrote so, that's not the way. Thaks for your answer 

<!-- Block languages module -->
{if count($languages) > 1}
<div id="languages_block_top">
	<div id="countries">
	{* @todo fix display current languages, removing the first foreach loop *}
{foreach from=$languages key=k item=language name="languages"}
	{if $language.iso_code == $lang_iso}
		<p class="selected_language">
			<img src="{$img_lang_dir}{$language.id_lang}.jpg" alt="{$language.iso_code}" width="16" height="11" />
		</p>
	{/if}
{/foreach}
		<ul id="first-languages" class="countries_ul">
		{foreach from=$languages key=k item=language name="languages"}
			<li {if $language.iso_code == $lang_iso}class="selected_language"{/if}>
			{if $language.iso_code != $lang_iso}
				{assign var=indice_lang value=$language.id_lang}
				{if isset($lang_rewrite_urls.$indice_lang)}
					<a href="{$lang_rewrite_urls.$indice_lang|escape:htmlall}" title="{$language.name}">
				{else}
					<a href="{$link->getLanguageLink($language.id_lang)|escape:htmlall}" title="{$language.name}">

				{/if}
			{/if}
					<img src="{$img_lang_dir}{$language.id_lang}.jpg" alt="{$language.iso_code}" width="16" height="11" />
			{if $language.iso_code != $lang_iso}
				</a>
			{/if}
			</li>
		{/foreach}
		</ul>
	</div>
</div>

<script type="text/javascript">
$(document).ready(function () {
	$("#countries").mouseover(function(){
		$(this).addClass("countries_hover");
		$(".countries_ul").addClass("countries_ul_hover");
	});
	$("#countries").mouseout(function(){
		$(this).removeClass("countries_hover");
		$(".countries_ul").removeClass("countries_ul_hover");
	});

});
</script>
{/if}
<!-- /Block languages module -->
Link to comment
Share on other sites

Oh, sorry. It's my fault. This is the theme code:

<!-- Block languages module -->
{if count($languages) > 1}
<div id="languages_block_top">
		<ul id="first-languages" class="countries_ul">
		{foreach from=$languages key=k item=language name="languages"}
			<li>
	
					<a {if $language.iso_code == $lang_iso}class="selected"{/if} href="{$link->getLanguageLink($language.id_lang)|escape:htmlall}" title="{$language.name}">

			
					{$language.iso_code}
		
				</a>
		
			</li>
		{/foreach}
		</ul>
</div>

{/if}
<!-- /Block languages module -->

Where have I to put the code that you have told me?

Link to comment
Share on other sites

You can use it like this:

<!-- Block languages module -->
{if count($languages) > 1}
<div id="languages_block_top">
		<ul id="first-languages" class="countries_ul">
		{foreach from=$languages key=k item=language name="languages"}
			<li>
	
					<a {if $language.iso_code == $lang_iso}class="selected"{/if} href="{$link->getLanguageLink($language.id_lang)|escape:htmlall}" title="{$language.name}">

			
					<img src="{$img_lang_dir}{$language.id_lang}.jpg" alt="{$language.iso_code}" width="16" height="11" />
		
				</a>
		
			</li>
		{/foreach}
		</ul>
</div>

{/if}
<!-- /Block languages module -->

Now, I suggest you also add something which slightly makes the selected flag different. For example, you can set the opacity for all LI tags to .5, and to 1 the one for the currently selected language :D (.selected class)

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...