A) To make textual language links, modify plugins/blocks/languageToggle/block.tpl as follows:
- Code: Select all
{if $enableLanguageToggle}
<div class="block" id="sidebarLanguageToggle">
{foreach from=$languageToggleLocales key=langkey item=langname}
{if $langkey == $currentLocale}
{$langname}
{else}
<a href={if $languageToggleNoUser}'{$currentUrl|escape}{if strstr($currentUrl, '?')}&{else}?{/if}setLocale={$langkey}'{else}'{url page="user" op="setLocale" path=$langkey source=$smarty.server.REQUEST_URI escape=false}'{/if}>
{$langname}
</a>
{/if}
{/foreach}
</div>
{/if}
B) File plugins/blocks/languageToggle/block.tpl needs following modifications to achieve the "flag toggling":
- Code: Select all
{if $enableLanguageToggle}
<div class="block" id="sidebarLanguageToggle">
{foreach from=$languageToggleLocales key=langkey item=langname}
{if $langkey == $currentLocale}
<img src="{$baseUrl}/plugins/blocks/LanguageToggle/locale/{$langkey}/flag.png" alt="{$langname}" title="{$langname}" width="24" height="16" />
{else}
<a class="icon" href={if $languageToggleNoUser}'{$currentUrl|escape}{if strstr($currentUrl, '?')}&{else}?{/if}setLocale={$langkey}'{else}'{url page="user" op="setLocale" path=$langkey source=$smarty.server.REQUEST_URI escape=false}'{/if}>
<img src="{$baseUrl}/plugins/blocks/LanguageToggle/locale/{$langkey}/flag.png" alt="{$langname}" title="{$langname}" width="24" height="16" />
</a>
{/if}
{/foreach}
</div>
{/if}
Also picture file flag.png is needed for each locale of languageToggle plugin:
plugins/blocks/LanguageToggle/locale/en_US/flag.png
plugins/blocks/LanguageToggle/locale/ru_RU/flag.png
...
Size of pictures in block.tpl should be adjusted to flag.png size (24x16 assumed in code above).
