From 66b9e3666f43f98f1acb0a5c8983af3bc43d98f7 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 26 Jan 2010 17:25:31 +0000 Subject: [PATCH] Move load_muplugin_textdomain() to l10n.php git-svn-id: https://develop.svn.wordpress.org/trunk@12840 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/l10n.php | 22 ++++++++++++++++++++++ wp-includes/ms-functions.php | 12 ------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 8205d3ff98..4c8da78eda 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -382,6 +382,28 @@ function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_pat return load_textdomain( $domain, $mofile ); } +/** + * Load the translated strings for a plugin residing in the mu-plugins dir. + * + * @since 3.0 + * + * @param string $domain Unique identifier for retrieving translated strings + */ +function load_muplugin_textdomain($domain, $path = false) { + $locale = get_locale(); + if ( empty($locale) ) + $locale = 'en_US'; + + /* @todo $path is not used. Was it ever used and was it expected to be an arbitrary absolute dir? + * Ideally, it should be relative to WPMU_PLUGIN_DUR. + if ( false === $path ) + $path = WPMU_PLUGIN_DIR; + */ + + $mofile = WPMU_PLUGIN_DIR . "/$domain-$locale.mo"; + load_textdomain($domain, $mofile); +} + /** * Loads the theme's translated strings. * diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 7ec2cbc12d..b30634b661 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -5,18 +5,6 @@ * @package WordPress */ -function load_muplugin_textdomain($domain, $path = false) { - $locale = get_locale(); - if ( empty($locale) ) - $locale = 'en_US'; - - if ( false === $path ) - $path = WPMU_PLUGIN_DIR; - - $mofile = WPMU_PLUGIN_DIR . "/$domain-$locale.mo"; - load_textdomain($domain, $mofile); -} - // @todo use update_blog_details function wpmu_update_blogs_date() { global $wpdb;