src.themerr.locale#

class src.themerr.locale.Locale[source]#

Bases: object

Locale class.

This class is used to handle the localization of strings. Currently, it used only to extract strings from the settings.xml file.

Examples

>>> Locale.settings()
{30001: '...', ...}

Methods

settings()

Get the strings used in the settings.xml file.

static addon() dict[source]#

Get the strings used in the addon.xml file.

This method uses the pgettext function to extract the strings needed for the addon.xml file. Using pgettext allows us to add the msgctxt to the po file, which is needed for Kodi to find the correct translation.

Returns:
dict

Dictionary of strings used in the addon.xml file.

Examples

>>> Locale.addon()
{"addon.extension.description": '...', ...}
static settings() dict[source]#

Get the strings used in the settings.xml file.

This method uses the pgettext function to extract the strings needed for the settings.xml file. Using pgettext allows us to add the msgctxt to the po file, which is needed for Kodi to find the correct translation.

Returns:
dict

Dictionary of strings used in the settings.xml file.

Examples

>>> Locale.settings()
{30001: '...', ...}