Difference between revisions of "Template:StripAccents"

From ChoralWiki
Jump to navigation Jump to search
(more concise syntax using RegExp)
(reverted to old syntax: RegExp messed up the Unicode characters.)
Line 1: Line 1:
<includeonly>{{#multireplace:{{{1}}} |/[àáäãâåāăą]/=a|/[èéêëēěĕėę]/=e|/[ìíîïĩīĭį]/=i|/[òóôõöōŏőø]/=o|/[ùúûüūŭů]/=u|/[ýÿ]/=y| /[çćč]/=c|/[đď]/=d|/[ğģ]/=g|ķ=k|/[łĺľļ]/=l|/[ńñňņ]/=n|/[ŕřŗ]/=r|/[śšş]/=s|ß=ss|ť=t|/[źżž]/=z}}</includeonly><noinclude><!--
+
<includeonly>{{#multireplace:{{{1}}} |à=a|á=a|ä=a|ã=a|â=a|å=a|ā=a|ă=a|ą=a|è=e|é=e|ê=e|ë=e|ē=e|ě=e|ĕ=e|ė=e|ę=e| ì=i|í=i|î=i|ï=i|ĩ=i|ī=i|ĭ=i|į=i|ò=o|ó=o|ô=o|õ=o|ö=o|ō=o|ŏ=o|ő=o|ø=o|ù=u|ú=u|û=u|ü=u|ū=u|ŭ=u|ů=u|ý=y|ÿ=y| ç=c|ć=c|č=c|đ=d|ď=d|ğ=g|ģ=g|ķ=k|ł=l|ĺ=l|ľ=l|ļ=l|ń=n|ñ=n|ň=n|ņ=n|ŕ=r|ř=r|ŗ=r|ś=s|š=s|ş=s|ß=ss|ť=t|ź=z|ż=z|ž=z}}</includeonly><noinclude><!--
 
-->{{DisplayBox|bgcolor=g|text=
 
-->{{DisplayBox|bgcolor=g|text=
 
Removes all diacritics from a text or name
 
Removes all diacritics from a text or name

Revision as of 20:39, 13 May 2009

Removes all diacritics from a text or name

Usage:

  • {{StripAccents|Antonín Dvořák}} returns "{{#multireplace:Antonín Dvořák |à=a|á=a|ä=a|ã=a|â=a|å=a|ā=a|ă=a|ą=a|è=e|é=e|ê=e|ë=e|ē=e|ě=e|ĕ=e|ė=e|ę=e| ì=i|í=i|î=i|ï=i|ĩ=i|ī=i|ĭ=i|į=i|ò=o|ó=o|ô=o|õ=o|ö=o|ō=o|ŏ=o|ő=o|ø=o|ù=u|ú=u|û=u|ü=u|ū=u|ŭ=u|ů=u|ý=y|ÿ=y| ç=c|ć=c|č=c|đ=d|ď=d|ğ=g|ģ=g|ķ=k|ł=l|ĺ=l|ľ=l|ļ=l|ń=n|ñ=n|ň=n|ņ=n|ŕ=r|ř=r|ŗ=r|ś=s|š=s|ş=s|ß=ss|ť=t|ź=z|ż=z|ž=z}}"
  • {{StripAccents|Gegrüßet, Maria}} returns "{{#multireplace:Gegrüßet, Maria |à=a|á=a|ä=a|ã=a|â=a|å=a|ā=a|ă=a|ą=a|è=e|é=e|ê=e|ë=e|ē=e|ě=e|ĕ=e|ė=e|ę=e| ì=i|í=i|î=i|ï=i|ĩ=i|ī=i|ĭ=i|į=i|ò=o|ó=o|ô=o|õ=o|ö=o|ō=o|ŏ=o|ő=o|ø=o|ù=u|ú=u|û=u|ü=u|ū=u|ŭ=u|ů=u|ý=y|ÿ=y| ç=c|ć=c|č=c|đ=d|ď=d|ğ=g|ģ=g|ķ=k|ł=l|ĺ=l|ľ=l|ļ=l|ń=n|ñ=n|ň=n|ņ=n|ŕ=r|ř=r|ŗ=r|ś=s|š=s|ş=s|ß=ss|ť=t|ź=z|ż=z|ž=z}}" (not "Gegruesset", for proper sorting)

It is meant to be used in conjuction with template LastName in order to generate appropriate sort keys.