diff --git a/wp-rest/Autoloader.php b/wp-rest/Autoloader.php index a5d6757c218b0ccdda162fec7a6a20e2bf669770..dfa95f8a0219f6d8126f0b77110135049c693690 100644 --- a/wp-rest/Autoloader.php +++ b/wp-rest/Autoloader.php @@ -67,7 +67,7 @@ class Autoloader { self::instance(); if ( ! is_readable( trailingslashit( $source_path ) ) ) - return \WP_Error( 'civicrm_wp_rest_error', __( 'The source ' . $source . ' is not readable.' ) ); + return \WP_Error( 'civicrm_wp_rest_error', sprintf( __( 'The source %s is not readable.', 'civicrm' ), $source ) ); self::$source_directories[] = $source_path; diff --git a/wp-rest/Controller/Open.php b/wp-rest/Controller/Open.php index db70e1070eba0d78e993004dd61d50f76b739dd9..450ef991a34897a169761dc9c1fdfcc57b4a0bf5 100644 --- a/wp-rest/Controller/Open.php +++ b/wp-rest/Controller/Open.php @@ -92,7 +92,7 @@ class Open extends Base { return [ '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'civicrm/v3/open', - 'description' => 'CiviCRM Open endpoint', + 'description' => __( 'CiviCRM Open endpoint', 'civicrm' ), 'type' => 'object', 'required' => [ 'q' ], 'properties' => [ diff --git a/wp-rest/Controller/Rest.php b/wp-rest/Controller/Rest.php index b3b97b205cd6abdb498449a4b6d45de31d623b66..7f275d0e480c614286ea6349987893e5dccafa61 100644 --- a/wp-rest/Controller/Rest.php +++ b/wp-rest/Controller/Rest.php @@ -46,10 +46,10 @@ class Rest extends Base { public function permissions_check( $request ) { if ( ! $this->is_valid_api_key( $request ) ) - return $this->civi_rest_error( __( 'Param api_key is not valid.' ) ); + return $this->civi_rest_error( __( 'Param api_key is not valid.', 'civicrm' ) ); if ( ! $this->is_valid_site_key() ) - return $this->civi_rest_error( __( 'Param key is not valid.' ) ); + return $this->civi_rest_error( __( 'Param key is not valid.', 'civicrm' ) ); return true; @@ -326,7 +326,7 @@ class Rest extends Base { return [ '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'civicrm/v3/rest', - 'description' => 'CiviCRM API3 WP rest endpoint wrapper', + 'description' => __( 'CiviCRM API3 WP rest endpoint wrapper', 'civicrm' ), 'type' => 'object', 'required' => [ 'entity', 'action', 'params' ], 'properties' => [ diff --git a/wp-rest/Controller/Url.php b/wp-rest/Controller/Url.php index 263a5410ab795f419fd8e67427d3e713323b4b48..9286856e7c88e6d1cf9057cf78da943cb34f73d1 100644 --- a/wp-rest/Controller/Url.php +++ b/wp-rest/Controller/Url.php @@ -153,7 +153,7 @@ class Url extends Base { return [ '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'civicrm_api3/v3/url', - 'description' => 'CiviCRM API3 wrapper', + 'description' => __( 'CiviCRM API3 wrapper', 'civicrm' ), 'type' => 'object', 'required' => [ 'qid', 'u' ], 'properties' => [ diff --git a/wp-rest/Controller/Widget.php b/wp-rest/Controller/Widget.php index fd4ee14bc6a35341bc84f7f50478310e9eca2038..13fa1e2adde648de8c24b1278039385569bd5c21 100644 --- a/wp-rest/Controller/Widget.php +++ b/wp-rest/Controller/Widget.php @@ -139,7 +139,7 @@ class Widget extends Base { return [ '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'civicrm_api3/v3/widget', - 'description' => 'CiviCRM API3 wrapper', + 'description' => __( 'CiviCRM API3 wrapper', 'civicrm' ), 'type' => 'object', 'required' => [ 'cpageId', 'widgetId' ], 'properties' => [