diff --git a/contact_storage.module b/contact_storage.module index c56512c..a64094c 100644 --- a/contact_storage.module +++ b/contact_storage.module @@ -45,7 +45,7 @@ function contact_storage_form_contact_form_form_alter(&$form, FormStateInterface '#type' => 'textfield', '#title' => t('Default disabled contact form message'), '#description' => t('Default message to display if the contact form is disabled.'), - '#default_value' => $contact_form->getThirdPartySetting('contact_storage', 'disabled_form_message', 'This contact form has been disabled.'), + '#default_value' => $contact_form->getThirdPartySetting('contact_storage', 'disabled_form_message', t('This contact form has been disabled.')), ]; $form['contact_storage_preview'] = [ '#type' => 'checkbox', diff --git a/src/ContactFormViewBuilder.php b/src/ContactFormViewBuilder.php index ce49306..a08a9d7 100644 --- a/src/ContactFormViewBuilder.php +++ b/src/ContactFormViewBuilder.php @@ -106,7 +106,7 @@ class ContactFormViewBuilder implements EntityViewBuilderInterface, EntityHandle '#theme' => 'contact_storage_disabled_form', '#contact_form' => $entity, '#redirect_uri' => $entity->getThirdPartySetting('contact_storage', 'redirect_uri', ''), - '#disabled_form_message' => $entity->getThirdPartySetting('contact_storage', 'disabled_form_message', 'This contact form has been disabled.'), + '#disabled_form_message' => $entity->getThirdPartySetting('contact_storage', 'disabled_form_message', t('This contact form has been disabled.')), ); } // Add required cacheability metadata from the contact form entity, so that diff --git a/src/Routing/RouteSubscriber.php b/src/Routing/RouteSubscriber.php index 20b8203..03a6182 100644 --- a/src/Routing/RouteSubscriber.php +++ b/src/Routing/RouteSubscriber.php @@ -4,6 +4,7 @@ namespace Drupal\contact_storage\Routing; use Drupal\Core\Routing\RouteSubscriberBase; use Symfony\Component\Routing\RouteCollection; +use \Drupal\contact_storage\Controller\ContactStorageController; /** * Listens to the dynamic route events. @@ -16,7 +17,7 @@ class RouteSubscriber extends RouteSubscriberBase { public function alterRoutes(RouteCollection $collection) { // Change the contact_form controller. if ($route = $collection->get('entity.contact_form.canonical')) { - $route->setDefault('_controller', '\Drupal\contact_storage\Controller\ContactStorageController::contactSitePage'); + $route->setDefault('_controller', ContactStorageController::class . '::contactSitePage'); } }