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

xjm’s picture

Issue tags: +API change

Tagging.

xjm’s picture

Issue summary: View changes

Updated issue summary.

Gábor Hojtsy’s picture

Status: Active » Closed (duplicate)

This is IMHO duplicate of #1260510: Introduce a language_load($langcode)? Please reopen if not.

Gábor Hojtsy’s picture

Issue summary: View changes

Updated issue summary.