Bug:

When multiple languages are enabled and language negotiation is set to "Path prefix with language fallback" and users visit a page without a language path prefix, language may be determined by either a user's preferred language or the user's browser settings. In these cases, language negotiation selects other than the default language, the user is unable to switch to the default language if that language has no prefix. E.g., English, French, and Spanish enabled, with English as the default language, with default settings (no English path prefix). User's browser preference is French. User visits home page, gets a French page. User clicks on "English" in the language switcher. The page loads in French.

This is a bug because the language switcher is broken--clicking the default language does not switch languages.

Cause:

If the default language doesn't have a prefix and language negotiation is set to "Path prefix with language fallback", language negotiation selects the user preferred language on pages without a prefix. Since the prefix is not used for the default language, there is no way to ensure it is selected.

Potential solutions:

1. If language negotiation is set to "Path prefix with language fallback", don't display any language without a prefix in the language switcher.

2. Require a prefix for all languages.

3. For languages without a prefix, pass the language in get encoding from the language switcher. Store the current language in the session, and use the session language if present and no language determined by either GET encoded variable or path prefix.

Related issues, because they both deal with serving multiple versions of a given page at the same path:

#339958: Cached pages returned in wrong language when browser language used

#282178: Language negotiation overhaul

Comments

xano’s picture

I suggest requiring a prefix for all languages, no matter if language negotiation is set to "Path prefix" or not. This is the simplest and most effective solution IMO.

GuyveR800’s picture

xano’s picture

Anonymous’s picture

Status: Closed (duplicate) » Needs review

Experiencing this exact problem in March 2013. Default Language does not have a path prefix. Is any solution available?

Anonymous’s picture

Status: Needs review » Closed (duplicate)

issue should be closed. Only viable solution is to add a path prefix to default language. I added "en" to default English under admin/config/regional/language