From: pdontthink Date: Fri, 29 Jun 2007 23:29:09 +0000 (+0000) Subject: Make sq_change_text_domain() return previous text domain X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f06e5b6da4f46c8bac42458f4c4d4878e66655df;p=squirrelmail.git Make sq_change_text_domain() return previous text domain git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12494 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/include/languages.php b/include/languages.php index a20af558..a42ded2f 100644 --- a/include/languages.php +++ b/include/languages.php @@ -40,28 +40,33 @@ * (OPTIONAL; default is SquirrelMail * locale directory). * - * @return void + * @return string The name of the text domain that was set + * *BEFORE* it is changed herein - NOTE that + * this differs from PHP's textdomain() * * @since 1.5.2 and 1.4.10 */ function sq_change_text_domain($domain_name, $directory='') { - if (empty($directory)) $directory = SM_PATH . 'locale/'; - static $domains_already_seen = array(); + global $gettext_domain; + $return_value = $gettext_domain; // only need to call bindtextdomain() once // if (in_array($domain_name, $domains_already_seen)) { sq_textdomain($domain_name); - return; + return $return_value; } $domains_already_seen[] = $domain_name; + if (empty($directory)) $directory = SM_PATH . 'locale/'; + sq_bindtextdomain($domain_name, $directory); sq_textdomain($domain_name); + return $return_value; } /**