Difference between revisions of "Template:StripAccents"

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

Removes all diacritics from a text or name

Usage:

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

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