Add possibility to overwrite a label/message in Roundcube's language package (#1489433)

pull/157/head
Aleksander Machniak 11 years ago
parent f59cfe8806
commit 75a5c3554a

@ -642,10 +642,11 @@ class rcube
/** /**
* Load a localization package * Load a localization package
* *
* @param string Language ID * @param string $lang Language ID
* @param array Additional text labels/messages * @param array $add Additional text labels/messages
* @param array $merge Additional text labels/messages to merge
*/ */
public function load_language($lang = null, $add = array()) public function load_language($lang = null, $add = array(), $merge = array())
{ {
$lang = $this->language_prop(($lang ? $lang : $_SESSION['language'])); $lang = $this->language_prop(($lang ? $lang : $_SESSION['language']));
@ -685,6 +686,11 @@ class rcube
if (is_array($add) && !empty($add)) { if (is_array($add) && !empty($add)) {
$this->texts += $add; $this->texts += $add;
} }
// merge additional texts (from plugin)
if (is_array($merge) && !empty($merge)) {
$this->texts = array_merge($this->texts, $merge);
}
} }

Loading…
Cancel
Save