File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,15 @@ checks translation resources for several different locales:
4004003. If the translation still isn't found, Symfony uses the ``fallback `` configuration
401401 parameter, which defaults to ``en `` (see `Configuration `_).
402402
403+ .. versionadded :: 2.6
404+ The ability to log missing translations was introduced in Symfony 2.6.
405+
406+ .. note ::
407+
408+ When Symfony doesn't find a translation in the given locale, it will
409+ add the missing translation to the log file. For details,
410+ see :ref: `reference-framework-translator-logging `.
411+
403412.. _book-translation-user-locale :
404413
405414Handling the User's Locale
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ Configuration
4848* `profiler `_
4949 * `collect `_
5050 * :ref: `enabled <profiler.enabled >`
51+ * `translator `_
52+ * :ref: `enabled <translator.enabled >`
53+ * `fallback `_
54+ * `logging `_
5155
5256secret
5357~~~~~~
@@ -495,6 +499,42 @@ and activate the data collectors by hand::
495499
496500 $profiler->enable();
497501
502+ translator
503+ ~~~~~~~~~~
504+
505+ .. _translator.enabled :
506+
507+ enabled
508+ .......
509+
510+ **type **: ``boolean `` **default **: ``false ``
511+
512+ Whether or not to enable the ``translator `` service in the service container.
513+
514+ fallback
515+ ........
516+
517+ **default **: ``en ``
518+
519+ This option is used when the translation key for the current locale wasn't found.
520+
521+ For more details, see :doc: `/book/translation `.
522+
523+ .. _reference-framework-translator-logging :
524+
525+ logging
526+ .......
527+
528+ .. versionadded :: 2.6
529+ The ``logging `` option was introduced in Symfony 2.6.
530+
531+ **default **: ``true `` when the debug mode is enabled, ``false `` otherwise.
532+
533+ When ``true ``, a log entry is made whenever the translator cannot find a translation
534+ for a given key. The logs are made to the ``translation `` channel and at the ``debug ``
535+ for level for keys where there is a translation in the fallback locale and the ``warning ``
536+ level if there is no translation to use at all.
537+
498538Full default Configuration
499539--------------------------
500540
@@ -612,6 +652,7 @@ Full default Configuration
612652 translator :
613653 enabled : false
614654 fallback : en
655+ logging : " %kernel.debug%"
615656
616657 # validation configuration
617658 validation :
You can’t perform that action at this time.
0 commit comments