Ticket #28303: 28303.3.patch
File 28303.3.patch, 6.8 KB (added by , 9 years ago) |
---|
-
src/wp-admin/admin-header.php
157 157 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); 158 158 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 159 159 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); 160 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 160 $language_code = wp_get_html_language_code(); 161 $admin_body_class .= ' locale-' . strtolower( $language_code ); 161 162 162 163 if ( wp_is_mobile() ) 163 164 $admin_body_class .= ' mobile'; -
src/wp-admin/customize.php
87 87 if ( is_rtl() ) { 88 88 $body_class .= ' rtl'; 89 89 } 90 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );91 90 91 $language_code = wp_get_html_language_code(); 92 $body_class .= ' locale-' . strtolower( $language_code ); 93 92 94 if ( $wp_customize->is_theme_active() ) { 93 95 $document_title_tmpl = _x( 'Customize: %s', 'Placeholder is the document title from the preview' ); 94 96 } else { -
src/wp-admin/includes/class-wp-press-this.php
1298 1298 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); 1299 1299 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 1300 1300 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); 1301 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 1301 $language_code = wp_get_html_language_code(); 1302 $admin_body_class .= ' locale-' . strtolower( $language_code ); 1302 1303 1303 1304 /** This filter is documented in wp-admin/admin-header.php */ 1304 1305 $admin_body_classes = apply_filters( 'admin_body_class', '' ); -
src/wp-admin/includes/template.php
1647 1647 /** This action is documented in wp-admin/admin-header.php */ 1648 1648 do_action( 'admin_head' ); 1649 1649 1650 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 1650 $language_code = wp_get_html_language_code(); 1651 $admin_body_class .= ' locale-' . strtolower( $language_code ); 1651 1652 1652 1653 if ( is_rtl() ) 1653 1654 $admin_body_class .= ' rtl'; -
src/wp-includes/class-wp-editor.php
655 655 } 656 656 } 657 657 658 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 658 $language_code = wp_get_html_language_code(); 659 $body_class .= ' locale-' . strtolower( $language_code ); 659 660 660 661 if ( !empty($set['tinymce']['body_class']) ) { 661 662 $body_class .= ' ' . $set['tinymce']['body_class']; -
src/wp-includes/formatting.php
1138 1138 // Used for locale-specific rules 1139 1139 $locale = get_locale(); 1140 1140 1141 if ( 'de_DE' == $locale ) {1141 if ( 'de_DE' == $locale || 'de_DE_formal' == $locale ) { 1142 1142 $chars[ chr(195).chr(132) ] = 'Ae'; 1143 1143 $chars[ chr(195).chr(164) ] = 'ae'; 1144 1144 $chars[ chr(195).chr(150) ] = 'Oe'; -
src/wp-includes/general-template.php
665 665 $output = $wp_version; 666 666 break; 667 667 case 'language': 668 $output = get_locale(); 669 $output = str_replace('_', '-', $output); 668 $output = wp_get_html_language_code(); 670 669 break; 671 670 case 'text_direction': 672 671 _deprecated_argument( __FUNCTION__, '2.2', sprintf( -
src/wp-includes/l10n.php
820 820 if ( substr( $file, -3 ) !== '.po' ) { 821 821 continue; 822 822 } 823 if ( ! preg_match( '/(?:(.+)-)?([ A-Za-z_]{2,6}).po/', $file, $match ) ) {823 if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z]+)?).po/', $file, $match ) ) { 824 824 continue; 825 825 } 826 826 if ( ! in_array( substr( $file, 0, -3 ) . '.mo', $files ) ) { … … 859 859 } 860 860 861 861 /** 862 * Extract the language code from a locale. 863 * 864 * @since 4.3.0 865 * 866 * @param string $locale Optional. Locale to parse. 867 * @return string Language code. 868 */ 869 function wp_get_html_language_code( $locale = '' ) { 870 if ( ! $locale ) { 871 $locale = get_locale(); 872 } 873 874 preg_match( '/^([a-z]{2,3}(_[A-Z]{2})?)/', $locale, $matches ); 875 if ( ! empty( $matches[1] ) ) { 876 return str_replace( '_', '-', $matches[1] ); 877 } 878 879 return ''; 880 } 881 882 /** 862 883 * Language selector. 863 884 * 864 885 * @since 4.0.0 -
src/wp-login.php
133 133 if ( 'success' === $interim_login ) 134 134 $classes[] = 'interim-login-success'; 135 135 } 136 $classes[] =' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 136 $language_code = wp_get_html_language_code(); 137 $classes[] =' locale-' . strtolower( $language_code ); 137 138 138 139 /** 139 140 * Filter the login page body classes. -
tests/phpunit/tests/l10n.php
16 16 $this->assertTrue( unload_textdomain( 'wp-tests-domain' ) ); 17 17 $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) ); 18 18 } 19 20 /** 21 * @dataProvider locales 22 */ 23 function test_wp_get_html_language_code( $locale, $expected ) { 24 $this->assertEquals( $expected, wp_get_html_language_code( $locale ) ); 25 } 26 27 function locales() { 28 return array( 29 'ar' => 'ar', 30 'de_DE' => 'de-DE', 31 'de_DE_formal' => 'de-DE', 32 'oci' => 'oci', 33 ); 34 } 19 35 }