Ticket #28303: 28303.2.patch
File 28303.2.patch, 5.8 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
1288 1288 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); 1289 1289 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 1290 1290 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); 1291 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 1291 $language_code = wp_get_language_code_of_locale(); 1292 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( $language_code ) ); 1292 1293 1293 1294 /** This filter is documented in wp-admin/admin-header.php */ 1294 1295 $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
629 629 } 630 630 } 631 631 632 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 632 $language_code = wp_get_language_code_of_locale(); 633 $body_class .= ' locale-' . sanitize_html_class( strtolower( $language_code ) ); 633 634 634 635 if ( !empty($set['tinymce']['body_class']) ) { 635 636 $body_class .= ' ' . $set['tinymce']['body_class']; -
src/wp-includes/formatting.php
1084 1084 ); 1085 1085 1086 1086 // Used for locale-specific rules 1087 $locale = get_locale();1087 $locale = wp_get_language_code_of_locale(); 1088 1088 1089 if ( 'de _DE' == $locale ) {1089 if ( 'de-DE' == $locale ) { 1090 1090 $chars[ chr(195).chr(132) ] = 'Ae'; 1091 1091 $chars[ chr(195).chr(164) ] = 'ae'; 1092 1092 $chars[ chr(195).chr(150) ] = 'Oe'; … … 1094 1094 $chars[ chr(195).chr(156) ] = 'Ue'; 1095 1095 $chars[ chr(195).chr(188) ] = 'ue'; 1096 1096 $chars[ chr(195).chr(159) ] = 'ss'; 1097 } elseif ( 'da _DK' === $locale ) {1097 } elseif ( 'da-DK' === $locale ) { 1098 1098 $chars[ chr(195).chr(134) ] = 'Ae'; 1099 1099 $chars[ chr(195).chr(166) ] = 'ae'; 1100 1100 $chars[ chr(195).chr(152) ] = '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_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.