diff --git a/web/modules/custom/blog/src/Service/PostPusher/IftttPostPusher.php b/web/modules/custom/blog/src/Service/PostPusher/IftttPostPusher.php index d5d2553..c8f9727 100644 --- a/web/modules/custom/blog/src/Service/PostPusher/IftttPostPusher.php +++ b/web/modules/custom/blog/src/Service/PostPusher/IftttPostPusher.php @@ -5,12 +5,15 @@ declare(strict_types=1); namespace Drupal\opdavies_blog\Service\PostPusher; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\opdavies_blog\Entity\Node\Post; use GuzzleHttp\ClientInterface; use Webmozart\Assert\Assert; final class IftttPostPusher extends HttpPostPusher { + use StringTranslationTrait; + private ConfigFactoryInterface $configFactory; public function __construct( @@ -31,7 +34,9 @@ final class IftttPostPusher extends HttpPostPusher { $this->client->post($url, [ 'form_params' => [ - 'value1' => $post->toTweet(), + 'value1' => $this->t('Blogged: @text', [ + '@text' => $post->toTweet(), + ]), ], ]); }