*/ public static function all(): array { return array( self::MISSING, self::MACHINE, self::REVIEW, self::APPROVED, self::STALE, self::REJECTED, ); } /** * Допустим ли статус. * * @param string $status Проверяемое значение. */ public static function isValid( string $status ): bool { return in_array( $status, self::all(), true ); } /** * Человекочитаемое название. * * @param string $status Статус. */ public static function label( string $status ): string { $labels = array( self::MISSING => __( 'No translation', 'lingocanvas' ), self::MACHINE => __( 'Machine', 'lingocanvas' ), self::REVIEW => __( 'In review', 'lingocanvas' ), self::APPROVED => __( 'Ready', 'lingocanvas' ), self::STALE => __( 'Outdated', 'lingocanvas' ), self::REJECTED => __( 'Rejected', 'lingocanvas' ), self::LOCALE_FILE => __( 'From the language pack', 'lingocanvas' ), ); return $labels[ $status ] ?? $status; } }