Problem/Motivation
(From #1234848: language_list() doc is missing return value).
As #1234848: language_list() doc is missing return value and #981524: system_date_format_save() doesn't save localized date formats reveal, language_list() is a confusing function with different possible return structures.
See also #711918-109: Documentation standard for @param and @return data types:
In general, if you find yourself wanting a lot of choices (e.g., "string|bool|null") for a parameter or return data type, this could be an indication it would be better to refactor your function so that it is more understandable (for instance, return a TRUE/FALSE success flag, and use a by-reference parameter to return other information).
Proposed resolution
Refactor language_list()
into several simpler functions. (See #1234848-19: language_list() doc is missing return value.)
These changes could potentially be backported (if desired) by providing language_list()
as a wrapper.
Remaining tasks
TBD.
User interface changes
None.
API changes
language_list()
will be refactored and replaced.
Comments
Comment #1
xjmTagging.
Comment #1.0
xjmUpdated issue summary.
Comment #2
Gábor HojtsyThis is IMHO duplicate of #1260510: Introduce a language_load($langcode)? Please reopen if not.
Comment #2.0
Gábor HojtsyUpdated issue summary.