QuickForm: translate() makes use of module name

This commit is contained in:
Thomas Gelf 2015-07-30 08:18:36 +02:00
parent 229902687a
commit 2bc57d459b
1 changed files with 8 additions and 2 deletions

View File

@ -60,10 +60,13 @@ abstract class QuickForm extends Zend_Form
*/
protected $icingaModule;
protected $icingaModuleName;
public function __construct($options = null)
{
if ($options !== null && array_key_exists('icingaModule', $options)) {
$this->icingaModule = $options['icingaModule'];
$this->icingaModuleName = $this->icingaModule->getName();
unset($options['icingaModule']);
}
parent::__construct($options);
@ -254,8 +257,11 @@ abstract class QuickForm extends Zend_Form
public function translate($string)
{
// TODO: A module should use it's own domain
return t($string);
if ($this->icingaModuleName === null) {
return t($string);
} else {
return mt($this->icingaModuleName, $string);
}
}
public function onSuccess()