This was isolated from bug 11267 comment 12 and following.
Some localisations depend on their respective fallback languages.
Without them, they were incomplete. These fallback languages need
to be consulted prior to any other fallback language, most notably
user specified ones.
For instance, "nl-formal" only has messages that directly address
users, all other messages are in "nl".
"arz" mainly localizes computerese terms, much of the rest comes
Both "nl" and "ar" are (very) complete localizations.
As a side note:
Message lookup should return a language code (with directionality)
that can be used as the value the (X)HTML lang attribute specified
in the HTML container containing the message text.
The two examples above differ somewhat as to which language
code they should or must return for that use. Since "nl-formal"
is not in BCP 47, returning it must be avoided, and "nl" is
the only proper choice for both "nl" and "nl-formal".
Not so with "arz" and "ar", which both are acceptable, but
"arz" should imho be preferred for consistency, which is just
the opposite choice compared to "nl-forma" and "nl".