forked from Softcatala/catalan-pology-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter.include
73 lines (57 loc) · 3.75 KB
/
filter.include
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Filters include for catalan language
# by KDE Catalan Team ([email protected])
# some ideas taken from spanish filter.include (by Javier Viñal)
# License: GPLv3
# Remove literal substrings, those which are to be understood by the machine
# and therefore not translated, as designated by markup.
# (-> before markup removal)
addFilterHook name="remove/remove-marlits-msg" on="msg"
# Remove text markup.
# For this to work, POs need to specify markup types using
# the X-Text-Markup header field; its value is a markup keyword.
# For markups known to Pology at any given moment, see documentation on
# remove_markup_text() function in pology.remove module.
# The value of the header field may be a comma-separated list of keywords,
# if there are several markup types present in the PO.
# (-> before accelerator removal)
# (-> before literals removal)
addFilterHook name="remove/remove-markup-msg" on="msg"
# Remove accelerator markers.
# For this to work, POs need to specify the marker character through
# the X-Accelerator-Marker header field.
# (-> after markup removal)
addFilterHook name="remove/remove-accel-msg" on="msg"
# Remove local entities which are to be left as-is in the message.
addFilterHook name="remove/remove-ignored-entities-msg" on="msg"
# Removes all XML-like entities (&foo;) from the original text,
# and all XML-like entities from the translation that were encountered in the original.
addFilterHook name="remove/remove-paired-ents-tick~'~'" on="msg"
# Replace format directives with tildes (~), based on *-format flags.
addFilterHook name="remove/remove-fmtdirs-msg-tick~'~'" on="msg"
# Remove other literal substrings by heuristics.
# Heuristics can be augmented by explicit instructions per message,
# see documentation on remove_literals_text() function
# in pology.remove module.
# (-> after markup removal)
addFilterHook name="remove/remove-literals-msg-tick~'~'" on="msg"
# Convert action-loaded characters to their ordinary counterparts.
addFilterRegex match=" " repl=" " on="pmsgid,pmsgstr" # no-break space
# Remove XML-like tags.
addFilterRegex match="\<\s*(arg|classname|bcode|code|command|envar|filename|foreignphrase|function|keycap|keysym|icode|literal|markup|methodname|option|parameter|placeholder|programlisting|prompt|screen|sgmltag|shortcut|span|style|systemitem|token|tt|type|userinput|varname)\b.*?\b\1\>" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\<\s*(email|link)\s*>\b.*?\b\1\>" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\<.*?\>" repl="~" on="pmsgid,pmsgstr"
# Extension filter, e.g. "*.png|PNG files"
addFilterRegex match="^.*\*\..*\|" repl="~" on="pmsgid,pmsgstr"
# Remove web pages.
addFilterRegex match="((http|https|ftp|sftp)\:\/\/)?([\w\_\-]+\.)+((gov|edu|com|mil|org|net|aero|biz|coop|info|museum|name|pro|mobi)|([a-z]{2,4})|\5\.\6)(\:\d{2,4})?(\/[\w\.\-\_]+)*\/?(\?(\w+\=\w+)(\&(\w+\=\w+))*?)?(\#\w+)?" repl="~" on="pmsgid,pmsgstr"
# Remove system files.
addFilterRegex match="(file\:|\#\!)?\/(bin|etc|lib|media|proc|srv|var|boot|home|lib32|mnt|root|sys|cdrom|lib64|sbin|tmp|dev|lost\+found|opt|selinux|usr)(\/(\w|\.|\-|\_)+)*\/?" repl="~" on="pmsgid,pmsgstr"
# Remove more important (as I guess) hidden files.
addFilterRegex match="\.\/?(bash|directory|fonts|ICEauthority|kateconfig|kderc|mailcap|profile|Xauthority|Xclients|Xdefaults|Xmodmap|Xresources|Xsession)" repl="~" on="pmsgid,pmsgstr"
# Remove single characters in quotes.
addFilterRegex match="«.»" repl="~" on="pmsgid,pmsgstr"
# Remove special puntuactions.
addFilterRegex match="\s*(\?{2,3}|\%{2,3}|\:{2,3}|\_{2,3})" repl="~" on="pmsgid,pmsgstr"
# Remove more usual smileis.
addFilterRegex match="\s(\:\)|\(\-\:|\:\)|\(\:|\=\)|\)\-\:\)|\:\-\)|\:\-\(|\;\-\)|\;\)|\:D|\:\()" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\s(\"\:\-\)\")" repl="~" on="pmsgid,pmsgstr"