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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | locale_32.patch | 769 bytes | damien tournoud |
| #4 | locale.patch | 1.02 KB | Afief |
| #1 | locale.patch | 593 bytes | Afief |
Comments
Comment #1
Afief commentedGetting 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.
Comment #2
Afief commentedoops forgot to change the status
Comment #3
chx commentedcode 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.
Comment #4
Afief commentedfixed the code style, added upgrade function.
Comment #5
avangelist commentedI 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.
Comment #6
Afief commentedavangelist:
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.
Comment #7
damien tournoud commentedAfter 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/1is now generated asen/node/1).So there is two ways forward. We could either:
Comment #8
avangelist commentedDamien 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?
Comment #10
lilou commentedSee: #335122: Test clean HEAD after every commit and http://pastebin.ca/1258476
Comment #11
xanoMarking 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.
Comment #12
jerry2.0 commentedgo 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!
Comment #13
jaspm2004 commentedvery nice! this worked for me as a charm!!! thx