How to disable internationalization for all packages of all routes when using JMSI18nRoutingBundle?

I use the Symfony2 JMSI18nRoutingBundle to allow the automatic internationalization of my routes. Individual route internationalization can be disabled in routing.yml as follows

index: pattern: / defaults: { _controller: AcmeBaseBundle:Welcome:indexRedirector } options: i18n: false 

However, I usually comment on routes in controllers and only define a prefix in routing.yml:

 AcmeApiBundle: resource: "@AcmeApiBundle/Controller/" type: annotation prefix: /api options: i18n: false 

In this case, disabling internationalization does not work properly, and routes are only agreed upon by adding the locale as a prefix for the URLs.

How to disable internationalization for all urls in a batch?

+4
source share
1 answer

Specify a parameter in the annotations. Sort of:

 /** * @Route("/", options={"i18n" = false}) */ 
+6
source

All Articles