29 lines
No EOL
689 B
PHP
29 lines
No EOL
689 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()
|
|
{
|
|
$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);
|
|
}
|
|
} |