Skip to content

Commit 1ad2378

Browse files
committed
added logging to translator.
1 parent 47fe03a commit 1ad2378

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

book/translation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,14 @@ checks translation resources for several different locales:
400400
3. 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.
410+
403411
.. _book-translation-user-locale:
404412

405413
Handling the User's Locale

reference/configuration/framework.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff 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

5256
secret
5357
~~~~~~
@@ -464,6 +468,37 @@ and activate the data collectors by hand::
464468

465469
$profiler->enable();
466470

471+
translator
472+
~~~~~~~~~~
473+
474+
.. _translator.enabled:
475+
476+
enabled
477+
.......
478+
479+
**type**: ``boolean`` **default**: ``false``
480+
481+
Whether or not to enable the ``translator`` service in the service container.
482+
483+
fallback
484+
........
485+
486+
**default**: ``en``
487+
488+
This option is used when the translation key for the current locale wasn't found.
489+
490+
For more details, see :doc:`/book/translation`.
491+
492+
logging
493+
.......
494+
495+
.. versionadded:: 2.6
496+
The ``logging`` option was introduced in Symfony 2.6.
497+
498+
**default**: ``true`` when the debug mode is enabled, ``false`` otherwise.
499+
500+
Logging can be disabled by setting this key to ``false``.
501+
467502
Full default Configuration
468503
--------------------------
469504

@@ -581,6 +616,7 @@ Full default Configuration
581616
translator:
582617
enabled: false
583618
fallback: en
619+
logging: "%kernel.debug%"
584620
585621
# validation configuration
586622
validation:

0 commit comments

Comments
 (0)