[wp-trac] [WordPress Trac] #32939: Add filter for get_locale() in remove_accents()
WordPress Trac
noreply at wordpress.org
Thu Jul 9 12:37:21 UTC 2015
#32939: Add filter for get_locale() in remove_accents()
-------------------------+------------------------------
Reporter: akirk | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by akirk):
Not sure where you'd suggest to put a parameter?
For example, when creating a slug for a new post, the blog language is
German but with a different locale than `de_DE`. So to have a way to
rewrite the locale to the expected value (to make use of the special cases
defined here), a filter (as in the patch) works as a simple solution.
Another option would be to remove the hardcoded `de_DE` and do that with a
filter:
{{{
if ( apply_filters( 'locale_de_DE', 'de_DE' ) === $locale ) {
...
} elseif ( apply_filters( 'locale_da_DK', 'da_DK' ) === $locale ) {
...
}
}}}
To me the solution from the current patch seems a bit more flexible.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32939#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list