Make WordPress Core


Ignore:
Timestamp:
12/08/2016 07:31:37 PM (8 years ago)
Author:
westonruter
Message:

Customize: Use selected user language for edit shortcuts in preview instead of site language.

Props ocean90.
Fixes #39009.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r39506 r39545  
    17771777            $allowed_hosts[] = $host;
    17781778        }
     1779
     1780        $switched_locale = switch_to_locale( get_user_locale() );
     1781        $l10n = array(
     1782            'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
     1783            'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
     1784            'formUnpreviewable' => __( 'This form is not live-previewable.' ),
     1785        );
     1786        if ( $switched_locale ) {
     1787            restore_previous_locale();
     1788        }
     1789
    17791790        $settings = array(
    17801791            'changeset' => array(
     
    18011812            'settingValidities' => $exported_setting_validities,
    18021813            'nonce' => current_user_can( 'customize' ) ? $this->get_nonces() : array(),
    1803             'l10n' => array(
    1804                 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
    1805                 'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
    1806                 'formUnpreviewable' => __( 'This form is not live-previewable.' ),
    1807             ),
     1814            'l10n' => $l10n,
    18081815            '_dirty' => array_keys( $post_values ),
    18091816        );
Note: See TracChangeset for help on using the changeset viewer.