diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php
index f63517f7e1..aa4935da6b 100644
--- a/wp-includes/class.wp-scripts.php
+++ b/wp-includes/class.wp-scripts.php
@@ -311,6 +311,11 @@ class WP_Scripts extends WP_Dependencies {
$inline_script_tag = '';
}
+ $translations = $this->print_translations( $handle, false );
+ if ( $translations ) {
+ $translations = sprintf( "\n", $this->type_attr, esc_attr( $handle ), $translations );
+ }
+
if ( $this->do_concat ) {
/**
* Filters the script loader source.
@@ -322,7 +327,7 @@ class WP_Scripts extends WP_Dependencies {
*/
$srce = apply_filters( 'script_loader_src', $src, $handle );
- if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle ) ) {
+ if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations ) ) {
$this->do_concat = false;
// Have to print the so-far concatenated scripts right away to maintain the right order.
@@ -364,11 +369,6 @@ class WP_Scripts extends WP_Dependencies {
return true;
}
- $translations = $this->print_translations( $handle, false );
- if ( $translations ) {
- $translations = sprintf( "\n", $this->type_attr, esc_attr( $handle ), $translations );
- }
-
if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
$src = $this->base_url . $src;
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 6bd11823eb..f8b76e14ff 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.6-alpha-48895';
+$wp_version = '5.6-alpha-48897';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.