Make WordPress Core

Changeset 61542


Ignore:
Timestamp:
01/28/2026 01:06:35 AM (7 months ago)
Author:
wildworks
Message:

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.

Location:
trunk/src/wp-includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-dependencies.php

    r61470 r61542  
    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        }
  • trunk/src/wp-includes/class-wp-script-modules.php

    r61401 r61542  
    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'
  • trunk/src/wp-includes/class-wp-scripts.php

    r61442 r61542  
    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        }
  • trunk/src/wp-includes/class-wp-styles.php

    r61463 r61542  
    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        }
Note: See TracChangeset for help on using the changeset viewer.