mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 04:04:35 +00:00
I18N: Make domain argument optional in wp_set_script_translations() / WP_Scripts::set_translations().
Props swissspidy. Fixes #45489. git-svn-id: https://develop.svn.wordpress.org/trunk@44395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -466,16 +466,16 @@ function wp_default_packages_scripts( &$scripts ) {
|
||||
);
|
||||
|
||||
$package_translations = array(
|
||||
'api-fetch' => 'default',
|
||||
'blocks' => 'default',
|
||||
'block-library' => 'default',
|
||||
'components' => 'default',
|
||||
'edit-post' => 'default',
|
||||
'editor' => 'default',
|
||||
'format-library' => 'default',
|
||||
'keycodes' => 'default',
|
||||
'list-reusable-blocks' => 'default',
|
||||
'nux' => 'default',
|
||||
'api-fetch',
|
||||
'blocks',
|
||||
'block-library',
|
||||
'components',
|
||||
'edit-post',
|
||||
'editor',
|
||||
'format-library',
|
||||
'keycodes',
|
||||
'list-reusable-blocks',
|
||||
'nux',
|
||||
);
|
||||
|
||||
foreach ( $packages_dependencies as $package => $dependencies ) {
|
||||
@@ -485,8 +485,8 @@ function wp_default_packages_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( $handle, $path, $dependencies, $version, 1 );
|
||||
|
||||
if ( isset( $package_translations[ $package ] ) ) {
|
||||
$scripts->set_translations( $handle, $package_translations[ $package ] );
|
||||
if ( in_array( $package, $package_translations, true ) ) {
|
||||
$scripts->set_translations( $handle );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user