# Translation choices of spanish team
# Copyrigth 2010-2014, Javier Viñal (fjvinal@gmail.com)
# by the KDE Spanish Team (kde-l10n-es@kde.org)
# some ideas taken from the hook "sr/checks.py" by Chusslove Illich
# License: GPLv3

# Replace &nbsp; by space.
addFilterRegex match="\&nbsp\;" repl=" " on="pmsgid,pmsgstr"

# Especial treatment for «etc.», there may be a comma before it.
addFilterRegex match="(etc\.|\&etc\;)" repl="etcétera" on="pmsgid,pmsgstr"

# Especial treatment for <quote>, replace with double quote.
addFilterRegex match="\<\/?quote\>" repl="\"" on="pmsgid,pmsgstr"

# Especial treatment for « & » and « && ».
addFilterRegex match="(\s\&{1,2}\s)" repl=" y " on="pmsgid,pmsgstr"

# Remove bold tags
addFilterRegex match="\<\/?b\>" repl="" on="pmsgid,pmsgstr"

# Remove some special tags preceded with '%'
addFilterRegex match="\%[\w.-]+(\%[\w.-]*)*" repl="~" on="pmsgid,pmsgstr"

# Remove some special tags between ':'
addFilterRegex match="\:[\w.-]+\:" repl="~" on="pmsgid,pmsgstr"

# Remove email addresses with "at"
addFilterRegex match="\(([\w.-]+\s)+?at(\s[\w.-]+)+\)" repl="~" on="pmsgid,pmsgstr"

# Remove functions calls
addFilterRegex match="([\w.-]+\:\:)*[\w.-]+\(.*?\)" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\\\\[\w.-]+(\{[\w.-]*\})*" repl="~" on="pmsgid,pmsgstr"

# Remove C++ methods
addFilterRegex match="\:\:[\w-]+" repl="~" on="pmsgid,pmsgstr"

# Remove dd statements
addFilterRegex match="\b(dd\s)?(if|of)\=(\/[\w.#+-]+)+" repl="~" casesens="yes" on="pmsgid,pmsgstr"

# Remove some shell variables
addFilterRegex match="\$[\w-]+" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\$\{.*?\}" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\$\(.*?\)" repl="~" on="pmsgid,pmsgstr"

# Remove some types of paragraph tags.
addFilterHook name="remove/remove-marlits-msg" on="msg"
addFilterHook name="remove/remove-markup-msg" on="msg"
addFilterHook name="remove/remove-accel-msg" on="msg"
addFilterHook name="remove/remove-ignored-entities-msg" on="msg"
addFilterHook name="remove/remove-paired-ents-tick~u'~'" on="msg"
addFilterHook name="remove/remove-fmtdirs-msg-tick~u'~'" on="msg"
addFilterHook name="remove/remove_literals_msg_tick~u'~'" on="msg"

# Omit html tags
addFilterRegex match="\<\s*(bcode|command|envar|filename|icode|shortcut|placeholder|style|code|tt|literal|screen|option|keycap|userinput|systemitem|prompt|function|foreignphrase|varname|programlisting|token|markup|parameter|keysym|methodname|sgmltag|arg|classname|type)\s*\>.*?\<\/\s*\1\s*\>" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\<\s*(email|link)\s*?\>.*?\<\/\s*\1\s*\>" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\<.*?\>" repl="~" on="pmsgid,pmsgstr"

# Remove Linux files
addFilterRegex match="\b(bin|boot|dev|etc|home|lib|lib64|lost\+found|media|mnt|opt|proc|root|run|sbin|srv|sys|tmp|usr|var)(\/[\w.#+-]+)+" repl="~" casesens="yes" on="pmsgid,pmsgstr"
addFilterRegex match="(\$[\w-]+|\$\(.*?\)|\$\{.*?\}|(KDE|QT|JAVA)\w*|\.kde\d?|~)(\/[\w.#+-]+)+" repl="~" casesens="yes" on="pmsgid,pmsgstr"

# Remove Windows files
addFilterRegex match="\b[A-Z]\:(\\{1,2}[\w.#+-]+)+\b" repl="~" casesens="yes" on="pmsgid,pmsgstr"

# Remove MIME types
addFilterRegex match="\b(all|application|audio|fonts|image|inode|interface|message|model|multipart|text|uri|video|x\-content|x\-epoc)\/\w[\w.#+-]*\w" repl="~" on="pmsgid,pmsgstr"

# Remove single characters between quotes.
addFilterRegex match="\'.\'" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\".\"" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="«.»" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\\\".\\\"" repl="~" on="pmsgid,pmsgstr"

# Remove groups of non alphanumeric characters between quotes.
addFilterRegex match="\'\W+?\'" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\"\W+?\"" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="«\W+?»" repl="~" on="pmsgid,pmsgstr"
addFilterRegex match="\\\"\W+?\\\"" repl="~" on="pmsgid,pmsgstr"

# Remove some abreviations.
addFilterRegex match="\b(admin|cartr|cert|cond|dec|hex|[Ii]nc|Jr|lab|Mr|Mrs|No|obs|oct|org|seq|Sh|sync|torr)\.(\.\.)?" repl="~" casesens="yes" on="pmsgid,pmsgstr"
addFilterRegex match="\b(a\.\s?m|admon|apdos?|art|atte|Av?|Avdas?|Aytos?|C\.\s?C|C\.\s?P|caps?|CC\.\aAA|cents?|cénts?|Cías?|ctas?|ctes?|ctras?|dchas?|dchos?|deptos?|dptos?|D|Dr(es)?|Dras?|EE\.\s?UU|[Pp]\.\sej|Excm[ao]s?|exprs?|Fdo|Gob|Gral(es)?|hnos|(ID|Id|id)s?|Ilm[ao]s?|izdas?|izdos?|izq|JJ\.\s?OO|K\.\s?O|Ld[ao]s?|Lic|Ltd(os)?|Ltdas?|máx|mín|[Nn]úm|n\.\s?t|op|p\.\s?m|págs?|Pdtes?|Pdtas?|pl|plzas?|pos|ppal(es)?|pral(es)?|Prof|ptas?|pts|pzas?|reg|Rep|S.\sA|sdad|Sr(es)?|Sras?|S.\sL|sinc|Srtas?|St[ao]s?|tels?|tfnos?|trads?|Uds?|Univ|V\.O(\.S)?|vol|vv\.\s?aa|VV\.\s?AA)\.(\.\.)?" repl="~" casesens="yes" on="pmsgid,pmsgstr"

# Remove some usual smileis.
addFilterRegex match="\s(\:\)|\(\-\:|\:\)|\(\:|\=\)|\)\-\:\)|\:\-\)|\:\-\(|\;\-\)|\;\)|\:\-\{|\:\-\()" repl="\s~" on="pmsgid,pmsgstr"

# Remove numbers and dates
addFilterRegex match="(?<!\%)[+-]?[0-9Xx]+([.,\:\/][0-9Xx]+)+" repl="~" on="pmsgid,pmsgstr"

# Remove hexadecimal numbers.
addFilterRegex match="0x[0-9abcdef]*" repl="~" on="pmsgid,pmsgstr"

# Remove special puntuactions.
addFilterRegex match="(\?{2,3}|\%{2,3}|\:{2,3}|_{2,3})" repl="~" on="pmsgid,pmsgstr"

# Remove some types of paragraph tags.
addFilterHook name="es:remove_subs/remove_tags_without_translation" on="msg"
