Warning, /sdk/pology/lang/sr/rules/puretext.filters is written in an unsupported language. File is not indexed.
0001 # Filter message fields into pure text. 0002 # Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net> 0003 # License: GPLv3 0004 0005 # Order of filter addition is significant. 0006 0007 # Rewrite parts of original text based on directives in translator comments. 0008 addFilterHook name="remove/rewrite-inverse" on="msg" 0009 addFilterHook name="remove/rewrite-msgid" on="msg" 0010 0011 # Resolve UI references. 0012 # Translation may contain UI references, original UI strings which 0013 # are supposed to be automatically resolved into translated UI when 0014 # final catalogs are made (see documentation on pology.uiref). 0015 # UI references should be resolved in pure text for e.g. terminology 0016 # and spelling checks not to trip over. 0017 # Environment variable UICATS_SR contains the list of directory paths 0018 # where UI catalogs are looked up to resolve a given UI reference, 0019 # while header of a referencing catalog should specify UI catalog names 0020 # from which the UI messages may come (details also in documentation to 0021 # pology.uiref). 0022 # For this to work in POs with implicit UI references, markup types in 0023 # a PO must be specified using the X-Text-Markup header field 0024 # (see documentation to pology.remove.remove_markup_text 0025 # for details). 0026 # The resolution is quiet, no warnings when a UI reference cannot be resolved, 0027 # as there are rules to specifically check for their validity. 0028 # ...in KDE4 UI POs. 0029 addFilterHook name="uiref/resolve-ui-kde4~\ 0030 uipathseps=['->', u'→'], \ 0031 uicpathenv='UICATS_KDE4_SR', \ 0032 mkeyw='kde4', quiet=True" \ 0033 on="msgstr" \ 0034 handle="uiref" 0035 # ...in Docbook documentation POs. 0036 addFilterHook name="uiref/resolve-ui-docbook4~\ 0037 uicpathenv='UICATS_KDE4_SR', \ 0038 mkeyw='docbook4', quiet=True" \ 0039 on="msgstr" \ 0040 handle="uiref" 0041 # ...in POs with no implicit UI references. 0042 # Note that no XML-escaping is done; if it is needed, make another filter 0043 # for particular environment, with 'xmlescape=True' factory parameter. 0044 addFilterHook name="uiref/resolve-ui~\ 0045 uipathseps=['->', u'→'], \ 0046 uicpathenv='UICATS_KDE4_SR', \ 0047 mkeyw=['docbook4', 'kde4'], invmkeyw=True, quiet=True" \ 0048 on="msgstr" \ 0049 handle="uiref" 0050 0051 # Remove literal substrings, those which are to be understood by the machine 0052 # and therefore not translated, as designated by markup. 0053 # (-> before markup removal) 0054 addFilterHook name="remove/remove-marlits-msg" on="msg" 0055 0056 # Remove text markup. 0057 # For this to work, POs need to specify markup types using 0058 # the X-Text-Markup header field; its value is a markup keyword. 0059 # For markups known to Pology at any given moment, see documentation on 0060 # remove_markup_text() function in pology.remove module. 0061 # The value of the header field may be a comma-separated list of keywords, 0062 # if there are several markup types present in the PO. 0063 # (-> before accelerator removal) 0064 # (-> before literals removal) 0065 addFilterHook name="remove/remove-markup-msg" on="msg" 0066 0067 # Convert hybridized Ekavian-Yekavian text into Ekavian. 0068 # (-> after resolving UI references) 0069 # (-> before accelerator removal) 0070 addFilterHook name="sr:wconv/hitoe" on="pmsgstr" 0071 0072 # Remove accelerator markers. 0073 # For this to work, POs need to specify the marker character through 0074 # the X-Accelerator-Marker header field. 0075 # (-> after markup removal) 0076 addFilterHook name="remove/remove-accel-msg" on="msg" 0077 0078 # Replace format directives with tildes (~), based on *-format flags. 0079 addFilterHook name="remove/remove-fmtdirs-msg-tick~'~'" on="msg" 0080 0081 # Remove other literal substrings by heuristics. 0082 # Heuristics can be augmented by explicit instructions per message, 0083 # see documentation on remove_literals_text() function 0084 # in pology.remove module. 0085 # (-> after markup removal) 0086 addFilterHook name="remove/remove-literals-msg" on="msg" 0087 0088 # Remove local entities which are to be left as-is in the message. 0089 addFilterHook name="remove/remove-ignored-entities-msg" on="msg" 0090 0091 # Convert accent graphs into Unicode accent compositions, 0092 # then remove accents from letters alltogether. 0093 addFilterHook name="sr:accents/resolve_agraphs" on="pmsgstr" 0094 addFilterHook name="sr:accents/remove_accents" on="pmsgstr" 0095 0096 # Convert action-loaded characters to their ordinary counterparts. 0097 addFilterRegex match=" " repl=" " on="pmsgid,pmsgstr" # no-break space