From 75a5c3554a8a4d7f88c4abecb155566c74c30afc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 25 Nov 2013 09:00:49 +0100 Subject: Add possibility to overwrite a label/message in Roundcube's language package (#1489433) --- program/lib/Roundcube/rcube.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'program/lib/Roundcube/rcube.php') diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index e0fa22c3c..331b57e96 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -642,10 +642,11 @@ class rcube /** * Load a localization package * - * @param string Language ID - * @param array Additional text labels/messages + * @param string $lang Language ID + * @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'])); @@ -685,6 +686,11 @@ class rcube if (is_array($add) && !empty($add)) { $this->texts += $add; } + + // merge additional texts (from plugin) + if (is_array($merge) && !empty($merge)) { + $this->texts = array_merge($this->texts, $merge); + } } -- cgit v1.2.3