WordPress.org

Make WordPress Core

Ticket #50924: 50924.2.diff

File 50924.2.diff, 2.7 KB (added by Mista-Flo, 12 months ago)

Fix huge po/mo file

  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index 494c1b3e61..ef42479bef 100644
    a b function remove_accents( $string ) { 
    19141914                        // Grave accent.
    19151915                        'Ǜ' => 'U',
    19161916                        'ǜ' => 'u',
     1917                        // Persian.
     1918                        '\xe2\x80\x8c' => '-',
     1919                        '\xe2\x80\x8d' => '-',
     1920                        '‌' => '-',
     1921                        '‍' => '-',
    19171922                );
    19181923
    19191924                // Used for locale-specific rules.
  • new file tests/phpunit/data/languages/fa_IR.po

    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.
     3msgid ""
     4msgstr ""
     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
     15msgid "html_lang_attribute"
     16msgstr "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
     20msgctxt "text direction"
     21msgid "ltr"
     22msgstr "rtl"
  • tests/phpunit/tests/formatting/RemoveAccents.php

    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 { 
    143143
    144144                $this->assertSame( 'Dd', remove_accents( 'Đđ' ) );
    145145        }
     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        }
    146165}