From a02cfa9b085fc875fc55f57029a8e5846771ed5e Mon Sep 17 00:00:00 2001 From: thomascube Date: Sat, 13 Aug 2011 09:10:11 +0000 Subject: Fix incomplete backport from trunk --- program/include/rcmail.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'program/include/rcmail.php') diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 7ef34724e..d29ebe780 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -915,6 +915,21 @@ class rcmail return $text; } + /** + * Check if the given text lable exists + * + * @param string Label name + * @return boolean True if text exists (either in the current language or in en_US) + */ + public function text_exists($name, $domain=null) + { + // load localization files if not done yet + if (empty($this->texts)) + $this->load_language(); + + // check for text with domain first + return ($domain && isset($this->texts[$domain.'.'.$name])) || isset($this->texts[$name]); + } /** * Load a localization package -- cgit v1.2.3