Skip to content

New strategy#117

Open
lughino wants to merge 6 commits into
schmittjoh:masterfrom
lughino:master
Open

New strategy#117
lughino wants to merge 6 commits into
schmittjoh:masterfrom
lughino:master

Conversation

@lughino
Copy link
Copy Markdown

@lughino lughino commented Dec 6, 2013

Hi,
my purpose is to create a new strategy, which enables it to stand as a strategy prefix_except_default but I have a listener to set the route according to the local user set. (such as the strategy of prefix)
eg.

default local: en
locales [en, fr]
a user with local fr accessed on www.example.com and is redirected to www.example.com/fr.
While a user with local en or with local different from locales accesses www.example.com.

At the moment I can't understand why it doesn't work.
I tried to put a var_dump inside the new listener, but it seems that does not join it.
It works exactly like the strategy of "prefix_except_default" ..

Can you tell me what is wrong or if you could do what I want?

Thanks

@andrejsramko
Copy link
Copy Markdown

does this work already? how does the bundle "detect" user's locale?
what about using something like this when user does not choose the locale explicitely?
$this->defaultLocale = $request->getPreferredLanguage();

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.

2 participants