diff --git a/src/RecurlyEntityOperations.php b/src/RecurlyEntityOperations.php index f8999c7..4f59303 100644 --- a/src/RecurlyEntityOperations.php +++ b/src/RecurlyEntityOperations.php @@ -100,7 +100,7 @@ class RecurlyEntityOperations { $recurly_account->update(); } catch (Recurly_Error $e) { - drupal_set_message(t('The billing system reported an error: "@error" To ensure proper billing, please correct the problem if possible or contact support.', ['@error' => $e->getMessage()]), 'warning'); + drupal_set_message($this->t('The billing system reported an error: "@error" To ensure proper billing, please correct the problem if possible or contact support.', ['@error' => $e->getMessage()]), 'warning'); \Drupal::logger('recurly')->error('Account information could not be sent to the Recurly, it reported "@error" while trying to update !title with the values @values.', [ '@error' => $e->getMessage(), '!title' => \Drupal::l($entity->label(), $entity->toUrl()), diff --git a/src/RecurlyFormatManager.php b/src/RecurlyFormatManager.php index 635971b..2a1af61 100644 --- a/src/RecurlyFormatManager.php +++ b/src/RecurlyFormatManager.php @@ -27,28 +27,28 @@ class RecurlyFormatManager { public function formatState($state) { switch ($state) { case RECURLY_STATE_ACTIVE: - return t('Active'); + return $this->t('Active'); case RECURLY_STATE_CANCELED: - return t('Canceled (will not renew)'); + return $this->t('Canceled (will not renew)'); case RECURLY_STATE_EXPIRED: - return t('Expired'); + return $this->t('Expired'); case RECURLY_STATE_FUTURE: - return t('Future Activation'); + return $this->t('Future Activation'); case RECURLY_STATE_PENDING_SUBSCRIPTION: - return t('Switching to new plan'); + return $this->t('Switching to new plan'); case RECURLY_STATE_IN_TRIAL: - return t('Trial'); + return $this->t('Trial'); case RECURLY_STATE_LIVE: - return t('Live'); + return $this->t('Live'); case RECURLY_STATE_PAST_DUE: - return t('Past Due'); + return $this->t('Past Due'); } } @@ -143,25 +143,25 @@ class RecurlyFormatManager { if ($count == 1) { switch ($unit) { case 'days': - return t('!amount per day', $replacements); + return $this->t('!amount per day', $replacements); case 'months': - return t('!amount per month', $replacements); + return $this->t('!amount per month', $replacements); } } elseif ($count == 7 && $unit == 'days') { - return t('!amount per week', $replacements); + return $this->t('!amount per week', $replacements); } elseif ($count == 12 && $unit == 'months') { - return t('!amount per year', $replacements); + return $this->t('!amount per year', $replacements); } else { switch ($unit) { case 'days': - return t('!amount every !count days', $replacements); + return $this->t('!amount every !count days', $replacements); case 'months': - return t('!amount every !count months', $replacements); + return $this->t('!amount every !count months', $replacements); } } } @@ -172,16 +172,16 @@ class RecurlyFormatManager { public function formatTransactionStatus($status) { switch ($status) { case 'success': - return t('Successful payment'); + return $this->t('Successful payment'); case 'failed': - return t('Failed payment'); + return $this->t('Failed payment'); case 'voided': - return t('Voided'); + return $this->t('Voided'); case 'declined': - return t('Card declined'); + return $this->t('Card declined'); default: return SafeMarkup::checkPlain($status);