Skip to content

Commit dc1be60

Browse files
authored
Update 4.2 deprecation
The TranslatorInterface has been deprecated in favor of Symfony\Contracts\Translation\TranslatorInterface The Translator::transChoice() method has been deprecated in favor of using Translator::trans() with "%count%" as the parameter driving plurals
1 parent e18e809 commit dc1be60

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

translation.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ of text (called a *message*), use the
119119
for example, that you're translating a simple message from inside a controller::
120120

121121
// ...
122-
use Symfony\Component\Translation\TranslatorInterface;
122+
use Symfony\Contracts\Translation\TranslatorInterface;
123123

124124
public function index(TranslatorInterface $translator)
125125
{
@@ -197,7 +197,7 @@ Message Placeholders
197197

198198
Sometimes, a message containing a variable needs to be translated::
199199

200-
use Symfony\Component\Translation\TranslatorInterface;
200+
use Symfony\Contracts\Translation\TranslatorInterface;
201201

202202
public function index(TranslatorInterface $translator, $name)
203203
{
@@ -230,6 +230,11 @@ method or the ``transchoice`` tag/filter in your :ref:`template <translation-tag
230230
For much more information, see :ref:`component-translation-pluralization`
231231
in the Translation component documentation.
232232

233+
.. versionadded:: 4.2
234+
235+
In 4.2 the ``Translator::transChoice()`` method has been deprecated in favor of
236+
using ``Translator::trans()`` with "%count%" as the parameter driving plurals.
237+
233238
Translations in Templates
234239
-------------------------
235240

0 commit comments

Comments
 (0)