From 3d4ce6f10b94d487e8eff89f689fba22327634f0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 25 May 2010 12:31:16 -0700 Subject: Revert "Backing out locale switch change to see if this affects our mystery memory leak." This reverts commit f98609204fb9b5966b9e4c9e4bf8bf605656c31c. --- lib/util.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index eed61d029..59d5132ec 100644 --- a/lib/util.php +++ b/lib/util.php @@ -34,6 +34,14 @@ function common_user_error($msg, $code=400) $err->showPage(); } +/** + * This should only be used at setup; processes switching languages + * to send text to other users should use common_switch_locale(). + * + * @param string $language Locale language code (optional; empty uses + * current user's preference or site default) + * @return mixed success + */ function common_init_locale($language=null) { if(!$language) { @@ -50,6 +58,15 @@ function common_init_locale($language=null) return $ok; } +/** + * Initialize locale and charset settings and gettext with our message catalog, + * using the current user's language preference or the site default. + * + * This should generally only be run at framework initialization; code switching + * languages at runtime should call common_switch_language(). + * + * @access private + */ function common_init_language() { mb_internal_encoding('UTF-8'); -- cgit v1.2.3-54-g00ecf