Backing out locale switch change to see if this affects our mystery memory leak.

Revert "Locale switch cleanup: use common_switch_locale() which is safer for updating gettext state. Also moved a few calls to reduce chance of hitting an exception before switching back."

This reverts commit 74a89b1fc3.
This commit is contained in:
Brion Vibber
2010-05-25 11:36:42 -07:00
parent 09dab2ce5a
commit f98609204f
4 changed files with 16 additions and 33 deletions

View File

@@ -34,14 +34,6 @@ 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) {
@@ -58,15 +50,6 @@ 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');