Make WordPress Core


Ignore:
Timestamp:
10/27/2025 11:55:51 AM (5 months ago)
Author:
gziolo
Message:

Abilities API: Code quality fixes around translations

This aligns with how translations are handled across all places in the Abilities API codebase. It addresses the feedback raised during syncing back changes to Abilities API repository with https://github.com/WordPress/abilities-api/pull/126.

Developed in https://github.com/WordPress/wordpress-develop/pull/10424.

Follow-up [61032].
Props gziolo, jorgefilipecosta.
See #64098.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/abilities-api/class-wp-abilities-registry.php

    r61059 r61071  
    237237     *
    238238     * @param string $name The name of the registered ability, with its namespace.
    239      * @return ?WP_Ability The registered ability instance, or null if it is not registered.
     239     * @return WP_Ability|null The registered ability instance, or null if it is not registered.
    240240     */
    241241    public function get_registered( string $name ): ?WP_Ability {
     
    244244                __METHOD__,
    245245                /* translators: %s: Ability name. */
    246                 sprintf( esc_html__( 'Ability "%s" not found.' ), esc_attr( $name ) ),
     246                sprintf( __( 'Ability "%s" not found.' ), esc_html( $name ) ),
    247247                '6.9.0'
    248248            );
     
    266266                __METHOD__,
    267267                sprintf(
    268                     __( 'Ability API should not be initialized before the <code>init</code> action has fired' )
     268                    // translators: %s: init action.
     269                    __( 'Ability API should not be initialized before the %s action has fired.' ),
     270                    '<code>init</code>'
    269271                ),
    270272                '6.9.0'
     
    315317     */
    316318    public function __sleep(): array {
    317         throw new LogicException( __CLASS__ . ' should never be serialized' );
     319        throw new LogicException( __CLASS__ . ' should never be serialized.' );
    318320    }
    319321}
Note: See TracChangeset for help on using the changeset viewer.