Functions

db_finalize ()

db_get_datadir ()

db_get_extlang ()

db_get_grandfathered ()

db_get_lang ()

db_get_redundant ()

db_get_region ()

db_get_relation ()

db_get_script ()

db_get_variant ()

db_initialize ()

db_set_datadir (path)

db_set_val (val)

ext_modules_load ()

ext_modules_unload ()

iter_init (tmpl)

list_free (data)

tag_convert_from_locale (error)

tag_convert_from_locale_string (locale, error)

Details

LangTag.db_finalize()
LangTag.db_get_datadir()
Return type:

str

LangTag.db_get_extlang()
Return type:

LangTag.ExtlangDb

LangTag.db_get_grandfathered()
Return type:

LangTag.GrandfatheredDb

LangTag.db_get_lang()
Return type:

LangTag.LangDb

LangTag.db_get_redundant()
Return type:

LangTag.RedundantDb

LangTag.db_get_region()
Return type:

LangTag.RegionDb

LangTag.db_get_relation()
Return type:

LangTag.RelationDb

LangTag.db_get_script()
Return type:

LangTag.ScriptDb

LangTag.db_get_variant()
Return type:

LangTag.VariantDb

LangTag.db_initialize()
LangTag.db_set_datadir(path)
Parameters:

path (str) –

LangTag.db_set_val(val)
Parameters:

val (LangTag.DbVal) –

LangTag.ext_modules_load()

Load all of the modules on the system, including the internal accessor. This has to be invoked before processing something with #lt_extension_t. or LangTag.db_initialize() does.

LangTag.ext_modules_unload()

Unload all of the modules already loaded.

LangTag.iter_init(tmpl)
Parameters:

tmpl (LangTag.IterTmpl) – a #LtItermpl_t

Returns:

the initialized iterator object.

Return type:

LangTag.Iter

Initialize the iterator with tmpl object. this function has to be called before performing any opperation with the iterator and LangTag.Iter.finish() when the iterator isn’t needed anymore.

lt_lang_db *lang = lt_lang_db_new();
LtPointer *key, *val;
LtIter *iter;

iter = LT_ITER_INIT (lang);
while (lt_iter_next(iter, &key, &val)) {
  /* do something with key and value */
}
lt_iter_finish(iter);
LangTag.list_free(data)
Parameters:

data (object) – a LangTag.List.

Frees all of the memory used by a LangTag.List.

LangTag.tag_convert_from_locale(error)
Parameters:

error (LangTag.Error or None) – a LangTag.Error.

Returns:

a LangTag.Tag, None if fails.

Return type:

LangTag.Tag

Convert current locale to the language tag.

LangTag.tag_convert_from_locale_string(locale, error)
Parameters:
Returns:

a LangTag.Tag, None if fails.

Return type:

LangTag.Tag

Convert locale to the language tag.