mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-26 23:34:10 +02:00
QuickForm: translate() makes use of module name
This commit is contained in:
parent
229902687a
commit
2bc57d459b
@ -60,10 +60,13 @@ abstract class QuickForm extends Zend_Form
|
|||||||
*/
|
*/
|
||||||
protected $icingaModule;
|
protected $icingaModule;
|
||||||
|
|
||||||
|
protected $icingaModuleName;
|
||||||
|
|
||||||
public function __construct($options = null)
|
public function __construct($options = null)
|
||||||
{
|
{
|
||||||
if ($options !== null && array_key_exists('icingaModule', $options)) {
|
if ($options !== null && array_key_exists('icingaModule', $options)) {
|
||||||
$this->icingaModule = $options['icingaModule'];
|
$this->icingaModule = $options['icingaModule'];
|
||||||
|
$this->icingaModuleName = $this->icingaModule->getName();
|
||||||
unset($options['icingaModule']);
|
unset($options['icingaModule']);
|
||||||
}
|
}
|
||||||
parent::__construct($options);
|
parent::__construct($options);
|
||||||
@ -254,8 +257,11 @@ abstract class QuickForm extends Zend_Form
|
|||||||
|
|
||||||
public function translate($string)
|
public function translate($string)
|
||||||
{
|
{
|
||||||
// TODO: A module should use it's own domain
|
if ($this->icingaModuleName === null) {
|
||||||
return t($string);
|
return t($string);
|
||||||
|
} else {
|
||||||
|
return mt($this->icingaModuleName, $string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onSuccess()
|
public function onSuccess()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user