Download & Extend

Incompatible with Language negotiation set to "Path prefix with language fallback"

Project:Consistent Language Interface
Version:6.x-2.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

if Language negotiation method is set to "Path prefix with language fallback"
all links should have language prefix in the path, so that the language is preserved instead of changing to browser default value

as the module always remove the prefix for the link of default language
in case a user views a site which default language is different from browser's default language
when the user click on the default language link in the module's block
drupal would always do the browser language check again and always display browser's language
so the user would not be able to view the site's default language

the patch below fix the problem by performing check of language negotiation before removing the prefix for default language

at line 128 to 131:

$default_language = language_default(); 
if ($lang == $default_language->language && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_PATH) {
  $prefix = '';
}

Comments

#1

Subscribing

#2

Status:needs review» fixed

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

Had the same issue in latest stable release, see that the line

&& variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_PATH

is commented out again. Any reason for this? This causes the issue mentioned in O.P. again?

cheers

#5

Version:6.x-2.1» 6.x-2.5

The logic for this is changed in 2.6. If you want to override the browser default, then you can achieve the same thing by assigning a prefix for your default language. In 2.6 it should work.