Let's say I create a node in lang #1 and then a translation in lang #2. I then assign them path aliases - alias #1 and alias #2. I use URL prefixes in the form of http://example.com/lang/alias. A user whose language Drupal detects as lang #1:

  • goes to http://example.com/lang #1/alias #1 path - everything's OK
  • goes to http://example.com/alias #1 path (no language prefix) - still fine, Drupal adds the missing prefix
  • goes to http://example.com/alias #2 path (no language prefix, different alias) - Boom! 404, page not found

Why? I would expect Drupal to either:

  • display the node in the other language or
  • redirect the user to the appriopriate path (http://example.com/lang #1/alias #1 in this case)

It's really frustrating because in some cases the module's language detection system fails.

CommentFileSizeAuthor
#13 759974-drupal-6-16-path-inc-multilingual-settings-ignored.patch2.37 KBAnonymous (not verified)

Comments

Anonymous’s picture

Component: User interface » Code
Category: bug » support
Priority: Critical » Normal
archetwist’s picture

Thank you for your comprehensive reply.

With this understanding, we can explain the behavior that you have seen. There was no prefix, so the rule F1 sets the 'Current language' to the default language, which was English (I guess). The alias was toward a page in French. The rule F2 says that no content should be presented.

The problem is the alias was for a page in English which is also the default language of my site! Drupal detected my browser's language is Polish (correct) and presented the interface and the 404 message in Polish.

So, to sum it up, when the default language is lang #1, browser language is lang #2 and user goes to alias #1 (without a language prefix) he gets a "page not found" error. I would like Drupal to redirect him to alias #2. The current behaviour is not consistent - if the same user (lang #2) went to alias #2 the missing prefix would be added for him.

I've tried the i18n Redirect module and also the patch at http://drupal.org/node/201675#comment-2630498 but with no luck.

I haven't tried any of your patches as I'm not sure they address my issue.

Anonymous’s picture

Anonymous’s picture

archetwist’s picture

I assume that you have swapped the languages lang #1 and lang #2 in your second paragraph in comparison with the convention fixed in your Description. We need to be sure about this to reproduce your problem correctly because English is different than the other languages in Drupal -- there is no perfect symmetry.

Well, yes, sorry for the confusion. I didn't know the default language setting is significant.

We also need to know the user language in your account in case you were logged in because the user language supersedes the browser language in the fallback procedure. (This one thing that my patch allows to change).

Both browser language and account language are set to Polish. Account language setting doesn't seem to be of much significance in this scenario - the same undesirable behaviour can be observed for anonymous visitors whose browser language is Polish.

Negotiation sets to 'Prefix with language fallback'
Multilingual settings sets to 'Mixed language ...'
User not logged in
Default language is English
Browser language is Polish
User goes to alias_en (for a page in English without a language prefix)

That is correct with the addition that it doesn't seem to matter whether the user is or is not logged in.

Expected behavior: The page in the default language English (which is available) is presented.
Observed behavior: Page not found error.

Exactly.

Anonymous’s picture

archetwist’s picture

Category: support » bug

So it seems it's not just me having troubles figuring out the Internationalization module. It looks like it's a bug.

Anonymous’s picture

Category: support » bug
Anonymous’s picture

Component: User interface » Documentation
Anonymous’s picture

Component: Code » User interface
Priority: Normal » Critical
archetwist’s picture

Component: Code » User interface
Priority: Normal » Critical

I don't think it's an UI issue. If what you are saying is that there is no way to redirect a user to the appropriate translation when there is no prefix specified then such a feature should be introduced.

Anonymous’s picture

Component: Documentation » User interface
Assigned: Unassigned »
Anonymous’s picture

archetwist’s picture

Assigned: Unassigned »

I've tested your patch with my account language first set to Polish and then English.

    • default lang: English
    • account lang: Polish
    • path: English alias without a prefix
    • redirected to the Polish translation (great!)
    • default lang: English
    • account lang: English
    • path: Polish alias without a prefix
    • error 404

So it seems it only works for the account language. But still, it's a real step forward.

Anonymous’s picture

Anonymous’s picture

Assigned: » Unassigned
kewlguy’s picture

Assigned: » Unassigned

subscribing

jose reyero’s picture

Status: Active » Closed (fixed)

From #11 "there is no way to redirect a user to the appropriate translation when there is no prefix specified then such a feature should be introduced."

Yes, that's how it works, think again how it can work consistently before you request that "feature".

Not i18n issue.