Contents

mz-language-tags - iana language tags

This module provides an interface to standardized language tags as described in RFC4646. The module is initialized from a IANA file that has been included with the distribution. However, it also starts a thread to download the IANA file from the internet and refresh. the contents of the languages. If it fails, it fails silently and relies on the provided tags with the distribution, however, it will keep trying to load the IANA file every 60 seconds.

Provided functions

(get-tag-for-lang language:string?) --> tag:symbol?

Returns a language tag for a given language description (e.g. dutch).

If it doesn't find the language, it returns #f

(get-lang-for-tag tag:symbol?) --> languages:list of string?

Returns the language descriptions valid for a given language tag. If it doesn't find the tag, it returns #f.

(get-type-for-tag tag:symbol?) --> type:symbol?

Returns the type of tag, e.g. 'language, 'region or 'script, or #f if tag hasn't been found.

(get-language-types) --> types:list of symbol?

Returns the list of all IANA types.

(get-language-list-for-type) --> languages:list of string?

Returns the list of all IANA descriptions for type language/script/region, whatever.

(get-language-list) --> languages:list of string?

Returns the list of all IANA languages, sorted.

(get-tag-list-for-type) --> tags:list of symbol?

Returns the list of all IANA tags for type language/script/region, whatever.

(get-language-tag-list) --> tags:list of symbol?

Returns the list of all IANA tags for type language.

(language-tags-from-iana?) --> boolean?

Returns #t, if the language list has been refreshed from IANA.