From 998a98d510a4f67dbe42025d9253378968bb1487 Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Tue, 23 Jun 2026 14:07:02 +0530 Subject: [PATCH] I18N: Use `/* */` block style for translator comments. Convert the remaining `// translators:` line comments to the `/* translators: */` block style used throughout core, for consistency with the documented i18n coding standards. Files under `wp-includes/blocks/` are intentionally excluded, as they are maintained in the Gutenberg plugin and need to be changed there first. See #65518. --- src/wp-admin/includes/class-wp-site-health.php | 8 ++++---- src/wp-admin/site-health.php | 2 +- .../abilities-api/class-wp-abilities-registry.php | 2 +- .../class-wp-ability-categories-registry.php | 2 +- src/wp-includes/class-wp-icons-registry.php | 2 +- src/wp-includes/fonts/class-wp-font-collection.php | 6 +++--- src/wp-includes/html-api/class-wp-html-processor.php | 4 ++-- .../rest-api/endpoints/class-wp-rest-icons-controller.php | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 8274f8bd01b3c..a971d7208a442 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -2241,12 +2241,12 @@ public function get_test_rest_availability() { '

%s

%s
%s

', __( 'When testing the REST API, an error was encountered:' ), sprintf( - // translators: %s: The REST API URL. + /* translators: %s: The REST API URL. */ __( 'REST API Endpoint: %s' ), $url ), sprintf( - // translators: 1: The WordPress error code. 2: The WordPress error message. + /* translators: 1: The WordPress error code. 2: The WordPress error message. */ __( 'REST API Response: (%1$s) %2$s' ), $r->get_error_code(), $r->get_error_message() @@ -2261,12 +2261,12 @@ public function get_test_rest_availability() { '

%s

%s
%s

', __( 'When testing the REST API, an unexpected result was returned:' ), sprintf( - // translators: %s: The REST API URL. + /* translators: %s: The REST API URL. */ __( 'REST API Endpoint: %s' ), $url ), sprintf( - // translators: 1: The WordPress error code. 2: The HTTP status code error message. + /* translators: 1: The WordPress error code. 2: The HTTP status code error message. */ __( 'REST API Response: (%1$s) %2$s' ), wp_remote_retrieve_response_code( $r ), wp_remote_retrieve_response_message( $r ) diff --git a/src/wp-admin/site-health.php b/src/wp-admin/site-health.php index ac6dd1523e7ca..d0e0227420635 100644 --- a/src/wp-admin/site-health.php +++ b/src/wp-admin/site-health.php @@ -39,7 +39,7 @@ $current_tab = $_GET['tab'] ?? ''; $title = sprintf( - // translators: %s: The currently displayed tab. + /* translators: %s: The currently displayed tab. */ __( 'Site Health - %s' ), ( isset( $tabs[ $current_tab ] ) ? esc_html( $tabs[ $current_tab ] ) : esc_html( reset( $tabs ) ) ) ); diff --git a/src/wp-includes/abilities-api/class-wp-abilities-registry.php b/src/wp-includes/abilities-api/class-wp-abilities-registry.php index ecd6dc2785e70..91dd5852c1a53 100644 --- a/src/wp-includes/abilities-api/class-wp-abilities-registry.php +++ b/src/wp-includes/abilities-api/class-wp-abilities-registry.php @@ -274,7 +274,7 @@ public static function get_instance(): ?self { _doing_it_wrong( __METHOD__, sprintf( - // translators: %s: init action. + /* translators: %s: init action. */ __( 'Ability API should not be initialized before the %s action has fired.' ), 'init' ), diff --git a/src/wp-includes/abilities-api/class-wp-ability-categories-registry.php b/src/wp-includes/abilities-api/class-wp-ability-categories-registry.php index 58bc4323ced69..bc4b2b8cc3479 100644 --- a/src/wp-includes/abilities-api/class-wp-ability-categories-registry.php +++ b/src/wp-includes/abilities-api/class-wp-ability-categories-registry.php @@ -205,7 +205,7 @@ public static function get_instance(): ?self { _doing_it_wrong( __METHOD__, sprintf( - // translators: %s: init action. + /* translators: %s: init action. */ __( 'Ability API should not be initialized before the %s action has fired.' ), 'init' ), diff --git a/src/wp-includes/class-wp-icons-registry.php b/src/wp-includes/class-wp-icons-registry.php index 2e2c2ca2956b4..4a2f461bbe006 100644 --- a/src/wp-includes/class-wp-icons-registry.php +++ b/src/wp-includes/class-wp-icons-registry.php @@ -149,7 +149,7 @@ protected function register( $icon_name, $icon_properties ) { _doing_it_wrong( __METHOD__, sprintf( - // translators: %s is the name of any user-provided key + /* translators: %s is the name of any user-provided key */ __( 'Invalid icon property: "%s".' ), $key ), diff --git a/src/wp-includes/fonts/class-wp-font-collection.php b/src/wp-includes/fonts/class-wp-font-collection.php index b915e3ea58d0d..2feb5df773f74 100644 --- a/src/wp-includes/fonts/class-wp-font-collection.php +++ b/src/wp-includes/fonts/class-wp-font-collection.php @@ -118,7 +118,7 @@ private function load_from_json( $file_or_url ) { $file = file_exists( $file_or_url ) ? wp_normalize_path( realpath( $file_or_url ) ) : false; if ( ! $url && ! $file ) { - // translators: %s: File path or URL to font collection JSON file. + /* translators: %s: File path or URL to font collection JSON file. */ $message = __( 'Font collection JSON file is invalid or does not exist.' ); _doing_it_wrong( __METHOD__, $message, '6.5.0' ); return new WP_Error( 'font_collection_json_missing', $message ); @@ -184,7 +184,7 @@ private function load_from_url( $url ) { return new WP_Error( 'font_collection_request_error', sprintf( - // translators: %s: Font collection URL. + /* translators: %s: Font collection URL. */ __( 'Error fetching the font collection data from "%s".' ), $url ) @@ -224,7 +224,7 @@ private function sanitize_and_validate_data( $data, $required_properties = array foreach ( $required_properties as $property ) { if ( empty( $data[ $property ] ) ) { $message = sprintf( - // translators: 1: Font collection slug, 2: Missing property name, e.g. "font_families". + /* translators: 1: Font collection slug, 2: Missing property name, e.g. "font_families". */ __( 'Font collection "%1$s" has missing or empty property: "%2$s".' ), $this->slug, $property diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php index 1828123ff879d..43fc431ffc596 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -495,7 +495,7 @@ private function create_fragment_at_current_node( string $html ) { _doing_it_wrong( __METHOD__, sprintf( - // translators: %s: A tag name like INPUT or BR. + /* translators: %s: A tag name like INPUT or BR. */ __( 'The context element cannot be a void element, found "%s".' ), $tag_name ), @@ -515,7 +515,7 @@ private function create_fragment_at_current_node( string $html ) { _doing_it_wrong( __METHOD__, sprintf( - // translators: %s: A tag name like IFRAME or TEXTAREA. + /* translators: %s: A tag name like IFRAME or TEXTAREA. */ __( 'The context element "%s" is not supported.' ), $tag_name ), diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php index 91126b498d338..29c5303f31375 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-icons-controller.php @@ -171,7 +171,7 @@ public function get_icon( $name ) { return new WP_Error( 'rest_icon_not_found', sprintf( - // translators: %s is the name of any user-provided name + /* translators: %s is the name of any user-provided name */ __( 'Icon not found: "%s".' ), $name ),