[wp-trac] [WordPress Trac] #21319: is_textdomain_loaded() returns true even if there are no translations for the domain
WordPress Trac
wp-trac at lists.automattic.com
Fri Jul 20 03:48:56 UTC 2012
#21319: is_textdomain_loaded() returns true even if there are no translations for
the domain
--------------------------+-----------------
Reporter: nacin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5
Component: I18N | Version: 3.0
Severity: normal | Keywords:
--------------------------+-----------------
#10527 introduced is_textdomain_loaded(). It returns true if
load_textdomain() has been called, even if no translations were loaded for
that domain. I think it should return false if no translations were
loaded. As the documentation says, "@return bool Whether there are
translations". In this case, no, there are not translations.
Attached patch also does the following:
* Does not store instances of NOOP_Translations inside the $l10n global.
Previously, we instantiated NOOP_Translations once for each domain that
was missing translations; since we are no longer storing NOOP_Translations
instances inside $l10n, we need to avoid instantiating it for every call
to get_translations_for_domain(). Thus, NOOP_Translations is now
instantiated only once, using a static variable.
* Removes by-references for get_translations_for_domain(), which are no
longer needed in PHP5.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21319>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list