Skip to content

Commit 292990b

Browse files
committed
minor #14291 [Translation] Change translatable example parameter key (natewiebe13)
This PR was merged into the master branch. Discussion ---------- [Translation] Change translatable example parameter key Updated the translatable example to use a key wrapped in `%` as recommended in the docs. Also changed the key to one that I think would be less likely confused with passing the whole order object. Commits ------- 24b9aeb Change translatable example parameter key
2 parents bd1b7f9 + 24b9aeb commit 292990b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

translation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ all the information needed to fully translate its contents when needed::
316316
$message = new Translatable('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', ['order' => $order], 'store');
319+
$status = new Translatable('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)