Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In SF 3.2.6, problem to generate i18n routes in production mode. #102

Open
Crusider opened this issue Mar 27, 2017 · 1 comment
Open

In SF 3.2.6, problem to generate i18n routes in production mode. #102

Crusider opened this issue Mar 27, 2017 · 1 comment

Comments

@Crusider
Copy link

Hello,

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

In dev mode, it's ok.

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

I use this link 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>

Can you help me ?

Thank you in advance.

@Crusider
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant