diff --git a/class-auth.php b/class-auth.php index a6c4d71..3ec988d 100644 --- a/class-auth.php +++ b/class-auth.php @@ -35,13 +35,6 @@ class Auth { */ private $jwt_error = null; - /** - * Collection of translate-able messages. - * - * @var array - */ - private $messages = array(); - /** * The REST API slug. * @@ -54,11 +47,6 @@ class Auth { */ public function __construct() { $this->namespace = 'jwt-auth/v1'; - - $this->messages = array( - 'jwt_auth_no_auth_header' => __( 'Authorization header not found.', 'jwt-auth' ), - 'jwt_auth_bad_auth_header' => __( 'Authorization header malformed.', 'jwt-auth' ), - ); } /** @@ -402,7 +390,7 @@ public function validate_token( $return_response = true ) { 'success' => false, 'statusCode' => 401, 'code' => 'jwt_auth_no_auth_header', - 'message' => $this->messages['jwt_auth_no_auth_header'], + 'message' => __( 'Authorization header not found.', 'jwt-auth' ), 'data' => array(), ), 401 @@ -421,7 +409,7 @@ public function validate_token( $return_response = true ) { 'success' => false, 'statusCode' => 401, 'code' => 'jwt_auth_bad_auth_header', - 'message' => $this->messages['jwt_auth_bad_auth_header'], + 'message' => __( 'Authorization header malformed.', 'jwt-auth' ), 'data' => array(), ), 401 diff --git a/class-setup.php b/class-setup.php index b783e58..17bfdb1 100644 --- a/class-setup.php +++ b/class-setup.php @@ -58,7 +58,7 @@ public function __construct() { * Setup textdomain. */ public function setup_text_domain() { - load_plugin_textdomain( 'jwt-auth', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); + load_plugin_textdomain( 'jwt-auth', false, plugin_basename( __DIR__ ) . '/languages' ); } /**