Index: wp-includes/l10n.php
===================================================================
--- wp-includes/l10n.php	(revision 12139)
+++ wp-includes/l10n.php	(working copy)
@@ -28,17 +28,17 @@
 function get_locale() {
 	global $locale;
 
-	if (isset($locale))
+	if ( isset( $locale ) )
 		return apply_filters( 'locale', $locale );
 
 	// WPLANG is defined in wp-config.
-	if (defined('WPLANG'))
+	if ( defined( 'WPLANG' ) )
 		$locale = WPLANG;
 
-	if (empty($locale))
+	if ( empty( $locale ) )
 		$locale = 'en_US';
 
-	return apply_filters('locale', $locale);
+	return apply_filters( 'locale', $locale );
 }
 
 /**
@@ -56,7 +56,7 @@
  */
 function translate( $text, $domain = 'default' ) {
 	$translations = &get_translations_for_domain( $domain );
-	return apply_filters('gettext', $translations->translate($text), $text, $domain);
+	return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
 }
 
 function before_last_bar( $string ) {
@@ -80,12 +80,11 @@
  */
 function translate_with_context( $text, $domain = 'default' ) {
 	return before_last_bar( translate( $text, $domain ) );
-
 }
 
 function translate_with_gettext_context( $text, $context, $domain = 'default' ) {
 	$translations = &get_translations_for_domain( $domain );
-	return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain);
+	return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain );
 }
 
 /**
@@ -195,8 +194,8 @@
  * @param string $domain Optional. Domain to retrieve the translated text
  * @return string Translated context string without pipe
  */
-function _c($text, $domain = 'default') {
-	return translate_with_context($text, $domain);
+function _c( $text, $domain = 'default' ) {
+	return translate_with_context( $text, $domain );
 }
 
 function _x( $single, $context, $domain = 'default' ) {
@@ -235,7 +234,7 @@
  * @param string $domain Optional. The domain identifier the text should be retrieved in
  * @return string Either $single or $plural translated text
  */
-function _n($single, $plural, $number, $domain = 'default') {
+function _n( $single, $plural, $number, $domain = 'default' ) {
 	$translations = &get_translations_for_domain( $domain );
 	$translation = $translations->translate_plural( $single, $plural, $number );
 	return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
@@ -316,8 +315,18 @@
  * @param string $mofile Path to the .mo file
  * @return bool true on success, false on failure
  */
-function load_textdomain($domain, $mofile) {
+function load_textdomain( $domain, $mofile ) {
 	global $l10n;
+	
+	$plugin_override = apply_filters( 'override_load_textdomain', false, $domain, $mofile );
+	
+	if ( true == $plugin_override ) {
+		return true;
+	}
+	
+	do_action( 'load_textdomain', $domain, $mofile );
+		
+	$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
 
 	if ( !is_readable( $mofile ) ) return false;
 
@@ -328,6 +337,7 @@
 		$mo->merge_with( $l10n[$domain] );
 
 	$l10n[$domain] = &$mo;
+	
 	return true;
 }
 
@@ -344,7 +354,7 @@
 
 	$mofile = WP_LANG_DIR . "/$locale.mo";
 
-	return load_textdomain('default', $mofile);
+	return load_textdomain( 'default', $mofile );
 }
 
 /**
@@ -360,18 +370,18 @@
  * 	where the .mo file resides. Deprecated, but still functional until 2.7
  * @param string $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precendence over $abs_rel_path
  */
-function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path = false) {
+function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) {
 	$locale = get_locale();
 
 	if ( false !== $plugin_rel_path	)
-		$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/');
-	else if ( false !== $abs_rel_path)
-		$path = ABSPATH . trim( $abs_rel_path, '/');
+		$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
+	else if ( false !== $abs_rel_path )
+		$path = ABSPATH . trim( $abs_rel_path, '/' );
 	else
 		$path = WP_PLUGIN_DIR;
 
 	$mofile = $path . '/'. $domain . '-' . $locale . '.mo';
-	return load_textdomain($domain, $mofile);
+	return load_textdomain( $domain, $mofile );
 }
 
 /**
@@ -404,7 +414,7 @@
  */
 function &get_translations_for_domain( $domain ) {
 	global $l10n;
-	if ( !isset($l10n[$domain]) ) {
+	if ( !isset( $l10n[$domain] ) ) {
 		$l10n[$domain] = &new NOOP_Translations;
 	}
 	return $l10n[$domain];
@@ -421,6 +431,5 @@
  * won't suffer from that problem.
  */
 function translate_user_role( $name ) {
-	return translate_with_gettext_context( before_last_bar($name), 'User role' );
-}
-?>
+	return translate_with_gettext_context( before_last_bar( $name ), 'User role' );
+}
\ No newline at end of file

