LangTag.Lang

Fields

None

Methods

compare (v2)

dump ()

get_better_tag ()

get_macro_language ()

get_name ()

get_preferred_tag ()

get_scope ()

get_suppress_script ()

get_tag ()

ref ()

unref ()

Details

class LangTag.Lang

All the fields in the LangTag.Lang structure are private to the LangTag.Lang implementation.

compare(v2)
Parameters:

v2 (LangTag.Lang) – a LangTag.Lang.

Returns:

True if it’s the same, otherwise False.

Return type:

int

Compare if self and v2 is the same object or not.

dump()

Dumps the container information to the standard output.

get_better_tag()
Returns:

a tag string.

Return type:

str

Obtains the better tag for use. this is a convenient function to get the preferred-value if available.

get_macro_language()
Returns:

a macrolanguage string or None.

Return type:

str

Obtains the macrolanguage being assigned for the subtag. This is available only when the subtag is registered as the macrolanguage in ISO 639-3.

get_name()
Returns:

a description string.

Return type:

str

Obtains the description of the subtag.

get_preferred_tag()
Returns:

a preferred-value for the tag or None.

Return type:

str

Obtains the preferred-value. this is available only when the tag is marked as deprecated.

get_scope()
Returns:

a scope string or None.

Return type:

str

Obtains the scope value indicating the type of language code according to ISO 639.

get_suppress_script()
Returns:

a suppress-script string or None.

Return type:

str

Obtains the suppress-script value. which shouldn’t be used to form language tags with the associated primary or extended language subtag.

get_tag()
Returns:

a tag string.

Return type:

str

Obtains the tag name.

ref()
Returns:

the same self object.

Return type:

LangTag.Lang

Increases the reference count of self.

unref()

Decreases the reference count of self. when its reference count drops to 0, the object is finalized (i.e. its memory is freed).