diff --git a/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php b/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php index 12edcfa..505e53c 100644 --- a/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php +++ b/plugin_type_example/src/Plugin/Sandwich/ExampleMeatballSandwich.php @@ -3,6 +3,7 @@ namespace Drupal\plugin_type_example\Plugin\Sandwich; use Drupal\plugin_type_example\SandwichBase; +use Drupal\Core\StringTranslation\StringTranslationTrait; /** * Provides a meatball sandwich. @@ -29,6 +30,9 @@ use Drupal\plugin_type_example\SandwichBase; * ) */ class ExampleMeatballSandwich extends SandwichBase { + // Include Drupal\Core\StringTranslation\StringTranslationTrait in order to + // so we can use $this->t() to translate strings in our plugin. + use StringTranslationTrait; /** * The day the sandwich is ordered.