#set ($altParam = ${language.getParam("alt", $item.altText)})
#set ($titleParam = ${language.getParam("title", $item.altText)})
<#assign value="">
<\#if $locale??>
  <#assign $localeData=[
  #foreach ($entry in ${item.getI18n().entrySet()})
    "${entry.getKey()}" => "${entry.getValue()}",
  #end
    "LAST_ELEMENT_KEY", "LAST_ELEMENT_VALUE"
  ] >
  #set($i18nval = '$localeData[$locale]')
  <\#if ${i18nval}??>
    <#assign $value = $i18nval >
  </\#if>
</\#if>
#set ($idParam = ${language.getParam("id", $item.id)})
#set ($heightParam = ${language.getParam("height", $item.height)})
#set ($widthParam = ${language.getParam("width", $item.width)})
#set ($srcParam = ${language.getParam("src", $item.url)})
<\#macro printi18nimg text>
    #set($conditionStart = '$text?? && $text?contains')
    #set($conditionEnd = '!($value??)')
    #set($variableRef = '${value}')
    <\#if ${conditionStart}("alt=") && $conditionEnd>
    <\#else> alt="${variableRef}" </\#if>
    <\#if ${conditionStart}("title=") && $conditionEnd>
    <\#else> title="${variableRef}" </\#if>
</\#macro>
#set ($oneventxParam = ${language.getOnEventParams($item)})
<img #if($oneventxParam)$oneventxParam#end<@printi18nimg text="#if($altParam)$altParam#end#if($titleParam)$titleParam#end" />#if($idParam)$idParam#end#if($heightParam)$heightParam#end#if($widthParam)$widthParam#end#if($srcParam)$srcParam#end />
