diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index 494c1b3e61..ef42479bef 100644
|
a
|
b
|
function remove_accents( $string ) { |
| 1914 | 1914 | // Grave accent. |
| 1915 | 1915 | 'Ǜ' => 'U', |
| 1916 | 1916 | 'ǜ' => 'u', |
| | 1917 | // Persian. |
| | 1918 | '\xe2\x80\x8c' => '-', |
| | 1919 | '\xe2\x80\x8d' => '-', |
| | 1920 | '' => '-', |
| | 1921 | '' => '-', |
| 1917 | 1922 | ); |
| 1918 | 1923 | |
| 1919 | 1924 | // Used for locale-specific rules. |
diff --git a/tests/phpunit/data/languages/fa_IR.mo b/tests/phpunit/data/languages/fa_IR.mo
new file mode 100644
index 0000000000..d48a83077b
Binary files /dev/null and b/tests/phpunit/data/languages/fa_IR.mo differ
diff --git a/tests/phpunit/data/languages/fa_IR.po b/tests/phpunit/data/languages/fa_IR.po
new file mode 100644
index 0000000000..0771747621
|
-
|
+
|
|
| | 1 | # Translation of WordPress - 5.5.x - Development in Persian |
| | 2 | # This file is distributed under the same license as the WordPress - 5.5.x - Development package. |
| | 3 | msgid "" |
| | 4 | msgstr "" |
| | 5 | "PO-Revision-Date: 2020-09-26 15:02:46+0000\n" |
| | 6 | "MIME-Version: 1.0\n" |
| | 7 | "Content-Type: text/plain; charset=UTF-8\n" |
| | 8 | "Content-Transfer-Encoding: 8bit\n" |
| | 9 | "Plural-Forms: nplurals=1; plural=0;\n" |
| | 10 | "X-Generator: GlotPress/3.0.0-alpha.2\n" |
| | 11 | "Language: fa\n" |
| | 12 | "Project-Id-Version: WordPress - 5.5.x - Development\n" |
| | 13 | |
| | 14 | #: wp-includes/general-template.php:839 |
| | 15 | msgid "html_lang_attribute" |
| | 16 | msgstr "fa-IR" |
| | 17 | |
| | 18 | #. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. |
| | 19 | #: wp-includes/class-wp-locale.php:217 wp-includes/js/dist/i18n.js:1092 |
| | 20 | msgctxt "text direction" |
| | 21 | msgid "ltr" |
| | 22 | msgstr "rtl" |
diff --git a/tests/phpunit/tests/formatting/RemoveAccents.php b/tests/phpunit/tests/formatting/RemoveAccents.php
index e66b876e02..6c19321428 100644
|
a
|
b
|
class Tests_Formatting_RemoveAccents extends WP_UnitTestCase { |
| 143 | 143 | |
| 144 | 144 | $this->assertSame( 'Dd', remove_accents( 'Đđ' ) ); |
| 145 | 145 | } |
| | 146 | |
| | 147 | public function _set_locale_to_persian() { |
| | 148 | return 'fa_IR'; |
| | 149 | } |
| | 150 | |
| | 151 | /** |
| | 152 | * @ticket 50924 |
| | 153 | */ |
| | 154 | public function test_transcribe_persian_zwnj() { |
| | 155 | $wp_locale_switcher = new WP_Locale_Switcher(); |
| | 156 | $wp_locale_switcher->init(); |
| | 157 | $wp_locale_switcher->switch_to_locale( $this->_set_locale_to_persian() ); |
| | 158 | |
| | 159 | $this->assertSame( 'می-خواهم', remove_accents( 'می\xe2\x80\x8cخواهم') ); |
| | 160 | $this->assertSame( 'می-خواهم', remove_accents( 'می\xe2\x80\x8dخواهم') ); |
| | 161 | $this->assertSame( 'می-خواهم', remove_accents( 'میخواهم') ); |
| | 162 | $this->assertSame( 'می-خواهم', remove_accents( 'میخواهم') ); |
| | 163 | |
| | 164 | } |
| 146 | 165 | } |