Difference between revisions of "User:Theaitetos/VariablesTest"

From FollowTheScore
Jump to: navigation, search
m
(changed)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#vardefine:XNAMEX|{{{1|{{PAGENAME}}}}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ä|a}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|â|a}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|á|a}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|à|a}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ä|A}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Â|A}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Á|A}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|À|A}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ö|o}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ô|o}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ó|o}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ò|o}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ö|O}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ô|O}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|O}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ò|O}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ü|u}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|û|u}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ú|u}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ù|u}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ü|U}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|U}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ú|U}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ù|U}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ê|e}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|é|e}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|è|e}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ë|e}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|E}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|É|E}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|È|E}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|i}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|í|i}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ì|i}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ï|i}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Î|I}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Í|I}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ì|I}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ŷ|y}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ý|y}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ÿ|y}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|Ý|Y}}}}{{#vardefine:XNAMEX|{{#replace:{{#var:XNAMEX}}|ß|ss}}}}<onlyinclude>{{#var:XNAMEX}}</onlyinclude>
+
<noinclude>To anyone interested, this is the template I made to clean a string of (almost) all diacritic symbols like "ä" (turns to "a") and a few others like "ß" (turns to "ss"). It employs the Extension:Variables, Extension:StringFunctions and Extension:DPL (#dplreplace), though you can use #dplvar instead of the #var ofc.</noinclude><includeonly>{{#if:{{#dplreplace:{{#dplreplace:{{urlencode:{{#vardefineecho:CLEAN|{{{1|{{PAGENAME}}}}}}}}}|%\d}}|[\w\s.-]}}|{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#var:CLEAN}}|(ä{{!}}â{{!}}á{{!}}à)|a}}|{{!}}Â{{!}}Á{{!}}À)|A}}}}{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#var:CLEAN}}|(ö{{!}}ô{{!}}ó{{!}}ò)|o}}|(Ö{{!}}Ô{{!}}Ó{{!}}Ò)|O}}}}{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#var:CLEAN}}|(ü{{!}}û{{!}}ú{{!}}ù)|u}}|{{!}}Û{{!}}Ú{{!}}Ù)|U}}}}{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#var:CLEAN}}|{{!}}ê{{!}}é{{!}}è)|e}}|{{!}}Ê{{!}}É{{!}}È)|E}}}}{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#var:CLEAN}}|(ï{{!}}î{{!}}í{{!}}ì)|i}}|(Ï{{!}}Î{{!}}Í{{!}}Ì)|I}}}}{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#var:CLEAN}}|(ÿ{{!}}ŷ{{!}}ý{{!}}ỳ)|y}}|(Ÿ{{!}}Ŷ{{!}}Ý{{!}}Ỳ)|Y}}}}{{#vardefine:CLEAN|{{#dplreplace:{{#dplreplace:{{#replace:{{#replace:{{#replace:{{#replace:{{#var:CLEAN}}|ß|ss}}|ẞ|SS}}|Ç|C}}|ç|c}}|{{!}}Š)|S}}|{{!}}š)|s}}}}}}{{#var:CLEAN}}</includeonly>

Latest revision as of 23:57, 21 January 2012

To anyone interested, this is the template I made to clean a string of (almost) all diacritic symbols like "ä" (turns to "a") and a few others like "ß" (turns to "ss"). It employs the Extension:Variables, Extension:StringFunctions and Extension:DPL (#dplreplace), though you can use #dplvar instead of the #var ofc.