Hi,
I'm writing a plugin that shows an error text under certain circumstances.
I edited the plugin configuration to allow the user whether to show a message at all, or none. Additionally, I wanted to allow the (admin) user to choose an error message via configuration:
conf/default.php:
$conf['show_error'] = true;
$conf['error_message'] = "ERROR!"
conf/metadata.php:
$meta['show_error'] = array('onoff');
$meta['error_message'] = array('string');
Is there a way to localize the default message for conf entry error_message
?
I did not expect this to work, but I tried:
$conf['error_message'] = $lang['error_message'];
and
$conf['error_message'] = $this->getLang('error_message');
and
$conf['error_message'] = $this->getConf('error_message');
in conf/default.php
, but as expected, this does not work. (Surprisingly, it just took the raw code into the config string, e.g. $this->getConf('error_message');
).
I read some other plugins' conf section code that was roughly comparable to my use case, but I only found plugins that contained raw texts (mostly in English).
Any hints would be highly appreciated.
Thomas