WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/03/2019 12:39:13 AM (6 weeks ago)
Author:
SergeyBiryukov
Message:

I18N: Capitalize translator comments consistently, add trailing punctuation.

Includes minor code layout fixes.

See #44360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r45926 r45932  
    535535    }
    536536    if ( ! empty( $replacement ) ) {
    537         /* translators: 1: function name, 2: WordPress version number, 3: new function name */
     537        /* translators: 1: Function name, 2: WordPress version number, 3: New function name. */
    538538        $string = sprintf( __( '%1$s (since %2$s; use %3$s instead)' ), $function, $version, $replacement );
    539539    } else {
    540         /* translators: 1: function name, 2: WordPress version number */
     540        /* translators: 1: Function name, 2: WordPress version number. */
    541541        $string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );
    542542    }
     
    559559    }
    560560    if ( ! empty( $message ) ) {
    561         /* translators: 1: function name, 2: WordPress version number, 3: error message */
     561        /* translators: 1: Function name, 2: WordPress version number, 3: Error message. */
    562562        $string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message );
    563563    } else {
    564         /* translators: 1: function name, 2: WordPress version number */
     564        /* translators: 1: Function name, 2: WordPress version number. */
    565565        $string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );
    566566    }
     
    11451145        }
    11461146        if ( ! wp_is_numeric_array( $value ) ) {
    1147             /* translators: 1: parameter, 2: type name */
     1147            /* translators: 1: Parameter, 2: Type name. */
    11481148            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'array' ) );
    11491149        }
     
    11661166
    11671167        if ( ! is_array( $value ) ) {
    1168             /* translators: 1: parameter, 2: type name */
     1168            /* translators: 1: Parameter, 2: Type name. */
    11691169            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'object' ) );
    11701170        }
     
    11781178            } elseif ( isset( $args['additionalProperties'] ) ) {
    11791179                if ( false === $args['additionalProperties'] ) {
    1180                     /* translators: %s: property of an object */
     1180                    /* translators: %s: Property of an object. */
    11811181                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not a valid property of Object.' ), $property ) );
    11821182                }
     
    11941194    if ( ! empty( $args['enum'] ) ) {
    11951195        if ( ! in_array( $value, $args['enum'], true ) ) {
    1196             /* translators: 1: parameter, 2: list of valid values */
     1196            /* translators: 1: Parameter, 2: List of valid values. */
    11971197            return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not one of %2$s.' ), $param, implode( ', ', $args['enum'] ) ) );
    11981198        }
     
    12001200
    12011201    if ( in_array( $args['type'], array( 'integer', 'number' ) ) && ! is_numeric( $value ) ) {
    1202         /* translators: 1: parameter, 2: type name */
     1202        /* translators: 1: Parameter, 2: Type name. */
    12031203        return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, $args['type'] ) );
    12041204    }
    12051205
    12061206    if ( 'integer' === $args['type'] && round( floatval( $value ) ) !== floatval( $value ) ) {
    1207         /* translators: 1: parameter, 2: type name */
     1207        /* translators: 1: Parameter, 2: Type name. */
    12081208        return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'integer' ) );
    12091209    }
    12101210
    12111211    if ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) {
    1212         /* translators: 1: parameter, 2: type name */
     1212        /* translators: 1: Parameter, 2: Type name. */
    12131213        return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $value, 'boolean' ) );
    12141214    }
    12151215
    12161216    if ( 'string' === $args['type'] && ! is_string( $value ) ) {
    1217         /* translators: 1: parameter, 2: type name */
     1217        /* translators: 1: Parameter, 2: Type name. */
    12181218        return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s.' ), $param, 'string' ) );
    12191219    }
     
    12341234            case 'ip':
    12351235                if ( ! rest_is_ip_address( $value ) ) {
    1236                     /* translators: %s: IP address */
     1236                    /* translators: %s: IP address. */
    12371237                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.' ), $value ) );
    12381238                }
     
    12441244        if ( isset( $args['minimum'] ) && ! isset( $args['maximum'] ) ) {
    12451245            if ( ! empty( $args['exclusiveMinimum'] ) && $value <= $args['minimum'] ) {
    1246                 /* translators: 1: parameter, 2: minimum number */
     1246                /* translators: 1: Parameter, 2: Minimum number. */
    12471247                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than %2$d' ), $param, $args['minimum'] ) );
    12481248            } elseif ( empty( $args['exclusiveMinimum'] ) && $value < $args['minimum'] ) {
    1249                 /* translators: 1: parameter, 2: minimum number */
     1249                /* translators: 1: Parameter, 2: Minimum number. */
    12501250                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be greater than or equal to %2$d' ), $param, $args['minimum'] ) );
    12511251            }
    12521252        } elseif ( isset( $args['maximum'] ) && ! isset( $args['minimum'] ) ) {
    12531253            if ( ! empty( $args['exclusiveMaximum'] ) && $value >= $args['maximum'] ) {
    1254                 /* translators: 1: parameter, 2: maximum number */
     1254                /* translators: 1: Parameter, 2: Maximum number. */
    12551255                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than %2$d' ), $param, $args['maximum'] ) );
    12561256            } elseif ( empty( $args['exclusiveMaximum'] ) && $value > $args['maximum'] ) {
    1257                 /* translators: 1: parameter, 2: maximum number */
     1257                /* translators: 1: Parameter, 2: Maximum number. */
    12581258                return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be less than or equal to %2$d' ), $param, $args['maximum'] ) );
    12591259            }
     
    12611261            if ( ! empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {
    12621262                if ( $value >= $args['maximum'] || $value <= $args['minimum'] ) {
    1263                     /* translators: 1: parameter, 2: minimum number, 3: maximum number */
     1263                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    12641264                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    12651265                }
    12661266            } elseif ( empty( $args['exclusiveMinimum'] ) && ! empty( $args['exclusiveMaximum'] ) ) {
    12671267                if ( $value >= $args['maximum'] || $value < $args['minimum'] ) {
    1268                     /* translators: 1: parameter, 2: minimum number, 3: maximum number */
     1268                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    12691269                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (exclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    12701270                }
    12711271            } elseif ( ! empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {
    12721272                if ( $value > $args['maximum'] || $value <= $args['minimum'] ) {
    1273                     /* translators: 1: parameter, 2: minimum number, 3: maximum number */
     1273                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    12741274                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (exclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    12751275                }
    12761276            } elseif ( empty( $args['exclusiveMinimum'] ) && empty( $args['exclusiveMaximum'] ) ) {
    12771277                if ( $value > $args['maximum'] || $value < $args['minimum'] ) {
    1278                     /* translators: 1: parameter, 2: minimum number, 3: maximum number */
     1278                    /* translators: 1: Parameter, 2: Minimum number, 3: Maximum number. */
    12791279                    return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s must be between %2$d (inclusive) and %3$d (inclusive)' ), $param, $args['minimum'], $args['maximum'] ) );
    12801280                }
Note: See TracChangeset for help on using the changeset viewer.