WordPress.org

Make WordPress Core

Changeset 37853


Ignore:
Timestamp:
06/23/2016 01:27:32 PM (4 years ago)
Author:
ocean90
Message:

I18N: Add support for the Catalan flown dot in remove_accents().

Props xavivars, SergeyBiryukov.
Fixes #37086.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r37852 r37853  
    14851485 * | U+00E5   | å     | aa          | Latin small letter a with ring above    |
    14861486 *
     1487 * Catalan (`ca`) locale:
     1488 *
     1489 * |   Code   | Glyph | Replacement |               Description               |
     1490 * | -------- | ----- | ----------- | --------------------------------------- |
     1491 * | U+00B7   | l·l   | ll          | Flown dot (between two Ls)              |
     1492 *
    14871493 * @since 1.2.1
    1488  * @since 4.6.0 Locale support was added for `de_CH` and `de_CH_informal`.
     1494 * @since 4.6.0 Locale support was added for `de_CH`, `de_CH_informal`, and `ca`.
    14891495 *
    14901496 * @param string $string Text that might have accent characters
     
    16901696            $chars[ chr(195).chr(133) ] = 'Aa';
    16911697            $chars[ chr(195).chr(165) ] = 'aa';
     1698        } elseif ( 'ca' === $locale ) {
     1699            $chars[ chr(108).chr(194).chr(183).chr(108) ] = 'll';
    16921700        }
    16931701
  • trunk/tests/phpunit/tests/formatting/RemoveAccents.php

    r26585 r37853  
    111111    }
    112112
     113    public function _set_locale_to_catalan() {
     114        return 'ca';
     115    }
     116
     117    /**
     118    * @ticket 37086
     119    */
     120    public function test_remove_catalan_middot() {
     121        add_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
     122
     123        $this->assertEquals( 'allallalla', remove_accents( 'al·lallaŀla' ) );
     124       
     125        remove_filter( 'locale', array( $this, '_set_locale_to_catalan' ) );
     126       
     127        $this->assertEquals( 'al·lallalla', remove_accents( 'al·lallaŀla' ) );
     128    }
    113129}
Note: See TracChangeset for help on using the changeset viewer.