Story:- I have modified the login template:
./skins/my_theme/templates/login.html
- I added there my own translated string:
/program/localization/ru_RU/extra.inc
with code like:
$labels['l_search'] = 'Search New Text';
?>
- Then to the end of the file
/program/localization/ru_RU/labels.inc
I added the line:
include ('extra.inc');
What I want:But I don't want to modify the file
/program/localization/ru_RU/labels.inc
every time the new release comes out.
I want to move my custom translation string(s) to the plugin's system.
What I did:I tried and created plugin like this one:
/**
* Extra Languages
*/
class extra_languages extends rcube_plugin
{
function init()
{
$this->add_hook('startup', array($this, 'startup'));
$this->add_hook('authenticate', array($this, 'authenticate'));
$this->add_texts('localization', true);
}
function startup($labels)
{
$labels['l_search'] = $this->gettext('l_search');
return ??????????;
}
function authenticate($args)
{
$labels['l_search'] = $this->gettext('l_search');
return ???????;
}
}
P.S.Of course I have added the proper "localization" folder for this plugin.
In other words the code in this plugin
function startup($labels)
{
print $this->gettext('l_search');
exit;
}works when I enter the index.php page.
The question (problem):I don't know how to return
$this->gettext('l_search'); back to main application so it has been merged with global text strings (labels).
Is there any why to return from this plugin my custom translation strings?
Check 'lang_sel' plugin bundled with MyRoundcube plugins (see signature). There you see a method how to merge localizations with the default localization.