schmittjoh / JMSI18nRoutingBundle

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

Having 2 strategies ? #225

Open ludovicpages opened 6 years ago

ludovicpages commented 6 years ago

I'm using JMSI18nRoutingBundle with symfony 2.8 and i'm having a problem. I have one host per language, so my config.yml looks like this :

jms_i18n_routing:
    default_locale: fr
    locales: [fr, en]
    strategy: custom
    hosts:
        fr: foo.fr
        en: foo.en
    redirect_to_host: false

With this no problem, works has expected. I also have some entities that i made Translatable with the help of stof_doctrine_extensions behind the admin url.

And here comes the problems. I want the admin section to be in the foo.fr domain (main domain). So i need, some urls like :

foo.fr/fr/admin/post/edit/1
foo.fr/en/admin/post/edit/1

See what my problem is ? With the host strategy, the locale on foo.fr will always be FR, and it's i guess the normal behaviour. But i need somehow, to be able to override the locale on the main domain for some URLs.

Any idea how i can achieved that ?