8000 minor #14371 Rename the translatable class (natewiebe13) · symfony/symfony-docs@93ee489 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93ee489

Browse files
committed
minor #14371 Rename the translatable class (natewiebe13)
This PR was merged into the 5.x branch. Discussion ---------- Rename the translatable class Update the translatable object class name. Fixes #14361 Commits ------- cc7ba80 Rename the translatable class
2 parents 4d2f5bf + cc7ba80 commit 93ee489

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

translation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,16 @@ parts of your application and mocking it in your tests.
307307

308308
Instead of translating a string at the time of creation, you can use a
309309
"translatable object", which is an instance of the
310-
:class:`Symfony\\Component\\Translation\\Translatable` class. This object stores
310+
:class:`Symfony\\Component\\Translation\\TranslatableMessage` class. This object stores
311311
all the information needed to fully translate its contents when needed::
312312

313-
use Symfony\Component\Translation\Translatable;
313+
use Symfony\Component\Translation\TranslatableMessage;
314314

315315
// the first argument is required and it's the original message
316-
$message = new Translatable('Symfony is great!');
316+
$message = new TranslatableMessage('Symfony is great!');
317317
// the optional second argument defines the translation parameters and
318318
// the optional third argument is the translation domain
319-
$status = new Translatable('order.status', ['%status%' => $order->getStatus()], 'store');
319+
$status = new TranslatableMessage('order.status', ['%status%' => $order->getStatus()], 'store');
320320

321321
Templates are now much simpler because you can pass translatable objects to the
322322
``trans`` filter:

0 commit comments

Comments
 (0)
0