Skip to content

Commit d60cfe0

Browse files
committed
bug #8850 change to TranslatorInterface (giansalex)
This PR was merged into the 4.0 branch. Discussion ---------- change to TranslatorInterface Commits ------- ff8acaa update to translatorInterface
2 parents 795b782 + ff8acaa commit d60cfe0

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
@@ -120,9 +120,9 @@ for example, that you're translating a simple message from inside a controller::
120120

121121
// ...
122122
use Symfony\Component\HttpFoundation\Response;
123-
use Symfony\Component\Translation\Translator;
123+
use Symfony\Component\Translation\TranslatorInterface;
124124

125-
public function index(Translator $translator)
125+
public function index(TranslatorInterface $translator)
126126
{
127127
$translated = $translator->trans('Symfony is great');
128128

@@ -199,9 +199,9 @@ Message Placeholders
199199
Sometimes, a message containing a variable needs to be translated::
200200

201201
use Symfony\Component\HttpFoundation\Response;
202-
use Symfony\Component\Translation\Translator;
202+
use Symfony\Component\Translation\TranslatorInterface;
203203

204-
public function index(Translator $translator, $name)
204+
public function index(TranslatorInterface $translator, $name)
205205
{
206206
$translated = $translator->trans('Hello '.$name);
207207

0 commit comments

Comments
 (0)