[wp-trac] [WordPress Trac] #54415: remove_accent does not remove accents

WordPress Trac noreply at wordpress.org
Thu Nov 11 09:04:41 UTC 2021


#54415: remove_accent does not remove accents
-----------------------------------------+------------------------------
 Reporter:  malthert                     |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Formatting                   |     Version:
 Severity:  major                        |  Resolution:
 Keywords:  reporter-feedback has-patch  |     Focuses:
-----------------------------------------+------------------------------

Comment (by malthert):

 Replying to [comment:4 SergeyBiryukov]:
 Thanks for the feedback!

 To sum this up, I will change the following things:
 We need to keep the language distinction, since some languages have them
 transliterated differently.

 1) add the missing locales to the existing function
 or: remove _formal/_informal from locale string and just check for de_DE,
 de_AT, de_CH so all those cases are covered
 => best: I think we should just use the first 2 letters of the locale
 here, so it will be consistent for all "de" locale, as this is what is
 originally intended here.

 2) the letter "ß" is only used in German languages anyway and there is no
 transliteration of ß => s to be found anywhere.
 This will be removed from the conditional and update the "general"
 transliteration of ß to ss

 3) add a 2nd arg to the function remove_accents: $locale = false (@param
 string $locale optionally set a locale if you do not want to use the
 locale of the current language)

 so developers can pass a locale they want to use for this use case instead
 of the locale of the current installation.


 If that sounds good for you, I will update the PR

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54415#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list