17

I am creating a webapp running with Symfony 2.7, which is designed to be used only with one language (a unique locale). I can see in profiler many missing messages in every translation domain, but I don’t need translation at all.

How can I disable the translation component?

Edit : What if I want to keep translation for some bundles, and disable it for others bundles ? For instance, I have Sonata Admin Bundle, and I want to keep using it in with its translation, but I don't want Symfony to look for translation messages with other bundles.

Edit 2 : So I guess it's not possible to disable translation only for one of my own bundle ? I still have missing translation messages warning in the profiler.

Jean Bidon
  • 171
  • 1
  • 6

2 Answers2

26

You can disable translation by configuration. Edit app/config/config.yml

framework:
  translator:
    enabled: false
Vadim Kharitonov
  • 970
  • 6
  • 14
  • 3
    Thanks, but what if I want to disable translation only for some bundles in particular ? For instance, I have Sonata Admin Bundle, and I want to keep using it in with its translation, but I don't want Symfony to look for translation messages with other bundles. – Jean Bidon Jun 04 '15 at 10:23
  • FrameworkBundle is a "configuration manager" for each symfony's component. You can enable or disable component only at all. – Vadim Kharitonov Jun 04 '15 at 22:24
  • When you disable the `translator` the translator service still is available. The only difference we notice when disabling the framework translator is that the `profiler toolbar` translation panel isn't available anymore. Probably because adding the `data collector listener` has a higher priority. – Rvanlaak Jan 07 '16 at 09:18
  • 1
    It's not a true answer, I want just disable notice not translator – A.Seddighi May 10 '18 at 10:32
1

to disable translation logger set this in config/packages/translation.yaml

framework:
  translator:
    logging: false

see the reference for the translator section in FrameworkBundle's Configuration: https://symfony.com/doc/current/reference/configuration/framework.html#translator

kaznovac
  • 1,303
  • 15
  • 23