JMSI18nRoutingBundle icon indicating copy to clipboard operation
JMSI18nRoutingBundle copied to clipboard

Added sticky_i18n_prefix option for i18n_prefix

Open Jukurrpa opened this issue 9 years ago • 6 comments

@Brammm 's i18n_prefix is great but has a small issue when you use it along prefix_except_default strategy as the prefix is also removed from the path for the default locale, which can be problematic for security settings (firewalls and access control).

I added a sticky_i18n_prefix (not sure the name is great) that can be set to true so that the prefix is in the path no matter what (en is the default locale in this example):

dashboard:
    path: /dashboard
    options: { i18n_prefix: /admin }

Route for en locale: /dashboard Route for fr locale: /admin/fr/dashboard

dashboard:
    path: /dashboard
    options: { i18n_prefix: /admin, sticky_i18n_prefix: true }

Route for en locale: /admin/dashboard Route for fr locale: /admin/fr/dashboard

Jukurrpa avatar Mar 09 '15 11:03 Jukurrpa

+1

sfblaauw avatar Mar 16 '15 14:03 sfblaauw

Good solution. Would save me a lot of troubles with prefixing. @schmittjoh will this be pulled?

sotn0r avatar Jul 14 '15 15:07 sotn0r

+1 to the idea, although this implementation didn't seem to work, though I may have configured something wrong

mcwebb avatar Sep 29 '15 17:09 mcwebb

What's the issue you're having? I committed the very code I'm using and don't have any problems.

Jukurrpa avatar Sep 30 '15 14:09 Jukurrpa

Hi, I appreciate your work on this. It didn't work for me out of the box, and I didn't have time to properly diagnose the issue, so I reverted to the simple prefix strategy. I suspect it's maybe an edgecase. If I have time after I finish my current project I'll look into it more an give proper feedback.

On Wed, 30 Sep 2015 15:06 Jukurrpa [email protected] wrote:

What's the issue you're having? I committed the very code I'm using and don't have any problems.

— Reply to this email directly or view it on GitHub https://github.com/schmittjoh/JMSI18nRoutingBundle/pull/146#issuecomment-144419537 .

mcwebb avatar Sep 30 '15 14:09 mcwebb

+1

jbenezech avatar May 27 '16 04:05 jbenezech