Commit 8305d33d96 for wordpress.org
commit 8305d33d9683bf1641b597692e00b86e65ca852d
Author: wildworks <wildworks@git.wordpress.org>
Date: Wed Jan 28 01:07:42 2026 +0000
Script Loader: Use localized list separators in dependency warning messages.
Improve dependency warning messages so that list separators are localized according to the current locale when multiple dependencies are listed.
Follow-up to [61323], [60999], [61357].
Props mukeshpanchal27, jorbin, westonruter, wildworks.
See #64229.
Built from https://develop.svn.wordpress.org/trunk@61542
git-svn-id: http://core.svn.wordpress.org/trunk@60853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/class-wp-dependencies.php b/wp-includes/class-wp-dependencies.php
index a3182c8697..c2daba389b 100644
--- a/wp-includes/class-wp-dependencies.php
+++ b/wp-includes/class-wp-dependencies.php
@@ -569,10 +569,10 @@ class WP_Dependencies {
*/
protected function get_dependency_warning_message( $handle, $missing_dependency_handles ) {
return sprintf(
- /* translators: 1: Handle, 2: Comma-separated list of missing dependency handles. */
+ /* translators: 1: Handle, 2: List of missing dependency handles. */
__( 'The handle "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
$handle,
- implode( ', ', $missing_dependency_handles )
+ implode( wp_get_list_item_separator(), $missing_dependency_handles )
);
}
}
diff --git a/wp-includes/class-wp-script-modules.php b/wp-includes/class-wp-script-modules.php
index 6889b5f09a..abbbd6383f 100644
--- a/wp-includes/class-wp-script-modules.php
+++ b/wp-includes/class-wp-script-modules.php
@@ -739,10 +739,10 @@ class WP_Script_Modules {
_doing_it_wrong(
get_class( $this ) . '::register',
sprintf(
- /* translators: 1: Script module ID, 2: Comma-separated list of missing dependency IDs. */
+ /* translators: 1: Script module ID, 2: List of missing dependency IDs. */
__( 'The script module with the ID "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
$id,
- implode( ', ', $missing_dependencies )
+ implode( wp_get_list_item_separator(), $missing_dependencies )
),
'6.9.1'
);
diff --git a/wp-includes/class-wp-scripts.php b/wp-includes/class-wp-scripts.php
index 8c02c5af98..0ed7087a93 100644
--- a/wp-includes/class-wp-scripts.php
+++ b/wp-includes/class-wp-scripts.php
@@ -1191,10 +1191,10 @@ JS;
*/
protected function get_dependency_warning_message( $handle, $missing_dependency_handles ) {
return sprintf(
- /* translators: 1: Script handle, 2: Comma-separated list of missing dependency handles. */
+ /* translators: 1: Script handle, 2: List of missing dependency handles. */
__( 'The script with the handle "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
$handle,
- implode( ', ', $missing_dependency_handles )
+ implode( wp_get_list_item_separator(), $missing_dependency_handles )
);
}
}
diff --git a/wp-includes/class-wp-styles.php b/wp-includes/class-wp-styles.php
index ad5564124c..53437fe23b 100644
--- a/wp-includes/class-wp-styles.php
+++ b/wp-includes/class-wp-styles.php
@@ -493,10 +493,10 @@ class WP_Styles extends WP_Dependencies {
*/
protected function get_dependency_warning_message( $handle, $missing_dependency_handles ) {
return sprintf(
- /* translators: 1: Style handle, 2: Comma-separated list of missing dependency handles. */
+ /* translators: 1: Style handle, 2: List of missing dependency handles. */
__( 'The style with the handle "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
$handle,
- implode( ', ', $missing_dependency_handles )
+ implode( wp_get_list_item_separator(), $missing_dependency_handles )
);
}
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index fab375dc75..4e0a0e0d51 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61539';
+$wp_version = '7.0-alpha-61542';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.