| @@ -24,9 +24,9 @@ | ||
| 24 | 24 | $this->intervals = $this->get_predefined_intervals(); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @return mixed|void | |
| 28 | + * @return mixed | |
| 29 | 29 | */ |
| 30 | 30 | public function get_predefined_intervals() { |
| 31 | 31 | $timezone = get_option( 'timezone_string' ); |
| 32 | 32 | |
| @@ -43,64 +43,70 @@ | ||
| 43 | 43 | |
| 44 | 44 | return apply_filters( |
| 45 | 45 | 'wp_stream_predefined_date_intervals', |
| 46 | 46 | array( |
| 47 | - 'today' => array( | |
| 47 | + 'today' => array( | |
| 48 | 48 | 'label' => esc_html__( 'Today', 'stream' ), |
| 49 | 49 | 'start' => Carbon::today( $timezone )->startOfDay(), |
| 50 | 50 | 'end' => Carbon::today( $timezone )->endOfDay(), |
| 51 | 51 | ), |
| 52 | - 'yesterday' => array( | |
| 52 | + 'yesterday' => array( | |
| 53 | 53 | 'label' => esc_html__( 'Yesterday', 'stream' ), |
| 54 | 54 | 'start' => Carbon::today( $timezone )->startOfDay()->subDay(), |
| 55 | 55 | 'end' => Carbon::today( $timezone )->startOfDay()->subSecond(), |
| 56 | 56 | ), |
| 57 | - 'last-7-days' => array( | |
| 57 | + 'last-7-days' => array( | |
| 58 | + // translators: Placeholder refers to a number of days (e.g. "7") | |
| 58 | 59 | 'label' => sprintf( esc_html__( 'Last %d Days', 'stream' ), 7 ), |
| 59 | 60 | 'start' => Carbon::today( $timezone )->subDays( 7 ), |
| 60 | 61 | 'end' => Carbon::today( $timezone ), |
| 61 | 62 | ), |
| 62 | - 'last-14-days' => array( | |
| 63 | + 'last-14-days' => array( | |
| 64 | + // translators: Placeholder refers to a number of days (e.g. "7") | |
| 63 | 65 | 'label' => sprintf( esc_html__( 'Last %d Days', 'stream' ), 14 ), |
| 64 | 66 | 'start' => Carbon::today( $timezone )->subDays( 14 ), |
| 65 | 67 | 'end' => Carbon::today( $timezone ), |
| 66 | 68 | ), |
| 67 | - 'last-30-days' => array( | |
| 69 | + 'last-30-days' => array( | |
| 70 | + // translators: Placeholder refers to a number of days (e.g. "7") | |
| 68 | 71 | 'label' => sprintf( esc_html__( 'Last %d Days', 'stream' ), 30 ), |
| 69 | 72 | 'start' => Carbon::today( $timezone )->subDays( 30 ), |
| 70 | 73 | 'end' => Carbon::today( $timezone ), |
| 71 | 74 | ), |
| 72 | - 'this-month' => array( | |
| 75 | + 'this-month' => array( | |
| 73 | 76 | 'label' => esc_html__( 'This Month', 'stream' ), |
| 74 | 77 | 'start' => Carbon::today( $timezone )->startOfMonth(), |
| 75 | 78 | 'end' => Carbon::today( $timezone )->endOfMonth(), |
| 76 | 79 | ), |
| 77 | - 'last-month' => array( | |
| 80 | + 'last-month' => array( | |
| 78 | 81 | 'label' => esc_html__( 'Last Month', 'stream' ), |
| 79 | 82 | 'start' => Carbon::today( $timezone )->startOfMonth()->subMonth(), |
| 80 | 83 | 'end' => Carbon::today( $timezone )->startOfMonth()->subSecond(), |
| 81 | 84 | ), |
| 82 | - 'last-3-months' => array( | |
| 85 | + 'last-3-months' => array( | |
| 86 | + // translators: Placeholder refers to a number of months (e.g. "3") | |
| 83 | 87 | 'label' => sprintf( esc_html__( 'Last %d Months', 'stream' ), 3 ), |
| 84 | 88 | 'start' => Carbon::today( $timezone )->subMonths( 3 ), |
| 85 | 89 | 'end' => Carbon::today( $timezone ), |
| 86 | 90 | ), |
| 87 | - 'last-6-months' => array( | |
| 91 | + 'last-6-months' => array( | |
| 92 | + // translators: Placeholder refers to a number of months (e.g. "3") | |
| 88 | 93 | 'label' => sprintf( esc_html__( 'Last %d Months', 'stream' ), 6 ), |
| 89 | 94 | 'start' => Carbon::today( $timezone )->subMonths( 6 ), |
| 90 | 95 | 'end' => Carbon::today( $timezone ), |
| 91 | 96 | ), |
| 92 | 97 | 'last-12-months' => array( |
| 98 | + // translators: Placeholder refers to a number of months (e.g. "3") | |
| 93 | 99 | 'label' => sprintf( esc_html__( 'Last %d Months', 'stream' ), 12 ), |
| 94 | 100 | 'start' => Carbon::today( $timezone )->subMonths( 12 ), |
| 95 | 101 | 'end' => Carbon::today( $timezone ), |
| 96 | 102 | ), |
| 97 | - 'this-year' => array( | |
| 103 | + 'this-year' => array( | |
| 98 | 104 | 'label' => esc_html__( 'This Year', 'stream' ), |
| 99 | 105 | 'start' => Carbon::today( $timezone )->startOfYear(), |
| 100 | 106 | 'end' => Carbon::today( $timezone )->endOfYear(), |
| 101 | 107 | ), |
| 102 | - 'last-year' => array( | |
| 108 | + 'last-year' => array( | |
| 103 | 109 | 'label' => esc_html__( 'Last Year', 'stream' ), |
| 104 | 110 | 'start' => Carbon::today( $timezone )->startOfYear()->subYear(), |
| 105 | 111 | 'end' => Carbon::today( $timezone )->startOfYear()->subSecond(), |
| 106 | 112 | ), |