X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/16e7b37c7914d753890c1a05a9335f3b43751eb8..refs/tags/wordpress-4.7.1:/wp-includes/customize/class-wp-customize-selective-refresh.php diff --git a/wp-includes/customize/class-wp-customize-selective-refresh.php b/wp-includes/customize/class-wp-customize-selective-refresh.php index 2342aef9..af0c74d6 100644 --- a/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -179,18 +179,24 @@ final class WP_Customize_Selective_Refresh { } } + $switched_locale = switch_to_locale( get_user_locale() ); + $l10n = array( + 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ), + 'clickEditMenu' => __( 'Click to edit this menu.' ), + 'clickEditWidget' => __( 'Click to edit this widget.' ), + 'clickEditTitle' => __( 'Click to edit the site title.' ), + 'clickEditMisc' => __( 'Click to edit this element.' ), + /* translators: %s: document.write() */ + 'badDocumentWrite' => sprintf( __( '%s is forbidden' ), 'document.write()' ), + ); + if ( $switched_locale ) { + restore_previous_locale(); + } + $exports = array( 'partials' => $partials, 'renderQueryVar' => self::RENDER_QUERY_VAR, - 'l10n' => array( - 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ), - 'clickEditMenu' => __( 'Click to edit this menu.' ), - 'clickEditWidget' => __( 'Click to edit this widget.' ), - 'clickEditTitle' => __( 'Click to edit the site title.' ), - 'clickEditMisc' => __( 'Click to edit this element.' ), - /* translators: %s: document.write() */ - 'badDocumentWrite' => sprintf( __( '%s is forbidden' ), 'document.write()' ), - ), + 'l10n' => $l10n, ); // Export data to JS.