This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/includes/smarty/plugins/block.translate.php
2008-11-26 14:50:40 -08:00

38 lines
751 B
PHP

<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* File: block.translate.php
* Type: block
* Name: translate
* Purpose: translate a block of text
* -------------------------------------------------------------
*/
function smarty_block_translate($params, $resource, &$smarty)
{
global $C_translate;
if($params["module"] != '')
{
$module = $params["module"];
}
else
{
$module = 'CORE';
}
while(list ($key, $val) = each ($params))
{
$C_translate->value["$module"]["$key"] = $val;
}
$resource = trim($resource);
if ($resource != '') {
# strip whitespaces from the resouce identifier
echo $C_translate->translate($resource,$module,'');
}
}
?>