I would like ip2locale to provide the default language for users, but I would like the users to be able to move to other languages, when a path prefix is explicitly specified.

That is: I would like http://www.example.com/somepage to refer to the page in the current country's language, but http://www.example.com/en/somepage always to refer to the English version.

(I am closing issue #569952: It would be worth mentioning in the docmentation, as I now understand the solution I offered there is incorrect.

When language negotiation is "path prefix with default", the default (i.e. the user language or the browser language) always overrides ip2locale. That is, ip2locale has not effect.

Conversely, when language negotiation is "path prefix only", ip2locale seem to override any prefix in the path.

).

Comments

Gabriel R.’s picture

Good observation about the path prefix setting. It solves some of my problems.

I don't have the issue with the language switch, visiting a page with a /lng/ prefix does the switch correctly.

mrfelton’s picture

Status: Active » Postponed (maintainer needs more info)

Please can you try with the latest code in git. It seems to be working for me using either 'Path prefix with language fallback' or 'Path prefix'.

Also, I made a slight change that should ensure that no redirection is performed if you explicitly include a specific path prefix in your request.