Skip to content

Commit 7439398

Browse files
Nate Wiebefabpot
authored andcommitted
Rename Translatable class to TranslatableMessage
1 parent 9496bd9 commit 7439398

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CHANGELOG
77
* added the `impersonation_exit_url()` and `impersonation_exit_path()` functions. They return a URL that allows to switch back to the original user.
88
* added the `workflow_transition()` function to easily retrieve a specific transition object
99
* added support for translating `TranslatableInterface` objects
10-
* added the `t()` function to easily create `Translatable` objects
10+
* added the `t()` function to easily create `TranslatableMessage` objects
1111
* Added support for extracting messages from the `t()` function
1212
* Added `field_*` Twig functions to access string values from Form fields
1313

Extension/TranslationExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Bridge\Twig\NodeVisitor\TranslationNodeVisitor;
1616
use Symfony\Bridge\Twig\TokenParser\TransDefaultDomainTokenParser;
1717
use Symfony\Bridge\Twig\TokenParser\TransTokenParser;
18-
use Symfony\Component\Translation\Translatable;
18+
use Symfony\Component\Translation\TranslatableMessage;
1919
use Symfony\Contracts\Translation\TranslatableInterface;
2020
use Symfony\Contracts\Translation\TranslatorInterface;
2121
use Symfony\Contracts\Translation\TranslatorTrait;
@@ -133,12 +133,12 @@ public function trans($message, $arguments = [], string $domain = null, string $
133133
return $this->getTranslator()->trans($message, $arguments, $domain, $locale);
134134
}
135135

136-
public function createTranslatable(string $message, array $parameters = [], string $domain = null): Translatable
136+
public function createTranslatable(string $message, array $parameters = [], string $domain = null): TranslatableMessage
137137
{
138-
if (!class_exists(Translatable::class)) {
138+
if (!class_exists(TranslatableMessage::class)) {
139139
throw new \LogicException(sprintf('You cannot use the "%s" as the Translation Component is not installed. Try running "composer require symfony/translation".', __CLASS__));
140140
}
141141

142-
return new Translatable($message, $parameters, $domain);
142+
return new TranslatableMessage($message, $parameters, $domain);
143143
}
144144
}

0 commit comments

Comments
 (0)