Languages are: EN (default) and DE (German)

When I set a Users language to DE (German) = not the default language - I get two problems:

1. the user logs on and the site switches to German interface and content (fine), but if the User switches now to English he will get Page not found
the URL is switched over properly from http://www.example.com/de/content/benutzer-login to http://www.example.com/content/members-login - the de/ is correctly dropped.
If a User logs in with the default language EN this problem does not occur.
2. If the User logged in with the non-default language goes to the home page the language switching does not work and he stays on the non-default homepage (in this case German).

I am using the follwoing modules:

CommentFileSizeAuthor
PLV-Modules-12-01-2009.png46.78 KBtryitonce

Comments

tryitonce’s picture

Priority: Normal » Critical
Anonymous’s picture

Hi,

Were you able to resolve your issue by any chance? I've been fighting with the exact same thing for a couple of days, but to no avail.

ganaya’s picture

Hi,

I have the same problem, I've being trying to fix it for a while and I just can't do it, any ideas?
Thanks,

dddave’s picture

Just a thought for you guys:

Are you sure that you have defined a path-prefix for English?

Go to /admin/settings/language/edit/ and edit English. Define a path-prefix (en of course). Drupal won't complain if you forget this.

tryitonce’s picture

No, I have not resolved the problem yet.

I put the whole thing on the "back burner" and focused on solving other problems.

dddave's suggestion might be a good idea to follow. I will not be able to try this out for a week or two, though.

In case any of the other "combatants" makes some progress and finds the solution - please do report back here. Thanks

Anonymous’s picture

Thanks for your input dddave,

In my case, if I add en as the prefix for English language my website blows up as well. For example, if I got a node at http://www.example.com/node/5 trying to resolve the same page at http://www.example.com/en/node/5 will result in "page not found" message.

dddave’s picture

Well, that was to be expected because you actually change how paths are created. Therefore at admin/settings/language/configure you have an explicit warning for when you change prefix related settings. Perhaps you could bulk-create new aliases with pathauto?
I am not an expert but I have it working very well.

If you can start clean you should define the prefixes and of course a "Language Negotiation" setting according to this. After that you can use pathauto to define the aliascreation. I use a genereal setting like "contenttype/[title/raw]" and no specific settings per language. Therefore the prefix gets included automatically.

Works well.

Anonymous’s picture

In order to simplify the process I am not using any aliases at the moment. What I got is a fresh Drupal 6.10 install with only two nodes created.

My "Page" content-type allows for multilingual support and is set to "Enabled, with translation". Language negotiation is set to "Path prefix only".

I created a node (nid 5) with language set to English then used "Translate" tab to create its French equivalent (nid 6). I can see that both are linked just fine.

I can access http://www.example.com/node/5 (English) and http://www.example.com/node/6 (French) just fine. However, once I click "Français" link in either Language switcher block or at the bottom of the node body it tries to redirect me to http://www.example.com/fr/node/6 where I get "Page not found" error.

I'm not new to Drupal, but I never used locale/i18n before. From what I've gathered so far, this is the expected behavior. Except, of course, you are not supposed to see the error yet the translated equivalent of the node instead. Perhaps, it is something minor that I'm missing, but I've been over every setting multiple times and it is driving me a little crazy.

Thanks.

Anonymous’s picture

Well, I have finally figured out what my problem was. I disabled Clean URLs and to my surprise translations worked (except the home page where I had to enable multilingual front_page variable, see here for more on multilingual variables).

Turned out it was a missing "/" in .htaccess:

Instead of RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA] I changed it to RewriteRule ^/(.*)$ /index.php?q=$1 [L,QSA]. Didn't realize it at the time of enabling clean urls.

Something as silly as this cost me 3-4 days of troubleshooting! Ouch!

tryitonce’s picture

Hi P1x44r,

thanks for sharing this.

The RewriteRule you amended with the additonal "/" is coming with the Drupal installation. I don't know anything about this - but it might be a general problem and more people may be very grateful for your advice.

I have just added the "/" and will see if it also solves my problem.

Many thanks and the 3-4 days of troubleshooting are greatly appreciated and shall be repaid by other searching souls along the Drupal path.

Good luck

Anonymous’s picture

Hi tryitonce,

You know, now that I actually looked at default .htaccess files that ships with Drupal and it clearly says there:

"# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal"

You see, I got my own global drupal.conf file that is loaded at httpd start-up and I never had the RewriteBase in it. That's because I can not use RewriteBase directive in my case (I would need to include contents of drupal.conf in my VirtualHost configuration which is stored in httpd.conf).

Long story short, I think my case is not very typical, but hopefully it can provide others with at least some pointers if they're stuck with the same issue.

deverman’s picture

Version: 6.x-1.0-beta6 » 6.x-1.0

I have a problem with page not found errors. If I set a users default language to say "Chinese". Then If i create say a blog post and I mark the post as in English. That user can see the teaser of the post on the front page but when clicking on the link gets a page not found error.

English is set to the default language so I thought it would fall back to English if the content didn't exist in Chinese instead of showing page not found.

http://www.example.com/content/example_content <-- user goes to this link with account language set to zh-hans

http://www.example.com/zh-hans/content/example_content <-- Page not found occurs here after redirect

I am also using the Global Redirect and PathAuto modules just in case that matters.

deverman’s picture

I also found that if I switch to Chinese while viewing the node using the language switcher I end up on this page: http://www.example.com/zh-hans/node/38812

patataur’s picture

Category: support » bug
Priority: Critical » Minor

I have a similar problem

My drupal installation is at : /www/drupal/

I use Path module to rewrite URLs

I created my pages with EN as the default language.
I have recently added a new language, set it to default. As a result, all my rewrited URLs lead to a "page does not exist". If i type in the www.mysite.com/node/5 url the page shows though. So it seems the urlrewrite is being tampered with by the language change.

deverman’s picture

Seems not many people use drupal for multilangauge websites all my internationalization questions go unanswered. I am happy to provide more information if you tell me what you need to answer the question.

tryitonce’s picture

Well, I for now have put the issue on the back burner.

I am focusing on setting up some projects just in English. Sorry guys.

The answer is out there and it just needs a bit of tweaking and fiddling with the path settings related to the internationalisation. And it seems it is important to install the multilingual modules from the start.

I would appreciate if any successful Drupaler would report back here - I will - but who knows when.

Good luck.

deverman’s picture

I have tried to make adjustments with the path auto module but I still have a problem here. Does anybody have any idea of what part of the code is causing this problem? Is it the global redirect module? Is it in drupal core or path auto? Where to start to look to debug this?

So far I have not seen drupal able to perform properly in basic multilingual situations. I still have outstanding issues here:

i18n menu translation export/import issue

http://drupal.org/node/425276

Non Default language Front Page Loads Slowly because of Select Count(*) with table in innodb format

http://drupal.org/node/431504

Translating content causing duplicates with language not showing

http://drupal.org/node/431286

jose reyero’s picture

Project: Internationalization » Drupal core
Version: 6.x-1.0 » 6.x-dev
Component: User interface » language system
Category: bug » support
Status: Active » Fixed

In short: if English has no prefix, a logged in user cannot 'switch to English'. So you need to set up a prefix for English or other default language.

Please, read carefully from the Language Configuration page:

Path prefix with language fallback.
1. The presentation language is determined by examining the path for a language code or other custom string that matches the path prefix (if any) specified for each language.
2. If a suitable prefix is not identified, the display language is determined by the user's language preferences from the My Account page,
or
by the browser's language settings.

3. If a presentation language cannot be determined, the default language is used.

Status: Fixed » Closed (fixed)

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

finex’s picture

I've solved fixing the .htaccess

Thanks!

finex’s picture

I've speak too early... that workaround doesn't works. If I set even the default language with a prefix, it works, if the default language doesn't have a prefix, the problem is not solved :-(

tryitonce’s picture

Yes, that seems to be the case.

Though I found that using the prefix (or suffix - depending where you are looking from) of the country code "en", "de", etc. is not a bad idea as it indicates that the site is multi-lingual and the default language is not revealed in the url.
Of course for some sites / companies / organisations it might be better to have the default language strongly represented by not using the suf-/prefix.

But setting up a multi-language site is not easy - you have been warned - good luck ...

ebenfarnworth’s picture

Version: 6.x-dev » 6.16
Assigned: Unassigned » ebenfarnworth
Category: support » task
Status: Closed (fixed) » Fixed

I have been googling around to look for an answer for this. I'm quite new to working with drupal but I have built a site that works in English and Chinese. I had a problem that if a users language was not the default language then they could not see the site in the default language (english). It was because English the default language dose not have a prefix by default. I added a prefix on my local host test site (en) and then looked at lots of the pages. They all worked, it did not brake my site at all! I then got brave and added en as path prefix on my production site and it worked! So far no broken urls!
If you are going to try this for a site that has content already, try it on a test site first!
Good luck

tryitonce’s picture

Yes, Eben,

I think you are right - Drupals relevant modules for this should ship with en set for English as a default.

....

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

@P1x44r had exactly the same issue, thanks for pointing it!...

the nginx setup there is flawed : http://drupal.org/node/110224#comment-3750036