Localization

Localization

class firefox_puppeteer.api.l10n.L10n(marionette)

An API which allows Marionette to handle localized content.

Deprecated since version 52.2.0: Use the localization module from marionette_driver instead.

The localization of UI elements in Gecko based applications is done via entities and properties. For static values entities are used, which are located in .dtd files. Whereby for dynamically updated content the values come from .property files. Both types of elements can be identifed via a unique id, and the translated content retrieved.

localize_entity(dtd_urls, entity_id)

Returns the localized string for the specified DTD entity id.

To find the entity all given DTD files will be searched for the id.

Parameters:
  • dtd_urls – A list of dtd files to search.
  • entity_id – The id to retrieve the value from.
Returns:

The localized string for the requested entity.

Raises:

NoSuchElementException – When entity id is not found in dtd_urls.

localize_property(property_urls, property_id)

Returns the localized string for the specified property id.

To find the property all given property files will be searched for the id.

Parameters:
  • property_urls – A list of property files to search.
  • property_id – The id to retrieve the value from.
Returns:

The localized string for the requested entity.

Raises:

NoSuchElementException – When property id is not found in property_urls.