tools

methods in this module are tools, thank to which pyramid_localize works most of its magic.

pyramid_localize.tools.destination_path(request)[source]

Return absolute path of the translation destination.

Parameters:request (pyramid.request.Request) – a request object
Returns:A combined translation destination path
Return type:str
pyramid_localize.tools.dummy_autotranslate(msgid, domain=None, default=None, mapping=None)[source]

Simulate autotranslate.

Parameters:
  • msgid (str) – Message or message id
  • domain (str) – Translation domain
  • default (str) – Default message
  • mapping (dict) – Mapping dictionary for message variables
Returns:

translated string

Return type:

str

pyramid_localize.tools.set_localizer(request, reset=False)[source]

Set localizer and auto_translate methods for request.

Parameters: