Allow merging of similarly named text domains. Props sambauers. fixes #7376 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@8556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-08-05 21:28:50 +00:00
parent 5eae274300
commit cd722a7472
1 changed files with 10 additions and 4 deletions

View File

@ -242,15 +242,21 @@ 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);
}
/**