BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

[RFC] Implementing a routing override blacklist #206

Open Spomsoree opened 4 years ago

Spomsoree commented 4 years ago

I love this library, but in some cases I don't want to override all routes in my project. For example the search-route, which I have to call with /en/search.

Details

Description

I'd like to exclude some routes from the routing_override option. In my case I'd like to exclude the search route, but I could come up with more use cases for this.

I normally just create a controller or an extension to create api routes without localization. But this is not the best way in my opinion. It would be much cleaner to register all routes in the routing.yml and exclude the ones that I don't want to be localized.

Maybe it's even possible to add a flag to the routes itself?

search:
    path: /search
    defaults:
        _controller: controller.frontend:search
    translate: false

I'm looking forward to your thought on this.