Ticket #29783: 29783.2.patch
| File 29783.2.patch, 14.1 KB (added by , 11 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 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); 161 161 162 162 if ( wp_is_mobile() ) 163 163 $admin_body_class .= ' mobile'; -
src/wp-admin/credits.php
22 22 */ 23 23 function wp_credits() { 24 24 global $wp_version; 25 $locale = get_ locale();25 $locale = get_user_locale(); 26 26 27 27 $results = get_site_transient( 'wordpress_credits_' . $locale ); 28 28 -
src/wp-admin/includes/class-wp-plugin-install-list-table.php
126 126 'active_installs' => true 127 127 ), 128 128 // Send the locale and installed plugin slugs to the API so it can provide context-sensitive results. 129 'locale' => get_ locale(),129 'locale' => get_user_locale(), 130 130 'installed_plugins' => $this->get_installed_plugin_slugs(), 131 131 ); 132 132 -
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 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); 1282 1282 1283 1283 /** This filter is documented in wp-admin/admin-header.php */ 1284 1284 $admin_body_classes = apply_filters( 'admin_body_class', '' ); -
src/wp-admin/includes/dashboard.php
1230 1230 $notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>"; 1231 1231 1232 1232 $browsehappy = 'http://browsehappy.com/'; 1233 $locale = get_ locale();1233 $locale = get_user_locale(); 1234 1234 if ( 'en_US' !== $locale ) 1235 1235 $browsehappy = add_query_arg( 'locale', $locale, $browsehappy ); 1236 1236 -
src/wp-admin/includes/import.php
125 125 function wp_get_popular_importers() { 126 126 include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version 127 127 128 $locale = get_ locale();128 $locale = get_user_locale(); 129 129 $popular_importers = get_site_transient( 'popular_importers_' . $locale ); 130 130 131 131 if ( ! $popular_importers ) { 132 $url = add_query_arg( 'locale', get_locale(), 'http://api.wordpress.org/core/importers/1.1/' );132 $url = add_query_arg( 'locale', $locale, 'http://api.wordpress.org/core/importers/1.1/' ); 133 133 $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url() ); 134 134 $response = wp_remote_get( $url, $options ); 135 135 $popular_importers = json_decode( wp_remote_retrieve_body( $response ), true ); -
src/wp-admin/includes/plugin-install.php
37 37 } 38 38 39 39 if ( ! isset( $args->locale ) ) { 40 $args->locale = get_ locale();40 $args->locale = get_user_locale(); 41 41 } 42 42 43 43 /** -
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 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); 1651 1651 1652 1652 if ( is_rtl() ) 1653 1653 $admin_body_class .= ' rtl'; -
src/wp-admin/includes/theme.php
327 327 } 328 328 329 329 if ( ! isset( $args->locale ) ) { 330 $args->locale = get_ locale();330 $args->locale = get_user_locale(); 331 331 } 332 332 333 333 /** -
src/wp-admin/includes/user.php
94 94 $user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' == $_POST['rich_editing'] ? 'false' : 'true'; 95 95 $user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh'; 96 96 $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false'; 97 $user->locale = ''; 98 if ( isset( $_POST['locale'] ) ) { 99 $user->locale = ( '' === $_POST['locale'] ) ? 'en_US' : $_POST['locale']; // @todo validation 100 } 97 101 } 98 102 99 103 $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : ''; -
src/wp-admin/plugin-editor.php
245 245 <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" /> 246 246 </div> 247 247 <?php if ( !empty( $docs_select ) ) : ?> 248 <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_ locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div>248 <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /></div> 249 249 <?php endif; ?> 250 250 <?php if ( is_writeable($real_file) ) : ?> 251 251 <?php if ( in_array( $file, (array) get_option( 'active_plugins', array() ) ) ) { ?> -
src/wp-admin/theme-editor.php
206 206 <div id="documentation" class="hide-if-no-js"> 207 207 <label for="docs-list"><?php _e('Documentation:') ?></label> 208 208 <?php echo $docs_select; ?> 209 <input type="button" class="button" value=" <?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_ locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" />209 <input type="button" class="button" value=" <?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ) ?>&version=<?php echo urlencode( $wp_version ) ?>&redirect=true'); }" /> 210 210 </div> 211 211 <?php endif; ?> 212 212 -
src/wp-admin/user-edit.php
274 274 </fieldset> 275 275 </td> 276 276 </tr> 277 277 278 <?php 279 $languages = get_available_languages(); 280 if ( $languages ) : ?> 281 <tr class="user-language-wrap"> 282 <th scope="row"> 283 <label for="site_language"><?php _e( 'Site Language' ); ?></label> 284 </th> 285 <td> 286 <?php 287 $lang = get_user_option( 'locale', $profileuser->ID ); 288 var_dump($lang); 289 if ( 'en_US' === $lang ) { // en_US 290 $lang = false; 291 } elseif ( ! in_array( $lang, $languages ) ) { 292 $lang = get_locale(); 293 } 294 295 wp_dropdown_languages( array( 296 'name' => 'locale', 297 'id' => 'locale', 298 'selected' => $lang, 299 'languages' => $languages, 300 'show_available_translations' => false 301 ) ); 302 ?> 303 </td> 304 </tr> 305 <?php 306 endif; 307 ?> 308 309 <?php 278 310 /** 279 311 * Fires at the end of the 'Personal Options' settings table on the user editing screen. 280 312 * -
src/wp-includes/class-wp-editor.php
311 311 if ( empty( self::$first_init ) ) { 312 312 self::$baseurl = includes_url( 'js/tinymce' ); 313 313 314 $mce_locale = get_ locale();314 $mce_locale = get_user_locale(); 315 315 self::$mce_locale = $mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1 316 316 317 317 /** This filter is documented in wp-admin/includes/media.php */ … … 629 629 } 630 630 } 631 631 632 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_ locale() ) ) );632 $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); 633 633 634 634 if ( !empty($set['tinymce']['body_class']) ) { 635 635 $body_class .= ' ' . $set['tinymce']['body_class']; -
src/wp-includes/class-wp-theme.php
1264 1264 * @access public 1265 1265 */ 1266 1266 public static function sort_by_name( &$themes ) { 1267 if ( 0 === strpos( get_ locale(), 'en_' ) ) {1267 if ( 0 === strpos( get_user_locale(), 'en_' ) ) { 1268 1268 uasort( $themes, array( 'WP_Theme', '_name_sort' ) ); 1269 1269 } else { 1270 1270 uasort( $themes, array( 'WP_Theme', '_name_sort_i18n' ) ); -
src/wp-includes/l10n.php
75 75 } 76 76 77 77 /** 78 * Get the locale of current user. 79 * 80 * Returns {@see get_locale()} for non-admin requests. 81 * 82 * If the user has a locale set to an non-empty string then it will be 83 * returned. Otherwise it returns the locale of {@see get_locale()}. 84 * 85 * @return string The locale of the current user. 86 */ 87 function get_user_locale() { 88 if ( ! is_admin() ) { 89 return get_locale(); 90 } 91 92 $user = wp_get_current_user(); 93 94 if ( ! $user ) { 95 return get_locale(); 96 } 97 98 $locale = $user->locale; 99 return ( '' === $locale ) ? get_locale() : $locale; 100 } 101 102 /** 78 103 * Retrieve the translation of $text. 79 104 * 80 105 * If there is no translation, or the text domain isn't loaded, the original text is returned. … … 549 574 */ 550 575 function load_default_textdomain( $locale = null ) { 551 576 if ( null === $locale ) { 552 $locale = get_ locale();577 $locale = get_user_locale(); 553 578 } 554 579 555 580 // Unload previously loaded strings so we can switch translations. -
src/wp-includes/user.php
2025 2025 2026 2026 $meta['show_admin_bar_front'] = empty( $userdata['show_admin_bar_front'] ) ? 'true' : $userdata['show_admin_bar_front']; 2027 2027 2028 $meta['locale'] = isset( $userdata['locale'] ) ? $userdata['locale']: ''; 2029 2028 2030 $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login)); 2029 2031 2030 2032 if ( $user_nicename_check ) { … … 2205 2207 * @return array 2206 2208 */ 2207 2209 function _get_additional_user_keys( $user ) { 2208 $keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front' );2210 $keys = array( 'first_name', 'last_name', 'nickname', 'description', 'rich_editing', 'comment_shortcuts', 'admin_color', 'use_ssl', 'show_admin_bar_front', 'locale' ); 2209 2211 return array_merge( $keys, array_keys( wp_get_user_contact_methods( $user ) ) ); 2210 2212 } 2211 2213 -
src/wp-settings.php
305 305 // Load the default text localization domain. 306 306 load_default_textdomain(); 307 307 308 $locale = get_ locale();308 $locale = get_user_locale(); 309 309 $locale_file = WP_LANG_DIR . "/$locale.php"; 310 310 if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) 311 311 require( $locale_file );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)