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

How to prevent Routing translation for some pattern (ex: /admin) #74

Open
ricardclau opened this issue Oct 20, 2012 · 3 comments
Open

Comments

@ricardclau
Copy link

Hi

I am using this bundle to translate routes in my web application.
It works fine, but I would like some urls to not be translated, for instance those who belong to admin area that start with /admin prefix (and of course are under a Symfony2 security firewall)

Is there any easy way (I mean, using just config.yml configurations) to do so? I am unable to find it in the code

If not, is there any "not-so-easy" way to do so? :)

Thanks and regards

@ricardclau
Copy link
Author

I am sorry, I should have read #63

However, I think this should be mentioned in docs, as @g-g says in #63

For me, best place would be inside http://jmsyst.com/bundles/JMSI18nRoutingBundle/master/configuration as a note before #1 (like the comment about clearing cache).

You can close the issue if you want, but please update documentation, this bundle is just amazing but documentation needs to be improved ;)

@stof
Copy link

stof commented Oct 20, 2012

Routes having the i18n option set to false will not be translated.

In Symfony 2.1, you can add the options when importing a resource to apply it on the whole collection:

admin_routes:
    resources: admin.yml
    prefix: /admin
    options:
        i18n: false

@ricardclau
Copy link
Author

Oh! I didn't now about this! Works even with annotations!

  • @route("/admin", options={"i18n"=false})

on top of the controller

Thanks @stof for the trick!

Might this be added to SF documentation?

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

2 participants