Skip to content

Commit e1d0ac9

Browse files
Improve translatability of error message
Co-authored-by: swissspidy <[email protected]>
1 parent 6856026 commit e1d0ac9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plugins/image-prioritizer/helper.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,15 @@ function image_prioritizer_filter_store_url_metric_data( $data ): array {
290290
*
291291
* @noinspection PhpUnhandledExceptionInspection
292292
*/
293-
wp_trigger_error( __FUNCTION__, $image_validity->get_error_message() . ' Background image URL: ' . $data['lcpElementExternalBackgroundImage']['url'] );
293+
wp_trigger_error(
294+
__FUNCTION__,
295+
sprintf(
296+
/* translators: 1: error message. 2: image url */
297+
__( 'Error: %1$s. Background image URL: %2$s.', 'image-prioritizer' ),
298+
rtrim( $image_validity->get_error_message(), '.' ),
299+
$data['lcpElementExternalBackgroundImage']['url']
300+
)
301+
);
294302
unset( $data['lcpElementExternalBackgroundImage'] );
295303
}
296304
}

0 commit comments

Comments
 (0)