Ticket #28303: 28303.patch
File 28303.patch, 4.9 KB (added by , 9 years ago) |
---|
-
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_language_code_of_locale(); 92 $body_class .= ' locale-' . sanitize_html_class( 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
1278 1278 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); 1279 1279 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 1280 1280 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); 1281 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 1281 $language_code = wp_get_language_code_of_locale(); 1282 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( $language_code ) ); 1282 1283 1283 1284 /** This filter is documented in wp-admin/admin-header.php */ 1284 1285 $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_language_code_of_locale(); 1651 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( $language_code ) ); 1651 1652 1652 1653 if ( is_rtl() ) 1653 1654 $admin_body_class .= ' rtl'; -
src/wp-includes/class-wp-editor.php
628 628 } 629 629 } 630 630 631 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 631 $language_code = wp_get_language_code_of_locale(); 632 $body_class .= ' locale-' . sanitize_html_class( strtolower( $language_code ) ); 632 633 633 634 if ( !empty($set['tinymce']['body_class']) ) { 634 635 $body_class .= ' ' . $set['tinymce']['body_class']; -
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_language_code_of_locale(); 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_language_code_of_locale( $locale = '' ) { 870 if ( ! $locale ) { 871 $locale = get_locale(); 872 } 873 874 preg_match( '/^([a-z]{2,3}(_[A-Z]{2})?)/', $locale, $matches ); 875 if ( $matches && $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_language_code_of_locale(); 137 $classes[] =' locale-' . sanitize_html_class( strtolower( $language_code ) ); 137 138 138 139 /** 139 140 * Filter the login page body classes.