Kjell Knudsen
|
Friday 03 September 2004 2:04:09 am
Here's the code which Peter made for me in the end- which solved all my issues very nicely. Listing the additional translations if there are any, and also allows me to override the system names for the languages:
{* Code to show list of translations *}
{* to use pictures, instead of text uses st.like this: 'esl-ES',concat('<img src=',"picture_name.png"|ezimage,'/>') *}
{let languages=hash('cat-ES','Catalan', 'chi-CN','Chinese', 'cze-CZ','Czech', 'dan-DK','Danish', 'dut-NL','Dutch', 'eng-CA','English (Canada)', 'eng-GB','English (United Kingdom)', 'eng-US','English', 'esl-ES','Español', 'esl-MX','Castillan', 'fin-FI','Finnish', 'fre-CA','French (Canada)', 'fre-FR','Français', 'ger-DE','German (Germany)', 'hun-HU','Hungarian', 'ita-IT','Italian', 'nno-NO','Norwegian (Nynorsk)', 'nor-NO','Norwegian (Bokmal)', 'pol-PL','Polish', 'por-BR','Portuguese (Brasil)', 'por-MZ','Portuguese (Mozambique)', 'por-PT','Portuguese (Portugal)', 'rus-RU','Russian', 'swe-SE','Swedish')
all_translations=$node.object.current.translation_list}
{section show=$all_translations|count|gt(0)}
<div class="translations">
{section var=translation loop=$node.object.current.translation_list}
<a href={concat($node.url_alias,'/(language)/',$translation.item.language_code)|ezurl}>{$languages[$translation.item.language_code]}</a> |
{/section}
</div>
{/section}
{/let}
Kjell Knudsen
http://www.icbl.org
|