is_textdomain_loaded() returns true even if there are no translations for the domain
|Reported by:||nacin||Owned by:||nbachiyski|
|Component:||I18N||Keywords:||dev-feedback has-patch has-unit-tests|
#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.
Change History (17)
- Keywords has-patch commit added
- Owner set to nbachiyski
- Status changed from new to reviewing
4 years ago
- Status changed from reviewing to accepted
12 months ago
- Keywords dev-feedback needs-refresh added; has-patch 2nd-opinion removed
- Keywords has-patch added; needs-refresh removed
- Milestone changed from Future Release to 4.5