File tree 2 files changed +50
-0
lines changed
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:
400
400
3. If the translation still isn't found, Symfony uses the ``fallback `` configuration
401
401
parameter, which defaults to ``en `` (see `Configuration `_).
402
402
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
+
403
412
.. _book-translation-user-locale :
404
413
405
414
Handling the User's Locale
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ Configuration
48
48
* `profiler `_
49
49
* `collect `_
50
50
* :ref: `enabled <profiler.enabled >`
51
+ * `translator `_
52
+ * :ref: `enabled <translator.enabled >`
53
+ * `fallback `_
54
+ * `logging `_
51
55
52
56
secret
53
57
~~~~~~
@@ -495,6 +499,42 @@ and activate the data collectors by hand::
495
499
496
500
$profiler->enable();
497
501
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
+
498
538
Full default Configuration
499
539
--------------------------
500
540
@@ -612,6 +652,7 @@ Full default Configuration
612
652
translator :
613
653
enabled : false
614
654
fallback : en
655
+ logging : " %kernel.debug%"
615
656
616
657
# validation configuration
617
658
validation :
You can’t perform that action at this time.
0 commit comments