Changeset 50259
- Timestamp:
- 02/08/2021 11:49:33 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/package-lock.json
r50235 r50259 3932 3932 "unbzip2-stream": "^1.3.3", 3933 3933 "ws": "^7.2.3" 3934 }, 3935 "dependencies": { 3936 "devtools-protocol": { 3937 "version": "0.0.818844", 3938 "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.818844.tgz", 3939 "integrity": "sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==", 3940 "dev": true 3941 } 3934 3942 } 3935 3943 }, … … 8057 8065 "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", 8058 8066 "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", 8059 "dev": true8060 },8061 "devtools-protocol": {8062 "version": "0.0.818844",8063 "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.818844.tgz",8064 "integrity": "sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==",8065 8067 "dev": true 8066 8068 }, -
trunk/src/wp-includes/script-loader.php
r50155 r50259 267 267 if ( in_array( 'wp-i18n', $dependencies, true ) ) { 268 268 $scripts->set_translations( $handle ); 269 } 270 271 // Manually set the text direction localization after wp-i18n is 272 // printed. This ensures that wp.i18n.isRTL() returns true in RTL 273 // languages. We cannot use $scripts->set_translations( 'wp-i18n' ) to 274 // do this because WordPress prints a script's translations *before* 275 // printing the script, which means, in the case of wp-i18n, that 276 // wp.i18n.setLocaleData() is called before wp.i18n is defined. 277 if ( 'wp-i18n' === $handle ) { 278 $ltr = _x( 'ltr', 'text direction', 'default' ); 279 $script = sprintf( "wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ '%s' ] } );", $ltr ); 280 $scripts->add_inline_script( $handle, $script, 'after' ); 269 281 } 270 282 } -
trunk/tests/phpunit/tests/dependencies/scripts.php
r50137 r50259 724 724 $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/hooks{$suffix}.js' id='wp-hooks-js'></script>\n"; 725 725 $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/i18n{$suffix}.js' id='wp-i18n-js'></script>\n"; 726 $expected .= "<script type='text/javascript' id='wp-i18n-js-after'>\n"; 727 $expected .= "wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } );\n"; 728 $expected .= "</script>\n"; 726 729 $expected .= "<script type='text/javascript' id='wp-a11y-js-translations'>\n"; 727 730 $expected .= "( function( domain, translations ) {\n";
Note: See TracChangeset
for help on using the changeset viewer.