Skip to content

Commit

Permalink
Update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cbravobernal committed May 8, 2024
1 parent 4154925 commit 4b78690
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ private function process_directives_args( string $html, array &$context_stack, a
*/
if ( 'SVG' === $tag_name || 'MATH' === $tag_name ) {
if ( $p->get_attribute_names_with_prefix( 'data-wp-' ) ) {
/* translators: %s: SVG or MATH HTML tag. */
$message = sprintf( __( '%s tags are currently incompatible with the directives processing. Please refrain from adding directives to them.' ), $tag_name );
/* translators: 1: SVG or MATH HTML tag, 2: Namespace of the interactive block. */
$message = sprintf( __( 'Interactivity directives were detected on an incompatible %1$s tag when processing "%2$s". These directives will be ignored.' ), $tag_name, end( $namespace_stack ) );
_doing_it_wrong( __METHOD__, $message, '6.6.0' );
}
$p->skip_to_tag_closer();
Expand Down Expand Up @@ -362,8 +362,9 @@ private function process_directives_args( string $html, array &$context_stack, a
* display a notice to the developer to inform them about the issue.
*/
if ( $unbalanced || 0 < count( $tag_stack ) ) {
$tag_errored = 0 < count( $tag_stack ) ? end( $tag_stack )[0] : $tag_name;
/* translators: %s: Tag that caused the error, could by any HTML tag. */
$message = sprintf( __( 'Due to an unbalanced %s tag in the processed HTML, the directives will not be server side processed, JS runtime still work, but there will be a layout shift.' ), $tag_name );
$message = sprintf( __( 'Interactivity directives failed to process in "%1$s" due to a missing "%2$s" end tag.' ), end( $namespace_stack ), $tag_errored );
_doing_it_wrong( __METHOD__, $message, '6.6.0' );
return null;
}
Expand Down

0 comments on commit 4b78690

Please sign in to comment.