Module:etymology languages/documentation

This module provides etymology-only languages. It has a separate data module, Module:etymology languages/data, which stores information for etymology-only language codes.

It exports only three functions that behave similarly to the ones in Module:languages:,  , and.

However, do not use these functions directly under normal circumstances. Instead, use, in Module:languages, where the third parameter indicates that etymology-only languages can be returned, and if the second parameter is non-nil, an error is thrown if the specified code or name isn't recognized.

Etymology-only language objects returned by, , or or by the corresponding methods in Module:languages function, for all intents and purposes, exactly like full Language objects. In particular, they support all the same methods, meaning they can for the most part be used as drop-in replacements for full Language objects. The only significant differences are:
 * 1) Etymology-only languages are nested underneath a full language (or, in rare cases, a full family), i.e. their parent (or parent's parent, etc.) is a full language (or family). This can be returned using . If you need the code or canonical name of the full language or family under which a given etymology-only language is nested, it is more efficient to use  or  rather than calling  or similar. (All three methods,  and  exist on full languages, but the first one just returns back the same object and the others are equivalent to calling  and , respectively.)
 * 2) The  method on an etymology-only language returns the direct containment parent (a full language, etymology-only language or family) of the etymology-only language. When called on full languages, it returns {nil}.
 * 3) Some modules that accept language objects are not prepared to accept etymology-only language objects. This particularly relates to categories, because currently only full languages can form poscatboiler or topic categories beginning with a language name or code. Modules that accept etymology-only language objects must be prepared to call  or similar if they construct their own category names.