schmittjoh / JMSI18nRoutingBundle

Allows you to internationalize your routing
http://jmsyst.com/bundles/JMSI18nRoutingBundle
358 stars 159 forks source link

Multiple translated path for same route #191

Closed CharlyPoppins closed 7 years ago

CharlyPoppins commented 8 years ago

Hi,

I'm trying to do something like this :

site_about:
    path: /a-propos
    path: /en/about-us
    defaults: { _controller: SiteBundle:Default:About }

site_food:
    path: /nourriture
    path: /en/food
    defaults: { _controller: SiteBundle:Default:Food }

is there a way to do this with this bundle ?

CharlyPoppins commented 8 years ago

up

Leprechaunz commented 7 years ago

Hi @CharlyPoppins

Leave 1 path field as default in routing file.

Create 'routes.fr.yml' with:

site_about: /a-propos
site_food: /nourriture

And file 'routes.en.yml' with:

site_about: /en/about-us
site_food: /en/food
CharlyPoppins commented 7 years ago

Hi @Leprechaunz, sorry for being long

We just figured out how it works thanks to your snippet,

thank you very much :)

ps for others :