Difference between revisions of "Template:StripAccents"

From ChoralWiki
Jump to navigation Jump to search
m (Text formatting templates)
m (Text replacement - "Category\:(.*) templates\]\]" to "Category:DPL templates]] Category:$1 templates")
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#multireplace:{{{1}}}|/[àáäãâåāăą]/ui=a|/[èéêëēěĕėę]/ui=e|/[ìíîïĩīĭį]/ui=i|/[òóôõöōŏőø]/ui=o|/[ùúûüūŭů]/ui=u| /[ýÿ]/ui=y|/[çćč]/ui=c|/[đď]/ui=d|/[ğģ]/ui=g|ķ=k|/[łĺľļ]/ui=l|/[ńñňņ]/ui=n|/[ŕřŗ]/ui=r|/[śšş]/ui=s|ß=ss|ť=t|/[źżž]/ui=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
Line 7: Line 7:
 
* {{tl|StripAccents|Gegrüßet, Maria}} returns "{{StripAccents|Gegrüßet, Maria}}" (not "Gegru'''e'''sset", for proper sorting)
 
* {{tl|StripAccents|Gegrüßet, Maria}} returns "{{StripAccents|Gegrüßet, Maria}}" (not "Gegru'''e'''sset", for proper sorting)
  
It is meant to be used in conjuction with template [[template:NameSorter|NameSorter]] in order to generate appropriate sort keys.
+
It is meant to be used in conjunction with template [[template:NameSorter|NameSorter]] in order to generate appropriate sort keys.
 
}}
 
}}
 +
[[Category:DPL templates]]
 
[[Category:Text formatting 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.