Skip to content

Added sticky_i18n_prefix option for i18n_prefix #146

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added sticky_i18n_prefix option for i18n_prefix #146

wants to merge 1 commit into from

Conversation

ericsvg
Copy link

@ericsvg ericsvg commented Mar 9, 2015

@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

@sfblaauw
Copy link

+1

@sotn0r
Copy link

sotn0r commented Jul 14, 2015

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

@mcwebb
Copy link

mcwebb commented Sep 29, 2015

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

@ericsvg
Copy link
Author

ericsvg commented Sep 30, 2015

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

@mcwebb
Copy link

mcwebb commented Sep 30, 2015

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
#146 (comment)
.

sotn0r added a commit to sotn0r/JMSI18nRoutingBundle that referenced this pull request Oct 20, 2015
sotn0r added a commit to sotn0r/JMSI18nRoutingBundle that referenced this pull request Oct 20, 2015
@jbenezech
Copy link

+1

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

Successfully merging this pull request may close these issues.

5 participants