Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fiktivkod/library/Fiktiv/View/Helper/Translate.php
2011-02-26 14:06:19 +01:00

29 lines
No EOL
706 B
PHP

<?php
/**
* Helper to give Zend_View_Helper_Translate additional options
*
* Additions:
* - Translate arguments too. ($view->translate('KEY', 'arg', true);)
*
*/
class Fiktiv_View_Helper_Translate extends Zend_View_Helper_Translate
{
/**
* Performs the translation
*
* @return string
*/
public function translate($messageid = null)
{
$options = func_get_args();
$key = array_shift($options);
if (isset($options[0]) && $options[count($options)-1] === true) {
foreach ($options as &$opt) {
$opt = parent::translate($opt);
}
}
return parent::translate($key, $options);
}
}