1
votes

My project is in Symfony 3.2.6 and I try to generate the i18n routes in production mode with BeSimpleI18nRoutingBundle.

In dev mode, it's ok.

But in production mode, routes generated are always in same locale (the current).

(I already clear the cache)

I use these links to switch :

<a href="{{ path(app.request.attributes.get('_route'), {'locale': 'fr'}) }}">fr</a>
<a href="{{ path(app.request.attributes.get('_route'), {'locale': 'en'}) }}">en</a>

Do you have any idea ?

Thank you in advance.

1

1 Answers

0
votes

I found the solution.

For work in the dev mode, I had to update the "_main" route in "routing_dev.yml" with "type: be_simple_i18n" like this :

_main:
    resource: routing.yml
    type: be_simple_i18n

And the solution for the production mode is to add the same line in the "config.yml" where the "routing.yml" is imported like this :

framework:
    ...
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        type: be_simple_i18n