Template:StripAccents: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(using new extension #multireplace - added almost whole list of diacritics)
m (Text replacement - "Category\:(.*) templates\]\]" to "Category:DPL templates]] Category:$1 templates")
 
(10 intermediate revisions by 2 users not shown)
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|ť=t|ź=z|ż=z|ž=z}}</includeonly><noinclude>
<includeonly>{{#replaceset:{{{1}}}|/[àáäãâåāăą]/i=a|/[èéêëēěĕėę]/i=e|/[ìíîïĩīĭį]/i=i|/[òóôõöōŏőø]/i=o|/[ùúûüūŭů]/i=u| /[ýÿ]/i=y|/[çćč]/i=c|/[đď]/i=d|/[ğģ]/i=g|ķ=k|/[łĺľļ]/i=l|/[ńñňņ]/i=n|/[ŕřŗ]/i=r|/[śšş]/i=s|ß=ss|ť=t|/[źżž]/i=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


'''Usage:'''
'''Usage:'''
* <tt><nowiki>{{StripAccents|Antonín Dvořák}}</nowiki></tt> returns
* {{tl|StripAccents|Antonín Dvořák}} returns "{{StripAccents|Antonín Dvořák}}"
{{StripAccents|Antonín Dvořák}}
* {{tl|StripAccents|Gegrüßet, Maria}} returns "{{StripAccents|Gegrüßet, Maria}}" (not "Gegru'''e'''sset", for proper sorting)
 
It is meant to be used in conjunction with template [[template:NameSorter|NameSorter]] in order to generate appropriate sort keys.
}}
}}
[[Category:Templates|{{PAGENAME}}]]
[[Category:DPL templates]]
[[Category:Text formatting templates]]
</noinclude>
</noinclude>

Latest revision as of 04:20, 5 January 2020

Removes all diacritics from a text or name

Usage:

  • {{StripAccents|Antonín Dvořák}} returns "Antonin Dvorak "
  • {{StripAccents|Gegrüßet, Maria}} returns "Gegrusset, Maria " (not "Gegruesset", for proper sorting)

It is meant to be used in conjunction with template NameSorter in order to generate appropriate sort keys.