Skip to content

Commit 3c9a253

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61542 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 438132f commit 3c9a253

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/wp-includes/class-wp-dependencies.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,10 @@ public function get_etag( $load ) {
569569
*/
570570
protected function get_dependency_warning_message( $handle, $missing_dependency_handles ) {
571571
return sprintf(
572-
/* translators: 1: Handle, 2: Comma-separated list of missing dependency handles. */
572+
/* translators: 1: Handle, 2: List of missing dependency handles. */
573573
__( 'The handle "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
574574
$handle,
575-
implode( ', ', $missing_dependency_handles )
575+
implode( wp_get_list_item_separator(), $missing_dependency_handles )
576576
);
577577
}
578578
}

src/wp-includes/class-wp-script-modules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,10 @@ private function sort_item_dependencies( string $id, array $import_types, array
739739
_doing_it_wrong(
740740
get_class( $this ) . '::register',
741741
sprintf(
742-
/* translators: 1: Script module ID, 2: Comma-separated list of missing dependency IDs. */
742+
/* translators: 1: Script module ID, 2: List of missing dependency IDs. */
743743
__( 'The script module with the ID "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
744744
$id,
745-
implode( ', ', $missing_dependencies )
745+
implode( wp_get_list_item_separator(), $missing_dependencies )
746746
),
747747
'6.9.1'
748748
);

src/wp-includes/class-wp-scripts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,10 +1191,10 @@ public function reset() {
11911191
*/
11921192
protected function get_dependency_warning_message( $handle, $missing_dependency_handles ) {
11931193
return sprintf(
1194-
/* translators: 1: Script handle, 2: Comma-separated list of missing dependency handles. */
1194+
/* translators: 1: Script handle, 2: List of missing dependency handles. */
11951195
__( 'The script with the handle "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
11961196
$handle,
1197-
implode( ', ', $missing_dependency_handles )
1197+
implode( wp_get_list_item_separator(), $missing_dependency_handles )
11981198
);
11991199
}
12001200
}

src/wp-includes/class-wp-styles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,10 @@ public function reset() {
493493
*/
494494
protected function get_dependency_warning_message( $handle, $missing_dependency_handles ) {
495495
return sprintf(
496-
/* translators: 1: Style handle, 2: Comma-separated list of missing dependency handles. */
496+
/* translators: 1: Style handle, 2: List of missing dependency handles. */
497497
__( 'The style with the handle "%1$s" was enqueued with dependencies that are not registered: %2$s.' ),
498498
$handle,
499-
implode( ', ', $missing_dependency_handles )
499+
implode( wp_get_list_item_separator(), $missing_dependency_handles )
500500
);
501501
}
502502
}

0 commit comments

Comments
 (0)