Package pology :: Package lang :: Package sr :: Module trapres

Module trapres

Resolve trapnakron references in translations.


Author: Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>

License: GPLv3

Functions
(msgstr, msg, cat) -> msgstr
froments(name, args=(), kwargs={}, vfilter=None, testsub=False)
Resolve trapnakron references in translation using XML entity format [hook factory].
 
froments_t1(msgstr, msg, cat)
A testing specialization of froments: name="ui", vfilter="^%s", testsub=True [type F3C hook].
 
froments_t1db(msgstr, msg, cat)
A testing specialization of froments: name="docbook4", vfilter="^%s", testsub=True [type F3C hook].
Variables
  __package__ = 'pology.lang.sr'
Function Details

froments(name, args=(), kwargs={}, vfilter=None, testsub=False)

 

Resolve trapnakron references in translation using XML entity format [hook factory].

If an entity cannot be resolved as trapnakron reference, warning is output and the entity is left unresolved. Instead of leaving the entity unresolved, an illustrative expansion for the property key given by the reference can be substituted by setting the testsub parameter to True.

Entities in a given message can be manually ignored through ignore-entity: translation comment, which contains comma-separated list of entity names:

   # ignore-entity: foo, bar
   msgid "Blah, blah, &foo;, blah, blah, &bar;."
   msgstr "Бла, бла, &foo;, бла, бла, &bar;."

Standard XML and HTML entities are ignored by default.

Parameters:
  • name (string) - suffix of trapnakron constructor, e.g. "ui" for trapnakron_ui
  • args (tuple) - positional arguments to send to the constructor
  • kwargs (dict) - keyword arguments to send to the constructor
  • vfilter (string or (string)->string) - format string (with single %s directive) or function to apply to every resolved reference
  • testsub (bool) - whether to substitute test forms in place of undefined references
Returns: (msgstr, msg, cat) -> msgstr
type F3C hook