We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35d1090 commit 4c9291dCopy full SHA for 4c9291d
translation.rst
@@ -850,7 +850,7 @@ of:
850
851
use Symfony\Component\Translation\LocaleSwitcher;
852
853
- class SomeClass
+ class SomeService
854
{
855
private LocaleSwitcher $localeSwitcher;
856
@@ -885,10 +885,10 @@ of:
885
}
886
887
888
-.. note::
889
-
890
- The class :class:`Symfony\\Component\\Translation\\LocaleSwitcher` is
891
- autowired to the ``translation.locale_switcher`` service.
+When using :ref:`autowiring <services-autowire>`, type-hint any controller or
+service argument with the :class:`Symfony\\Component\\Translation\\LocaleSwitcher`
+class to inject the locale switcher service. Otherwise, configure your services
+manually and inject the ``translation.locale_switcher`` service.
892
893
Translating Database Content
894
----------------------------
0 commit comments