Commit e191e497 authored by Liam Morland's avatar Liam Morland
Browse files

Issue #3271310 by chakkche, Liam Morland, victoria-marina: Replace t() with StringTranslationTrait

parent d7418f10
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Drupal\fillpdf;

use Drupal\Core\Access\AccessResult;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Drupal\Core\Logger\LoggerChannelTrait;
@@ -17,6 +18,7 @@ class FillPdfAccessController implements ContainerInjectionInterface {

  use MessengerTrait;
  use LoggerChannelTrait;
  use StringTranslationTrait;

  /**
   * The FillPDF access helper.
@@ -107,7 +109,7 @@ class FillPdfAccessController implements ContainerInjectionInterface {
    catch (\InvalidArgumentException $exception) {
      $message = $exception->getMessage();
      $is_admin = $this->currentUser->hasPermission('administer pdfs');
      $this->messenger()->addError($is_admin ? $message : t('An error occurred. Please notify the administrator.'));
      $this->messenger()->addError($is_admin ? $message : $this->t('An error occurred. Please notify the administrator.'));
      $this->getLogger('fillpdf')->error($message);
      return AccessResult::forbidden();
    }
+3 −3
Original line number Diff line number Diff line
@@ -24,17 +24,17 @@ class FillPdfFormListBuilder extends EntityListBuilder {
  public function getDefaultOperations(EntityInterface $entity) {

    $duplicate = [
      'title' => t('Duplicate'),
      'title' => $this->t('Duplicate'),
      'weight' => 10,
      'url' => $this->ensureDestination($entity->toUrl('duplicate-form')),
    ];
    $export = [
      'title' => t('Export configuration'),
      'title' => $this->t('Export configuration'),
      'weight' => 20,
      'url' => $this->ensureDestination($entity->toUrl('export-form')),
    ];
    $import = [
      'title' => t('Import configuration'),
      'title' => $this->t('Import configuration'),
      'weight' => 30,
      'url' => $this->ensureDestination($entity->toUrl('import-form')),
    ];
+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ class FillPdfFormForm extends ContentEntityForm {
    $form['additional_settings']['security'] = [
      '#name' => 'security',
      '#type' => 'details',
      '#title' => t('PDF Security (currently only works with pdftk)'),
      '#title' => $this->t('PDF Security (currently only works with pdftk)'),
      '#weight' => 100,
      '#open' => $fillpdf_form && (
          !empty($fillpdf_form->pdftk_encryption->value) ||
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ class FillPdfSettingsForm extends ConfigFormBase {
      '#default_value' => array_key_exists($template_scheme, $template_scheme_options) ? $template_scheme : $file_default_scheme,
      '#options' => $template_scheme_options,
      '#description' => $this->t('This setting is used as the storage for uploaded templates; note that the use of %public is more efficient, but does not provide any access control.<br />Changing this setting will require you to migrate associated files and data yourself and is not recommended after you have uploaded a template.', [
        '%public' => t('Public files'),
        '%public' => $this->t('Public files'),
      ]),
    ];

+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\Tests\fillpdf\Functional;

use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Tests\file\Functional\FileFieldTestBase;
use Drupal\Tests\fillpdf\Traits\TestFillPdfTrait;
use Drupal\Tests\fillpdf\Traits\TestImageFieldTrait;
@@ -12,6 +13,7 @@ use Drupal\user\Entity\Role;
 */
abstract class FillPdfTestBase extends FileFieldTestBase {

  use StringTranslationTrait;
  use TestFillPdfTrait;
  use TestImageFieldTrait;

Loading