Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-locale.php

    r42201 r42343  
    127127    public function init() {
    128128        // The Weekdays
    129         $this->weekday[0] = /* translators: weekday */ __('Sunday');
    130         $this->weekday[1] = /* translators: weekday */ __('Monday');
    131         $this->weekday[2] = /* translators: weekday */ __('Tuesday');
    132         $this->weekday[3] = /* translators: weekday */ __('Wednesday');
    133         $this->weekday[4] = /* translators: weekday */ __('Thursday');
    134         $this->weekday[5] = /* translators: weekday */ __('Friday');
    135         $this->weekday[6] = /* translators: weekday */ __('Saturday');
     129        $this->weekday[0] = /* translators: weekday */ __( 'Sunday' );
     130        $this->weekday[1] = /* translators: weekday */ __( 'Monday' );
     131        $this->weekday[2] = /* translators: weekday */ __( 'Tuesday' );
     132        $this->weekday[3] = /* translators: weekday */ __( 'Wednesday' );
     133        $this->weekday[4] = /* translators: weekday */ __( 'Thursday' );
     134        $this->weekday[5] = /* translators: weekday */ __( 'Friday' );
     135        $this->weekday[6] = /* translators: weekday */ __( 'Saturday' );
    136136
    137137        // The first letter of each day.
     
    145145
    146146        // Abbreviations for each day.
    147         $this->weekday_abbrev[__('Sunday')]    = /* translators: three-letter abbreviation of the weekday */ __('Sun');
    148         $this->weekday_abbrev[__('Monday')]    = /* translators: three-letter abbreviation of the weekday */ __('Mon');
    149         $this->weekday_abbrev[__('Tuesday')]   = /* translators: three-letter abbreviation of the weekday */ __('Tue');
    150         $this->weekday_abbrev[__('Wednesday')] = /* translators: three-letter abbreviation of the weekday */ __('Wed');
    151         $this->weekday_abbrev[__('Thursday')]  = /* translators: three-letter abbreviation of the weekday */ __('Thu');
    152         $this->weekday_abbrev[__('Friday')]    = /* translators: three-letter abbreviation of the weekday */ __('Fri');
    153         $this->weekday_abbrev[__('Saturday')]  = /* translators: three-letter abbreviation of the weekday */ __('Sat');
     147        $this->weekday_abbrev[ __( 'Sunday' ) ]    = /* translators: three-letter abbreviation of the weekday */ __( 'Sun' );
     148        $this->weekday_abbrev[ __( 'Monday' ) ]    = /* translators: three-letter abbreviation of the weekday */ __( 'Mon' );
     149        $this->weekday_abbrev[ __( 'Tuesday' ) ]   = /* translators: three-letter abbreviation of the weekday */ __( 'Tue' );
     150        $this->weekday_abbrev[ __( 'Wednesday' ) ] = /* translators: three-letter abbreviation of the weekday */ __( 'Wed' );
     151        $this->weekday_abbrev[ __( 'Thursday' ) ]  = /* translators: three-letter abbreviation of the weekday */ __( 'Thu' );
     152        $this->weekday_abbrev[ __( 'Friday' ) ]    = /* translators: three-letter abbreviation of the weekday */ __( 'Fri' );
     153        $this->weekday_abbrev[ __( 'Saturday' ) ]  = /* translators: three-letter abbreviation of the weekday */ __( 'Sat' );
    154154
    155155        // The Months
     
    196196
    197197        // The Meridiems
    198         $this->meridiem['am'] = __('am');
    199         $this->meridiem['pm'] = __('pm');
    200         $this->meridiem['AM'] = __('AM');
    201         $this->meridiem['PM'] = __('PM');
     198        $this->meridiem['am'] = __( 'am' );
     199        $this->meridiem['pm'] = __( 'pm' );
     200        $this->meridiem['AM'] = __( 'AM' );
     201        $this->meridiem['PM'] = __( 'PM' );
    202202
    203203        // Numbers formatting
     
    223223
    224224        // Set text direction.
    225         if ( isset( $GLOBALS['text_direction'] ) )
     225        if ( isset( $GLOBALS['text_direction'] ) ) {
    226226            $this->text_direction = $GLOBALS['text_direction'];
    227         /* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
    228         elseif ( 'rtl' == _x( 'ltr', 'text direction' ) )
     227        } /* translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. */
     228        elseif ( 'rtl' == _x( 'ltr', 'text direction' ) ) {
    229229            $this->text_direction = 'rtl';
     230        }
    230231
    231232        if ( 'rtl' === $this->text_direction && strpos( get_bloginfo( 'version' ), '-src' ) ) {
     
    257258     * @return string Full translated weekday
    258259     */
    259     public function get_weekday($weekday_number) {
    260         return $this->weekday[$weekday_number];
     260    public function get_weekday( $weekday_number ) {
     261        return $this->weekday[ $weekday_number ];
    261262    }
    262263
     
    274275     * @return string
    275276     */
    276     public function get_weekday_initial($weekday_name) {
    277         return $this->weekday_initial[$weekday_name];
     277    public function get_weekday_initial( $weekday_name ) {
     278        return $this->weekday_initial[ $weekday_name ];
    278279    }
    279280
     
    289290     * @return string Translated weekday abbreviation
    290291     */
    291     public function get_weekday_abbrev($weekday_name) {
    292         return $this->weekday_abbrev[$weekday_name];
     292    public function get_weekday_abbrev( $weekday_name ) {
     293        return $this->weekday_abbrev[ $weekday_name ];
    293294    }
    294295
     
    309310     * @return string Translated full month name
    310311     */
    311     public function get_month($month_number) {
    312         return $this->month[zeroise($month_number, 2)];
     312    public function get_month( $month_number ) {
     313        return $this->month[ zeroise( $month_number, 2 ) ];
    313314    }
    314315
     
    324325     * @return string Translated abbreviated month
    325326     */
    326     public function get_month_abbrev($month_name) {
    327         return $this->month_abbrev[$month_name];
     327    public function get_month_abbrev( $month_name ) {
     328        return $this->month_abbrev[ $month_name ];
    328329    }
    329330
     
    338339     * @return string Translated version
    339340     */
    340     public function get_meridiem($meridiem) {
    341         return $this->meridiem[$meridiem];
     341    public function get_meridiem( $meridiem ) {
     342        return $this->meridiem[ $meridiem ];
    342343    }
    343344
Note: See TracChangeset for help on using the changeset viewer.