{* Display the list of available translations for an object and manage its translations *}
{** Currently works for the following object types: 'article' and 'wiki page' **}
{strip}
{if empty($submenu) || $submenu neq 'y'}
{if $prefs.lang_available_translations_dropdown neq 'y' }
{* For all object types: First show the translate icon and on hover the language of the current object *}
{if ! $js}
{if $object_type eq 'wiki page' and ($tiki_p_edit eq 'y' or (!$user and $prefs.wiki_encourage_contribution eq 'y')) and !$lock}
{tr}Set page language{/tr}
{elseif $object_type eq 'article' and $tiki_p_edit_article eq 'y'}
{tr}Set article language{/tr}
{/if}
{else}
{tr}Translations{/tr}
{* First the language of the object *}
{if $object_type eq 'wiki page'}
{$trads[0].langName|escape} ({$trads[0].lang|escape})
{elseif $object_type eq 'article'}
{$trads[0].langName|escape} ({$trads[0].lang|escape})
{/if}
{* Show the list of available translations *}
{section name=i loop=$trads}
{* For wiki pages *}
{if $object_type eq 'wiki page' and $trads[i] neq $trads[0]}
{$trads[i].langName|escape} ({$trads[i].lang|escape})
{/if}
{* For articles *}
{if $object_type eq 'article' and $trads[i] neq $trads[0]}
{$trads[i].langName|escape} ({$trads[i].lang|escape})
{/if}
{/section}
{* For wiki pages only: Show a link to view all translations on a single page *}
{if $object_type eq 'wiki page' and $prefs.feature_multilingual_one_page eq 'y' and isset($translationsCount) and $translationsCount gt 1}
{tr}All languages{/tr}
{/if}
{* For wiki pages only: List of machine translation candidates if feature is switched on *}
{if $object_type eq 'wiki page' and $prefs.feature_machine_translation eq 'y'}
{tr}Machine translations{/tr}
{* List machine translation candidates for available language of the site *}
{foreach from=$langsCandidatesForMachineTranslation item=mtl}
{$mtl.langName|escape} *
{/foreach}
{/if}
{* Translation maintenance *}
{capture}
{if $object_type eq 'wiki page' and $tiki_p_edit eq 'y'}
{tr}Translate{/tr}
{tr}Manage translations{/tr}
{elseif $object_type eq 'article' and $tiki_p_edit_article eq 'y'}
{tr}Translate{/tr}
{tr}Manage translations{/tr}
{/if}
{/capture}
{if !empty($smarty.capture.default)}{* Only display the header if there's content *}
{$smarty.capture.default}
{/if}