WordPress 4.7.1
[autoinstalls/wordpress.git] / wp-includes / customize / class-wp-customize-selective-refresh.php
index 2342aef9baa421e7fc60a701b9f6d96cd8eea376..af0c74d67b7fac53a5164f36447595f01fc5f87d 100644 (file)
@@ -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.