z_language_data (zotonic_core v1.0.0-rc.10)
Mandatory background read on language tags: [1].
Some quotes from [1]:
The golden rule when creating language tags is to keep the tag as short as possible. Avoid region, script or other subtags except where they add useful distinguishing information. For instance, use 'ja' for Japanese and not 'ja-JP', unless there is a particular reason that you need to say that this is Japanese as spoken in Japan, rather than elsewhere.
The entries in the registry follow certain conventions with regard to upper and lower letter-casing. For example, language tags are lower case, alphabetic region subtags are upper case, and script tags begin with an initial capital. This is only a convention!
Note that we use lower case subtags in subtag identifiers and URLs.
Language+extlang combinations are provided to accommodate legacy language tag forms, however, there is a single language subtag available for every language+extlang combination. That language subtag should be used rather than the language+extlang combination, where possible. For example, use 'yue' rather than 'zh-yue' for Cantonese, and 'afb' rather than 'ar-afb' for Gulf Arabic, if you can.Link to this section Summary
Link to this section Functions
Link to this function
codes_atom()
-spec codes_atom() -> [atom()].
Link to this function
codes_bin()
-spec codes_bin() -> [binary()].
Link to this function
fallback(Code)
-spec fallback(z_language:language()) -> [z_language:language_code()].
Link to this function
is_language(Lang)
-spec is_language(z_language:language()) -> boolean().
Link to this function
languages_list()
-spec languages_list() -> [{binary(), proplists:proplist()}].
Link to this function
languages_map_flat()
-spec languages_map_flat() -> #{z_language:language_code() | binary() => map()}.
Link to this function
languages_map_main()
Link to this function
make_mod()
Link to this function
make_mod_reload()
Link to this function
to_language_atom(Lang)
-spec to_language_atom(z_language:language()) -> {ok, atom()} | {error, not_a_language}.