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

git-svn-id: https://develop.svn.wordpress.org/trunk@8556 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-08-05 21:28:50 +00:00
parent ace1dbc33e
commit 9ac24840ea
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);
}
/**