From bfa3b629e0d67016ec83050c5db762479af40609 Mon Sep 17 00:00:00 2001 From: donncha Date: Wed, 13 Aug 2008 15:13:05 +0000 Subject: Merge with WP revision 8635 git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1421 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/l10n.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'wp-includes/l10n.php') diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 86ceb86..35f89c5 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -242,21 +242,27 @@ function __ngettext_noop($single, $plural, $number=1, $domain = 'default') { function load_textdomain($domain, $mofile) { global $l10n; - if (isset($l10n[$domain])) - return; - if ( is_readable($mofile)) $input = new CachedFileReader($mofile); else return; - $l10n[$domain] = new gettext_reader($input); + $gettext = new gettext_reader($input); + + if (isset($l10n[$domain])) { + $l10n[$domain]->load_tables(); + $gettext->load_tables(); + $l10n[$domain]->cache_translations = array_merge($gettext->cache_translations, $l10n[$domain]->cache_translations); + } else + $l10n[$domain] = $gettext; + + unset($input, $gettext); } /** * load_default_textdomain() - Loads default translated strings based on locale * - * Loads the .mo file in LANGDIR constant path from WordPress root. + * Loads the .mo file in WP_LANG_DIR constant path from WordPress root. * The translated (.mo) file is named based off of the locale. * * @since 1.5.0 -- cgit