is_textdomain_loaded() returns true even if there are no translations for the domain
|Reported by:||nacin||Owned by:||nbachiyski|
#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 (11)
- Keywords has-patch commit added
- Owner set to nbachiyski
- Status changed from new to reviewing
comment:3 follow-up: ↓ 4 @nbachiyski — 3 years ago
- Status changed from reviewing to accepted