* Name: translation
* Purpose: Support many languages in a template, only showing block
if language matches
* @param array
*
* Params: lang: string (language, ex: en, pt-br) ** @param string contents of the block * @param Smarty clever simulation of a method * @return string string $content re-formatted */ function smarty_block_translation($params, $content, $smarty, &$repeat) { if (! $repeat && ! empty($content)) { $lang = $params['lang']; if ($smarty->getTemplateVars('language') == $lang) { return $content; } else { return ''; } } }