Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the Symfony translation for specific bundles

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.

like image 207
Jean Bidon Avatar asked Jun 04 '15 01:06

Jean Bidon


2 Answers

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

framework:
  translator:
    enabled: false
like image 157
Vadim Kharitonov Avatar answered Sep 23 '22 19:09

Vadim Kharitonov


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

like image 37
kaznovac Avatar answered Sep 24 '22 19:09

kaznovac