Remove certain accents in the Danish language.

props tlamedia.
fixes #23907.


git-svn-id: https://develop.svn.wordpress.org/trunk@26585 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-12-03 20:38:03 +00:00
parent 8722b53c96
commit 7b9c30f2e3
2 changed files with 23 additions and 0 deletions

View File

@ -812,6 +812,13 @@ function remove_accents($string) {
$chars[ chr(195).chr(156) ] = 'Ue';
$chars[ chr(195).chr(188) ] = 'ue';
$chars[ chr(195).chr(159) ] = 'ss';
} elseif ( 'da_DK' === $locale ) {
$chars[ chr(195).chr(134) ] = 'Ae';
$chars[ chr(195).chr(166) ] = 'ae';
$chars[ chr(195).chr(152) ] = 'Oe';
$chars[ chr(195).chr(184) ] = 'oe';
$chars[ chr(195).chr(133) ] = 'Aa';
$chars[ chr(195).chr(165) ] = 'aa';
}
$string = strtr($string, $chars);

View File

@ -94,4 +94,20 @@ class Tests_Formatting_RemoveAccents extends WP_UnitTestCase {
remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
}
public function _set_locale_to_danish() {
return 'da_DK';
}
/**
* @ticket 23907
*/
public function test_remove_danish_accents() {
add_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
$this->assertEquals( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );
remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
}
}