From 9e09c67015dbb79aef08ff713d2a8e9f8153ab8a Mon Sep 17 00:00:00 2001 From: Christian Wach <needle@haystack.co.uk> Date: Mon, 24 Jun 2019 12:23:40 +0100 Subject: [PATCH] Make strings translatable Signed-off-by: Kevin Cristiano <kcristiano@kcristiano.com> --- wp-rest/Autoloader.php | 2 +- wp-rest/Controller/Open.php | 2 +- wp-rest/Controller/Rest.php | 6 +++--- wp-rest/Controller/Url.php | 2 +- wp-rest/Controller/Widget.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-rest/Autoloader.php b/wp-rest/Autoloader.php index a5d6757c21..dfa95f8a02 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 db70e1070e..450ef991a3 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 b3b97b205c..7f275d0e48 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 263a5410ab..9286856e7c 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 fd4ee14bc6..13fa1e2add 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' => [ -- GitLab