Steps to reproduce the bug:

1. Install drupal.
2. Add and import another language(I tried Arabic and Hebrew)
3. Set Language Negotiation to Path Prefix Only.
4. Set the default language to the newly added language.
5. Enable Language Switcher block.
6. Press on the link to your new language in the Language Switcher.
7. Press the link for the English website again
Expected behavior: Seeing the English version of the website.

What Happens Instead: Drupal goes to a page without a language prefix( admin/settings/language in my case) and displays it in my new default language.

I have not found a way to get back to the English website other than setting English as the default language again.

CommentFileSizeAuthor
#7 locale_32.patch769 bytesdamien tournoud
#4 locale.patch1.02 KBAfief
#1 locale.patch593 bytesAfief

Comments

Afief’s picture

StatusFileSize
new593 bytes

Getting it to work:

To manually fix the bug one needs to set a prefix for the English language so it will have it's own unique path.

patch created against the drupal 6.2 version of the file from the drupal root directory. This is my first patch so I hope that this is how it should be done.

Afief’s picture

Status: Active » Needs review

oops forgot to change the status

chx’s picture

Status: Needs review » Needs work

code style: you need a space after the comma

bigger problem: if this is what we want --Goba will verify if we do-- then we need an upgrade too.

Afief’s picture

Status: Needs work » Needs review
StatusFileSize
new1.02 KB

fixed the code style, added upgrade function.

avangelist’s picture

I have also been informed today that a site I have up when viewed in France successfully auto displays french content, however if you wish to view in english it will say page cannot be displayed.

Afief’s picture

avangelist:

This is not the issue I have fixed though. The English page should display fine, but with the default locale you've set instead of English.

Edit: although it might have something to do with it now that I think about it... unfortunately I have no way of confirming it.

damien tournoud’s picture

Version: 6.2 » 7.x-dev
StatusFileSize
new769 bytes

After a (quite long) discussion with afief on IRC, we realized that changing the prefix for english in the update function will break outgoing URLs for websites that: (1) use "Path prefix with fallback" negociation mode (ie. LANGUAGE_NEGOTIATION_PREFIX), (2) have more than one language installed and (3) use English as the default language. In that case, URLs for english will be generated with the prefix, leading to content duplication (ie. node/1 is now generated as en/node/1).

So there is two ways forward. We could either:

  1. change the default but don't change existing sites (that's what's being done in the attached patch), or
  2. won't fix this, and work out a better documentation.
avangelist’s picture

Damien do you know whether this went to drupal notification for future release. We are now on 6.6 and this is still an issue with core. I stupidly expected this to have been resolved by now only to set myself back 2 weeks in a development cycle because it was still there.

I had a thought on the subject whilst reviewing your original post. Would it be better if Drupal was language neutral by default? This way presumably assigning an English node would always create a correct url and reverse out this problem?

I know at present it is not possible to install drupal language neutral but just maybe it would be an idea?

Status: Needs review » Needs work

The last submitted patch failed testing.

lilou’s picture

Status: Needs work » Needs review
xano’s picture

Status: Needs review » Closed (duplicate)

Marking this issue as a duplicate of #338055: Ensure non-default languages always have a path prefix, since we kind of have a solution in that issue and because this issue has been inactive for some time now.

jerry2.0’s picture

go to: admin/settings/language
the first select you language you want to set default.
click "edit" link in the line English languge

-Path prefix: enter "en".
=> Click saved language button.

go to admin/settings/language/configure
-checked "Path prefix only". => click "save settings" button
=> Finally click home button . Well done!

jaspm2004’s picture

go to: admin/settings/language
the first select you language you want to set default.
click "edit" link in the line English languge

-Path prefix: enter "en".
=> Click saved language button.

go to admin/settings/language/configure
-checked "Path prefix only". => click "save settings" button
=> Finally click home button . Well done!

very nice! this worked for me as a charm!!! thx